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.
default Plaza = Place("something","something","THIS")
label makeCheck(where):
"[where]" ####The 'where' variable holds "Plaza" Here I just check that it is so and indeed it is
if where.when == "THIS":
#do stuff
Now I know this isn't the correct way to go about it because it will look for object Place called 'where'.
The error I get is 'unicode' object has no attribute 'when'.
What is the rest of your code?
Where/how do you define the class Place.
Where/how do you define the variable where?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Just got it working a minute ago using eval()
The rest of the code isn't relevant (Place is a class defined in init python and variable 'where' is passed through the call label)
Remix wrote: ↑Sun May 19, 2019 12:34 pm
getattr( store, where ).when
is probably the most Ren'Py centric
Why is where a string though? The problem would seem to be in what you are passing into the screen (a string rather than an object)
Thanks for the info!
Why a string? Quite complicated I'm afraid, it's a complex logically textual game and the actual string is a part of a longer sentence. Main thing is I now got two ways to go about it.