- Joined
- Apr 21, 2013
- Messages
- 1,194
I've got a little system where the program lets the player do some parkour moves when we are close to certain "units". I've tried an implementation of this but I think it can be improved. Anyways, naturally I have some problems again, here are my triggers, why does this trigger work as one shot? Am I missing something?
The problem is, when I first run into the obstacle the loop works just fine but it won't work after the first time.
Notes:
-isParkour boolean is to know if we are doing a parkour move in order not to mess up things
-isWalking boolean is to know if our character is running or walking. If he is walking he can't do parkour.
-The movespeed settings are for the movement system which are no problem for us in the loop or init.
Notes:
-The bottom if statement is working too, it is to get our character back to running or walking depending on his previous state.
Another question I can ask will be this; is there a way to get unit types to execute the parkour movements instead of making events for each of the units?
The problem is, when I first run into the obstacle the loop works just fine but it won't work after the first time.
Notes:
-isParkour boolean is to know if we are doing a parkour move in order not to mess up things
-isWalking boolean is to know if our character is running or walking. If he is walking he can't do parkour.
-The movespeed settings are for the movement system which are no problem for us in the loop or init.
-
Speed Vault
-
Events
- Unit - A unit comes within 150.00 of Wooden Fence Unit 0021 <gen>
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Triggering unit) Equal to Achilles
- isParkour Equal to False
-
Conditions
-
And - All (Conditions) are true
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- IsWalking Equal to False
-
Then - Actions
- Set isParkour = True
- Set moveSpeed = 0.00
- Animation - Reset Achilles's animation
- Custom script: call SetUnitAnimationByIndex(udg_Achilles, 142)
- Trigger - Turn on Speed Vault Loop <gen>
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
Notes:
-The bottom if statement is working too, it is to get our character back to running or walking depending on his previous state.
-
Speed Vault Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
- Set parkLoc1 = (Position of Achilles)
- Set parkLoc2 = (parkLoc1 offset by (322.00 x 0.03) towards (Facing of Achilles) degrees)
- Unit - Move Achilles instantly to parkLoc2
- Custom script: call RemoveLocation(udg_parkLoc1)
- Custom script: call RemoveLocation(udg_parkLoc2)
- Set speedVaultDist = (speedVaultDist + 3.00)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- speedVaultDist Greater than or equal to 150.00
-
Then - Actions
- Trigger - Turn off (This trigger)
- Set isParkour = False
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- IsWalking Equal to True
-
Then - Actions
- Set moveSpeed = 150.00
- Custom script: call SetUnitAnimationByIndex(udg_Achilles, 1)
-
Else - Actions
- Set moveSpeed = 322.00
- Custom script: call SetUnitAnimationByIndex(udg_Achilles, 128)
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Events
Another question I can ask will be this; is there a way to get unit types to execute the parkour movements instead of making events for each of the units?