Basic idea: Player gets two actions. Each action needs an attack and a target.
Problem = How do I get renpy to remember the variables I set/know if the player has already used up an action while using image buttons.
I tried using if statements to no avail, especially since I already figure that jumping back to the main_combat screen invalidates the variables I changed since its going back to a previous state in the game.
You can see I have action 1 set but I cant even get that to function properly nor do I know the best way of having renpy check if action 1 has been set or not given how my labels are setup right now.
Code: Select all
label start:
$ attack = "nothing"
$ target = "no one"
$ action1 = "nothing"
$ action2 = "not do a damn thing"
label main_combatscreen:
e "Ok so first you are going to do [action1], then you will [action2]"
call screen attack_UItest
#combat screen with a button labeled punch
screen attack_UItest():
add "smoke"
modal True
imagebutton auto "punch_%s":
focus_mask True
action SetVariable("attack", "punch"), Jump ("target")
label target:
call screen target_UItest
e "You are now using, [attack]. Who would you like to do that to?"
screen target_UItest():
add "smoke"
modal True
#first target option
imagebutton auto "henry_%s":
focus_mask True
action SetVariable("target", "Henry"), SetVariable ("action1", target+attack), Jump ("main_combatscreen")
#second target option
imagebutton auto "philip_%s":
focus_mask True
action SetVariable("target", "Philip"), SetVariable ("action1", target+attack,), Jump ("main_combatscreen")