- Joined
- Feb 28, 2013
- Messages
- 1,897
Hello there, it's me again, i would like to ask how do i (properly) detect if the unit (var Global_MainHero [Single Character / Specific]) is moving or not. This is how i made it, unfortunately i can't turn off the loop. The goal is to decrease the dehydration level (var Thirst_Thirstval) when the unit is walking, and when the unit is in idle the dehydration level should stay to current level / should not decrease.
EDIT: It does turn off (when you ordered the unit to stop), but when you ordered him to move from point A to point B, when he reach the point B and stopped by itself, the loop does not stop.
EDIT: It does turn off (when you ordered the unit to stop), but when you ordered him to move from point A to point B, when he reach the point B and stopped by itself, the loop does not stop.
-
Thirst Enable Loop When Ordered
-
Events
- Unit - A unit Is issued an order targeting a point
- Unit - A unit Is issued an order targeting an object
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Owner of (Ordered unit)) Equal to Player 1 (Red)
- (Unit-type of (Ordered unit)) Equal to (Unit-type of Global_MainHero)
-
Or - Any (Conditions) are true
-
Conditions
- (Issued order) Equal to (Order(move))
- (Issued order) Equal to (Order(harvest))
- (Issued order) Equal to (Order(smart))
- (Issued order) Equal to (Order(attack))
- (Issued order) Equal to (Order(patrol))
-
Conditions
-
Conditions
-
And - All (Conditions) are true
-
Actions
- Trigger - Turn on Thirst Loop <gen>
-
Events
-
Thirst Disable Loop When Idle
-
Events
- Unit - A unit Is issued an order with no target
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Owner of (Ordered unit)) Equal to Player 1 (Red)
- (Unit-type of (Ordered unit)) Equal to (Unit-type of Global_MainHero)
-
Or - Any (Conditions) are true
-
Conditions
- (Issued order) Equal to (Order(stop))
- (Issued order) Equal to (Order(holdposition))
-
Conditions
-
Conditions
-
And - All (Conditions) are true
-
Actions
- Trigger - Turn off Thirst Loop <gen>
-
Events
-
Thirst Loop
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Thirst_ThirstVal Greater than or equal to 0
-
Then - Actions
- Set Thirst_ThirstVal = (Thirst_ThirstVal - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- Thirst_ThirstVal Equal to 25
-
Conditions
-
And - All (Conditions) are true
-
Then - Actions
- Game - Display to Player Group - Player 1 (Red) the text: Your character is t...
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Thirst_ThirstVal Equal to 10
-
Then - Actions
- Game - Display to Player Group - Player 1 (Red) the text: Your character is s...
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Thirst_ThirstVal Equal to 0
-
Then - Actions
- Game - Display to Player Group - Player 1 (Red) the text: Your character is n...
- Unit - Create 1 Undead Death for Neutral Hostile at (Random point in EvilSpawnRegion1 <gen>) facing (Random angle) degrees
- Set Thirst_DeathFollow = (Last created unit)
- Trigger - Turn on Thirst Hunt Character <gen>
- Trigger - Turn on Thirst Character Death <gen>
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Thirst Setup
-
Events
- Time - Elapsed game time is 0.00 seconds
- Conditions
-
Actions
- Set Thirst_ThirstVal = 50
-
Events