EDIT: Well, Philat already answered, so this post is mostly non-relevant. But hey, I typed it out already so here you are. XD Plus I always explain every step, even if they seem obvious, just for other users that might also take a look at it. So that's why I included the explanations for the button codes. Sorry about that. =P /EDIT
Hello. I'm *really* not that good at coding. You seem better at it than me, to be honest. But I can understand it quite well nonetheless, so I can at least provide a quick answer for your question #1 (in case you have time to work on it before one of the others can comment).
Your assumption is correct. With the code from Philat the variables
picked_pierce,
picked_lucky and
picked_bart are combined into the single variable
picked. So instead of 3 variables you're only using one. He sets this variable in this section (this one is the button for picking "bart"):
Code: Select all
imagebutton:
(snip)
action [ SensitiveIf(picked==None), SetVariable("picked", "bart") ]
The same for the
left variables that he combined into one variable with 4 different values (if you include the default "None"). He sets this in the next set of buttons (this one is for leaving "pierce"):
Code: Select all
imagebutton:
(snip)
action [ SensitiveIf(picked!="pierce"), SetVariable("left", "pierce"), Return() ]
Note that the button checks if the variable
picked!="pierce", so you can't leave pierce if you picked pierce (obviously). This makes the code a lot more refined (if not easier) since each button checks the same variable, in the same manner, just for another value. Then, the script uses the single variable
left = "????" to just go to one of three labels, without having to check for each variable of
picked_pierce,
picked_lucky and
picked_bart:
It's pretty smart actually (or maybe pretty natural if you're good at coding?). I would totally have done the same thing as you did with all the different variables. The code for my own VN is not very refined. XD
NOTE: Don't forget to set a default value. Perhaps that's the problem with your error. I'm not sure. Also, you should use the exact strings that philat mentioned,
including quotes, because you're using strings as variables. So:
Code: Select all
picked = "pierce" #to set the variable
if picked == "pierce": #to use/check the variable