Hello, first post on here.
I am trying to create a charge/dash ability which when cast moves the unit forward a distance based on its current movement speed.
I have been attempting to trigger it in GUI using hashtables, following these two guides:
Hashtables and MUI
A Complete Beginners Guide to Hashtables
Here are the triggers:
Hashtable creation on initialisation:
I have tried troubleshooting it by having other abilities trigger it, but still nothing happens, which leads me to guess I have made a mistake in the hashtables somewhere along the way.
I'd be grateful for any help you could offer a noob
Thanks
I am trying to create a charge/dash ability which when cast moves the unit forward a distance based on its current movement speed.
I have been attempting to trigger it in GUI using hashtables, following these two guides:
Hashtables and MUI
A Complete Beginners Guide to Hashtables
Here are the triggers:
Hashtable creation on initialisation:
-
Charge Init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set VariableSet CRUSADER_Charge_Hashtable = (Last created hashtable)
-
Hashtable - Create a hashtable
-
-
-
Charge cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Charge!
-
-
Actions
-
Set VariableSet CRUSADER_Charge_Distance = ((Current movement speed of (Triggering unit)) x 0.04)
-
Set VariableSet CRUSADER_Charge_Time_Remaining = 2.00
-
Hashtable - Save CRUSADER_Charge_Distance as 0 of (Key (Triggering unit).) in CRUSADER_Charge_Hashtable.
-
Hashtable - Save CRUSADER_Charge_Time_Remaining as 1 of (Key (Triggering unit).) in CRUSADER_Charge_Hashtable.
-
Unit Group - Add (Triggering unit) to CRUSADER_Charge_Group
-
-
-
Charge loop
-
Events
-
Time - Every 0.04 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in CRUSADER_Charge_Group and do (Actions)
-
Loop - Actions
-
Set VariableSet CRUSADER_Charge_Distance = (Load 0 of (Key (Picked unit).) from CRUSADER_Charge_Hashtable.)
-
Set VariableSet CRUSADER_Charge_Time_Remaining = (Load 1 of (Key (Picked unit).) from CRUSADER_Charge_Hashtable.)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CRUSADER_Charge_Time_Remaining Greater than 0.00
-
-
Then - Actions
-
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by (CRUSADER_Charge_Distance, 0.00))
-
Hashtable - Save (CRUSADER_Charge_Time_Remaining - 0.04) as 1 of (Key (Picked unit).) in CRUSADER_Charge_Hashtable.
-
-
Else - Actions
-
Hashtable - Clear all child hashtables of child (Key (Picked unit).) in CRUSADER_Charge_Hashtable.
-
Unit Group - Remove (Picked unit) from CRUSADER_Charge_Group.
-
-
-
-
-
-
I have tried troubleshooting it by having other abilities trigger it, but still nothing happens, which leads me to guess I have made a mistake in the hashtables somewhere along the way.
I'd be grateful for any help you could offer a noob
Thanks