Information on the IF, OTHERWISE, IF (Message Choice) and END IF commands

#1
First off, remember that every 'IF' command has to be ended by an 'END IF' command. An 'IF' command lets you make a condition that must be fulfilled in order to carry out the commands listed in between the 'IF' and its 'END IF'. In the following example, the message and the enemy will only be enacted if Counter00 (named 'PayerHasMoonlightSword' in this example) is set to '1'.:

IF ('Counter00-PayerHasMoonlightSword' =1)
‎  Display Message (Enemy says 'Nice sword. I'll take it off your dead corpse!'
‎  Activate Enemy ('Final Boss')
END IF
------------------------------------------


An 'OTHERWISE' command goes in between an 'IF' and its 'END IF'. The commands listed between the 'OTHERWISE' and 'END IF' will only be enacted if the condition on the 'IF' is NOT met. In the following example, the 'too bad' message will only display if Counter00 does NOT equal '1':

IF ('Counter00-PayerHasMoonlightSword' =1)
‎  Display Message (Enemy says 'Nice sword. I'll take it off your dead corpse!'
‎  Activate Enemy (activate 'Final Boss')
OTHERWISE
‎  Display Message (Enemy says 'Too bad you don't have a better weapon. I don't fight weaklings.'
END IF
-----------------------------------------


An 'IF (Message Choice)' is pretty much the same but it gives the player two on-screen choices. If the first response is chosen, the commands after ?IF (Message Choice)? will happen. If the player makes the second choice, the commands after OTHERWISE will be carried out instead.

IF (Message Choice):('Do you want to set sail?' Choice1='Yes' Choice2='No')
‎  ‎ Warp Player (to ship)
OTHERWISE
‎  ‎ Display Message ('Ok, let me know when you're ready to leave.') ‎ 
END IF
------------------------------------------


You can also embed an 'IF' command inside another 'IF'. In the following example, if the player answers 'yes', it will trigger the second 'IF' ‎  which will only let him sail if 'Counter01-PlayerStength' is greater than 50.

IF (Message Choice)-('Do you want to set sail?' Choice1='Yes' Choice2='No')
‎  ‎  ‎ IF ('Counter01-PlayerStength' > 50)
‎  ‎  ‎  ‎ Warp Player (to ship)
‎  ‎  OTHERWISE
‎  ‎  ‎  ‎ Display Message ('No, You're not strong enough yet. Come back later')
‎  ‎  ‎ END IF
OTHERWISE
‎  ‎ Display Message ('Ok, let me know when you're ready to leave.') ‎ 
END IF
-----------------------------

IF anyone finds this confusing or has more questions, feel free to post. OTHERWISE don't post. . . (ha ha ha! I slay me Tongue )
Reply



Messages In This Thread
Information on the IF, OTHERWISE, IF (Message Choice) and END IF commands - by HwitVlf - 2009-12-12, 10:15 AM



Users browsing this thread:
3 Guest(s)