Difference between revisions of "A beginner's guide, lesson 6 - Quest Dialogue"
Jump to navigation
Jump to search
m
A beginner's guide, lesson 6 - Quest Dialogue (edit)
Revision as of 05:34, 28 July 2010
, 05:34, 28 July 2010→If-EndIf Blocks: editing wiki format stuff
imported>Pyrocow2 (→Three Problems: editing English) |
imported>Pyrocow2 m (→If-EndIf Blocks: editing wiki format stuff) |
||
Line 642: | Line 642: | ||
Change the Begin block to look like this. | Change the Begin block to look like this. | ||
Begin GameMode | |||
If (DoOnce1 == 0) | |||
AddTopic BGMMessage4U | |||
Set DoOnce1 to 1 | |||
EndIf | |||
End | |||
This is perfectly fine but it can get a little hard to read, when these if statements get long and complex. So again we use an optional convention. We indent using the tab key all lines after an IF statement, to make clear what is going on. | |||
<pre> | |||
Begin GameMode | |||
If (DoOnce1 == 0) | If (DoOnce1 == 0) | ||
AddTopic BGMMessage4U | |||
Set DoOnce1 to 1 | |||
EndIf | EndIf | ||
End | |||
</pre> | |||
So this script uses another new command called SET-TO. | |||
this script uses another new command called SET-TO. | |||
Whenever you declare variables they are automatically assigned a value of Zero. | Whenever you declare variables they are automatically assigned a value of Zero. | ||
Line 669: | Line 679: | ||
IF statements and Set statements both use standard mathematical comparisons | IF statements and Set statements both use standard mathematical comparisons | ||
Comparison Operators | ===Comparison Operators=== | ||
An IF statement may contain one or more comparison operators. | An IF statement may contain one or more comparison operators. | ||
Below is a table of valid comparison operators: | Below is a table of valid comparison operators: | ||
Line 681: | Line 691: | ||
<= Less than or equal to | <= Less than or equal to | ||
Combining Comparisons | ===Combining Comparisons=== | ||
Comparisons can be linked together using the following logical operators: | Comparisons can be linked together using the following logical operators: |