Okay. So the only thing that you've missed is that
You must be registered to see the links
should be part of a
You must be registered to see the links
definition.
You define what makes up a screen using what RenPy calls
You must be registered to see the links
. Something you set up separately and then use in your code. You invoke a screen using either
show screen
or
call screen
.
Screens can be defined anywhere. Some people will code them within their main script, some will add their screens to the
screens.rpy
file and others will create their own
.rpy
file and put their custom screens in there. Honestly, anywhere is fine.
You must be registered to see the links
[...]
displays a pre-written screen on top of the existing UI and waits for the screen to trigger an action.
You must be registered to see the links
[...]
displays a pre-written screen on top of the existing UI and just carries on.
Actions are still processed, but if the player never clicks on the right place - nothing will ever be triggered.
"show" is generally used for things like navigation/room buttons or status windows. Things the player may or may not use.
"call" is generally used for things that require the player to do something before continuing.
99%
* of the time, "called" screens will have the
show modal
which causes all other UI elements to be disabled while the current screen is being shown. It basically forces the player to use the screen and nothing else.
* 84.7% of statistics on the internet are randomly made up on the spot and do not reflect real life.
70%
* of the time, "shown" screens will have a matching
You must be registered to see the links
statement too.
Something else I think is worth mentioning is that python and RenPy are case sensitive. "a" is not the name as "A", "True is not the same as "true"... or in the case of your code... "Function" is not the same as "function". It's a pain in the arse, but it's something you'll have to get used to.
Finally,
$
is used by RenPy as shorthand for "do python command". Some people confuse it with "set variable" because that is how it is used most of the time. I don't think you would need the
$
as part of your action.
Edit: As Anne points out in the post below, Function ()
should be coded differently than I had it. I've updated it to be what I *THINK* it should be like. You may need to tweak it a bit. I'm guessing that like Jump()
, everything needs to be wrapped by double quotes too. Again, a guess on my part. My original wrong answer was action Function (items.append("bluecup")
.
Your final code might looks something like this:
Python:
screen name_of_screen():
modal True
imagemap:
hotspot (688, 588, 173, 131) action Function ("items.append", "bluecup")
label start:
jump meeting
label meeting:
scene chat1 with dissolve
m "I hope you enjoyed the tour"
m "There is a big blue cup on the table [mc] if you would like a drink"
show chat2 with dissolve
call screen name_of_screen
m "Thank you for attending"
m "Lets go over your results [mc]"
label results:
scene office with dissolve
show maggie with moveinright
if "bluecup" in items:
m "So [mc] did you ever finish that game either?"
m "Tomorrow you need to learn blender"
else:
m "Go to bed [mc]"
# blah, blah, more code.
I've called the screen "name_of_screen". Obviously it can be anything. Like images and labels, it helps to name them in a way that makes sense to you.
Obviously, I haven't tested this code. You may run into some syntax or runtime errors. The core is basically correct, but some of the small details may be wrong.