So, I’m a complete newbie to programming, and I’m trying my hand at choicescript.
Today, I was faced with a situation: I wanted to make a variable check. Basically: we have two repeatable labels, one where you attack and another where the enemy attacks. There is a limited amount of enemies which you have to defeat, and when that happens, the loop between attack and defense ends and you go to another label.
I’m just having a doubt here. I did this:
Basically, I created a temporary variable called “battle”. If, when you return to the attack label, the enemies are all defeated, it can’t repeat. So, for that, there is this code up there: if, when you return to this label, the variable in regards to the knights, archers and mages is equal to zero, meaning all of them were defeated, you increase battle in +1. If battle reaches three, meaning all of them were reduced to zero, you skip the attack label and go to the next part of the scene.
However, I’m quite sure this actually makes it so that check is repeated every time the label starts? Basically, that means Battle would reach 3 before all variables reached zero, or even surpass three.
I don’t know if that’s right, but it is what my logic seems to account for. Can anyone help me with this? If this is indeed the case, can you suggest to me some way to still make that check, but not repeating it? I’ll appreciate your help!