- Joined
- Dec 11, 2010
- Messages
- 4
How to Use "Pick a Random Integer"
You may have seen this option in GUI before. Maybe that's why you viewed this tutorial. It appears in Math, and it is called Random Number.
With this function, you can have random events, numbers, or rewards(you can use something else for this) appearing in your map.
To use this function, you must have a variable, which can be created at the Variable Editor. The variable must be an INTEGER.
After completing the task, you may proceed to step 1.
Step 1
Create the desired event. For this tutorial, we will use Time - Periodic Event.
Step 2
Now set the variable. We will use E1 for the tutorial.
Step 3
Now, you must create actions corresponding to the picked integers.
Create a new ACTION, then choose If Then Else Multiple Functions.
The "Then" will be the action corresponding to 1.
We will use "Hello World" as the "Then" for 1.
For this tutorial, we will use Hello Azeroth!
Since we are done with the trigger, put Do Nothing on the last Else.
The finished trigger will look like this:
Go check out the map, to see if you really got it right.
---------------------------------------
Have fun with random integers!
You may have seen this option in GUI before. Maybe that's why you viewed this tutorial. It appears in Math, and it is called Random Number.
With this function, you can have random events, numbers, or rewards(you can use something else for this) appearing in your map.
To use this function, you must have a variable, which can be created at the Variable Editor. The variable must be an INTEGER.
After completing the task, you may proceed to step 1.
Step 1
Create the desired event. For this tutorial, we will use Time - Periodic Event.
-
Random Integer
-
Events
- Time - Every 2.00 seconds of game time
- Conditions
- Actions
-
Events
Step 2
Now set the variable. We will use E1 for the tutorial.
-
Random Integer
-
Events
- Time - Every 2.00 seconds of game time
- Conditions
-
Actions
- Set E1 = (Random integer number between 1 and 2)
-
Events
Step 3
Now, you must create actions corresponding to the picked integers.
Create a new ACTION, then choose If Then Else Multiple Functions.
The "Then" will be the action corresponding to 1.
We will use "Hello World" as the "Then" for 1.
-
Random Integer
-
Events
- Time - Every 2.00 seconds of game time
- Conditions
-
Actions
- Set E1 = (Random integer number between 1 and 2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- E1 Equal to 1
-
Then - Actions
- Game - Display to (All players) the text: Hello World!
- Else - Actions
-
If - Conditions
-
Events
For this tutorial, we will use Hello Azeroth!
Since we are done with the trigger, put Do Nothing on the last Else.
The finished trigger will look like this:
-
Random Integer
-
Events
- Time - Every 2.00 seconds of game time
- Conditions
-
Actions
- Set E1 = (Random integer number between 1 and 2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- E1 Equal to 1
-
Then - Actions
- Game - Display to (All players) the text: Hello World!
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- E1 Equal to 2
-
Then - Actions
- Game - Display to (All players) the text: Hello Azeroth!
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Events
Go check out the map, to see if you really got it right.
---------------------------------------
Have fun with random integers!