"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: 16
Joined: Fri Apr 20, 2018 2:36 am
Contact:

"End of Line Expected" When Additional Parameters After String

#1 Post by Poorman65 »

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
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

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

#2 Post by Ocelot »

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

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

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

#3 Post by Remix »

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 ] 
Frameworks & Scriptlets:

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

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

#4 Post by Poorman65 »

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: Google [Bot], piinkpuddiin