"End of Line Expected" When Additional Parameters After String

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Poorman65
Newbie
Posts: 12
Joined: Fri Apr 20, 2018 2:36 am
Contact:

"End of Line Expected" When Additional Parameters After String

#1 Post by Poorman65 » Tue May 22, 2018 1:51 pm

I am trying to create a Custom-Defined Statement that will contain more than one String. It appears that the parser is not able to handle any parameters after the first String in the Statement.

Here is an example:

Code: Select all

showTimedImage 2 me x y z "a string"  q r s "another string"
In this example I get an "end of line expected" on the parameter 'q'.

and here is the actual example of my custom statement:

Code: Select all

showTimedImage 2 "Riley S01_Vixens_Riley_Initial" waitress "Hey!"
In this example I get an "end of line expected" on the parameter 'waitress '.

Is it possible to have multiple Strings in a Statement or will I have to break this into two Statements?

User avatar
Ocelot
Miko-Class Veteran
Posts: 849
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

Re: "End of Line Expected" When Additional Parameters After String

#2 Post by Ocelot » Tue May 22, 2018 1:57 pm

How your Custom-Defined Statement defined?
< < insert Rick Cook quote here > >

User avatar
Remix
Miko-Class Veteran
Posts: 958
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: "End of Line Expected" When Additional Parameters After String

#3 Post by Remix » Tue May 22, 2018 4:06 pm

lexer.string will match ", ', or even ` through until the last occurrence of same on the line

Use something like:

Code: Select all

### pseudo code

    curpos = lexer.pos
    
    if lexer.python_string():

        value = lexer.text[ curpos:lexer.pos ] 
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Finish Catmull-Rom Spline pathing
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

Poorman65
Newbie
Posts: 12
Joined: Fri Apr 20, 2018 2:36 am
Contact:

Re: "End of Line Expected" When Additional Parameters After String

#4 Post by Poorman65 » Tue May 22, 2018 4:51 pm

Got myself in the middle of trying something else. I'll post once I can get back to trying this again later.

Post Reply

Who is online

Users browsing this forum: GeeSeki