But what is the trick? Are you starting to wonder now? Have I got your attention? Well then let us continue.
Well, using gosub in such way requires special design results in the script, you need to tell the script to return false if the result is NOT true, or if IS true then you need to return it TRUE. (0485: return_true or 059A: return_false).
// result is true, continue...
If the gosub returned false, then so it jump to the label "__False" if it HAS returned true, then it continues where it says "result is true, continue..."
03A3: actor 0@ is_male
As you can see(?), it checks if the actor is a male, if he IS a male then it returns true, and this means the gosub IS true, if the actor is not a male, then it goes to the label "RetFalse" and returns false, BOTH codes end with a normal "return" command, this is of course so the script can go back to check if the gosub is TRUE or FALSE.
Sanny Builder supports storing a label name to a varible then jumping using that varible. For example:
0@ = @Label
Then you can jump like this:
1@ == 0
0@ = @Script2
Same trick apply's to gosubs, and jump_if_false
With just one condition there is no need at all for an if command, in-fact, it's better without it, as it's saving more space, if there IS more then one condition THEN if(AND/OR) is needed, but if you are only using one condition, then if can be omitted from the script, and you can leave it out.
0248: model #INFERNUS available
If you declare the player or actor to the game engine using var..end, we can now do this kind of stuff:
The game knows that $PLAYER_CHAR means the player, so now all is necessary is the varible, then what your doing, like for example above I'm checking if the player is defined.
($2 is equal to $PLAYER_CHAR, and $3 is equal to $PLAYER_ACTOR, so you can use these instead of). When you decompile $2 will = $PLAYER_CHAR, and $3 = $PLAYER_ACTOR.