I have made a map where you have to answer random equations. If you type in the right answer, you will be rewarded.
I have 3 global integer variables, their values are 0 from the beginning. The first two hold the factors/terms that are multiplicated/added/subtracted in the equation. The third one holds the value of the equation.
My variables and triggers:
I have tried to change the starting values of the variables and then value of the required number to be typed in would change.
Since several questions will be asked I can't do this:
I have 3 global integer variables, their values are 0 from the beginning. The first two hold the factors/terms that are multiplicated/added/subtracted in the equation. The third one holds the value of the equation.
My variables and triggers:
- Operations = 0 <Integer>
- Number 1 = 0 <Integer>
- Number 2 = 0 <Integer>
- Answer = 0 <Integer>
- Generator
- Answer
-
Generator
-
Events
- Game - Map initialization
- Local Variables
- Conditions
-
Actions
- Variable - Set Operations = (Random integer between 1 and 3)
- Variable - Set Number 1 = (Random integer between 5 and 10)
- Variable - Set Number 2 = (Random integer between 1 and 5)
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
- Operations == 1
-
Then
- UI - Display ((Text(Number 1)) + (" + " + (Text(Number 2)))) for (All players) to Subtitle area
- Variable - Set Answer = (Number 1 + Number 2)
- Trigger - Turn Answer On
-
Else
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
- Operations == 2
-
Then
- UI - Display ((Text(Number 1)) + (" - " + (Text(Number 2)))) for (All players) to Subtitle area
- Variable - Set Answer = (Number 1 - Number 2)
- Trigger - Turn Answer On
-
Else
- UI - Display ((Text(Number 1)) + (" · " + (Text(Number 2)))) for (All players) to Subtitle area
- Variable - Set Answer = (Number 1 * Number 2)
- Trigger - Turn Answer On
-
If
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
-
Events
-
Answer
-
Events
- Game - Player Any Player types a chat message containing (String(Answer)), matching Exactly
- Local Variables
- Conditions
-
Actions
- Player - Modify player (Triggering player) Minerals: Add 250
- Player - Modify player (Triggering player) Vespene: Add 125
-
Events
I have tried to change the starting values of the variables and then value of the required number to be typed in would change.
Since several questions will be asked I can't do this:
- Digit 1 = (Random integer between 1 and 5) <Integer>
- Digit 2 = (Random integer between 5 and 10) <Integer>
- Answer Addition = (Digit 1 + Digit 2) <Integer>
- Digit 3 = (Random integer between 5 and 10) <Integer>
- Digit 4 = (Random integer between 1 and 5) <Integer>
- Answer Subtraction = (Digit 3 - Digit 4) <Integer>
- Digit 5 = (Random integer between 1 and 5) <Integer>
- Digit 6 = (Random integer between 5 and 10) <Integer>
- Answer Multiplication = (Digit 5 * Digit 6) <Integer>