Hello, I'm trying to do a map where unit movement is handled by the "ai" but you can still cast abilities.
my first idea was to set movement speed to 1 so they are able to turn and use a charge spell(based on channel and hidden so only triggers could proc it) to move my units move around.
however I encountered a problem where making a unit slide, its doesn't path and tries to move forward regardless, see example:
is there a way to emulate sliding units to follow the same pathing logic as regular moving? if this is to complex, is there already a working slide system like this or is there a better way to disable manual movement for units while still retain the ability to use items/spells?
note: units doesn't need to be controllable while it moves, as this will only be occurring if a unit is outside of range of another unit.
my first idea was to set movement speed to 1 so they are able to turn and use a charge spell(based on channel and hidden so only triggers could proc it) to move my units move around.
however I encountered a problem where making a unit slide, its doesn't path and tries to move forward regardless, see example:

is there a way to emulate sliding units to follow the same pathing logic as regular moving? if this is to complex, is there already a working slide system like this or is there a better way to disable manual movement for units while still retain the ability to use items/spells?
-
presetup
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Hashtable - Create a hashtable
-
Set Move_Hashtable = (Last created hashtable)
-
-------- animation setup --------
-
Set Animation_Index_Max_Count = 1
-
Set Animation_Index_Unit_Type[1] = Footman
-
Set Animation_Index_number_walk[1] = 6
-
Set Animation_Index_number_attack[1] = 4
-
-
-
Cast Charge
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Charge
-
(Mana of (Triggering unit)) Greater than or equal to 4.00
-
-
Actions
-
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 4.00)
-
Set temp_location[0] = (Position of (Triggering unit))
-
Set temp_location[1] = (Position of (Target unit of ability being cast))
-
Set temp_group = (Units within 150.00 of temp_location[0] matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is invulnerable) Equal to False) and (((Match)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(temp_group is empty) Equal to False
-
-
Then - Actions
-
Set temp_unit = (Random unit from temp_group)
-
Hashtable - Save Handle Oftemp_unit as (Key target) of (Key (Triggering unit)) in Move_Hashtable
-
Unit - Order (Triggering unit) to Special - Channel
-
Unit - Make (Triggering unit) face temp_unit over 0.00 seconds
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between temp_location[0] and temp_location[1]) Less than or equal to 150.00
-
-
Then - Actions
-
Hashtable - Save Handle Of(Target unit of ability being cast) as (Key target) of (Key (Triggering unit)) in Move_Hashtable
-
Unit - Order (Triggering unit) to Special - Channel
-
-
Else - Actions
-
Unit Group - Add (Triggering unit) to Move_Group_runner
-
Hashtable - Save Handle Of(Target unit of ability being cast) as (Key target) of (Key (Triggering unit)) in Move_Hashtable
-
Set temp_unit = (Triggering unit)
-
Unit - Pause (Triggering unit)
-
For each (Integer A) from 1 to Animation_Index_Max_Count, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Triggering unit)) Equal to Animation_Index_Unit_Type[(Integer A)]
-
-
Then - Actions
-
Set temp_integer = Animation_Index_number_walk[(Integer A)]
-
-
Else - Actions
-
-
-
-
Custom script: call SetUnitAnimationByIndex(udg_temp_unit, udg_temp_integer)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(move <gen> is on) Equal to False
-
-
Then - Actions
-
Trigger - Turn on move <gen>
-
-
Else - Actions
-
-
-
-
-
-
Custom script: call RemoveLocation(udg_temp_location[0])
-
Custom script: call RemoveLocation(udg_temp_location[1])
-
Custom script: call DestroyGroup(udg_temp_group)
-
-
-
move
-
Events
-
Time - Every 0.02 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Move_Group_runner is empty) Equal to True
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Unit Group - Pick every unit in Move_Group_runner and do (Actions)
-
Loop - Actions
-
Set temp_unit = (Load (Key target) of (Key (Picked unit)) in Move_Hashtable)
-
Set temp_location[0] = (Position of (Picked unit))
-
Set temp_location[1] = (Position of temp_unit)
-
Set temp_location[2] = (temp_location[0] offset by 10.00 towards (Angle from temp_location[0] to temp_location[1]) degrees)
-
Unit - Move (Picked unit) instantly to temp_location[2], facing (Angle from temp_location[0] to temp_location[1]) degrees
-
Set temp_group = (Units within 150.00 of temp_location[2] matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Picked unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is alive) Equal to True
-
(temp_unit is alive) Equal to True
-
(temp_group is empty) Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between temp_location[0] and temp_location[1]) Less than or equal to 150.00
-
-
Then - Actions
-
Animation - Reset (Picked unit)'s animation
-
Unit Group - Remove (Picked unit) from Move_Group_runner
-
Unit - Unpause (Picked unit)
-
Unit - Order (Picked unit) to Special - Channel
-
-
Else - Actions
-
-
-
Else - Actions
-
Unit Group - Remove (Picked unit) from Move_Group_runner
-
Unit - Unpause (Picked unit)
-
Animation - Reset (Picked unit)'s animation
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Move_Hashtable
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(temp_group is empty) Equal to False
-
-
Then - Actions
-
Set temp_unit = (Random unit from temp_group)
-
Hashtable - Save Handle Oftemp_unit as (Key target) of (Key (Picked unit)) in Move_Hashtable
-
Unit - Order (Picked unit) to Special - Channel
-
Unit - Make (Picked unit) face temp_unit over 0.00 seconds
-
-
Else - Actions
-
-
-
-
Custom script: call DestroyGroup(udg_temp_group)
-
Custom script: call RemoveLocation(udg_temp_location[0])
-
Custom script: call RemoveLocation(udg_temp_location[1])
-
Custom script: call RemoveLocation(udg_temp_location[2])
-
-
-
-
-
-
-
damage
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to attack
-
-
Actions
-
Unit - Cause (Triggering unit) to damage (Load (Key target) of (Key (Triggering unit)) in Move_Hashtable), dealing 5.00 damage of attack type Spells and damage type Normal
-
Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Move_Hashtable
-
-
note: units doesn't need to be controllable while it moves, as this will only be occurring if a unit is outside of range of another unit.