my code bugg, its can use spell only once, the second time i cast spell the dummy dont move at all >.>,
here what i tried
here what i tried
-
DummyMove Hashtable
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to DummyMoveHashtable
-
-
Actions
-
-------- Just for configuration/readability --------
-
Set DummyMoveTrig = (Triggering unit)
-
Set KnockBackTarget = (Target unit of ability being cast)
-
Set DummyMovePoint[1] = (Position of DummyMoveTrig)
-
Set DummyMovePoint[2] = (Target point of ability being cast)
-
Set DummyMoveMaxDistance = 1500.00
-
Set DummyMoveCurDistance = 0.00
-
Set DummyMoveSpeed = 50.00
-
Set DummyMoveAngle = (Angle from DummyMovePoint[1] to DummyMovePoint[2])
-
Set DummyMoveAOE = 200.00
-
Set DummyMoveDmg = 200.00
-
-------- doing some action before storing all variable --------
-
Unit - Create 1 DummyUnit for (Triggering player) at DummyMovePoint[1] facing DummyMoveAngle degrees
-
-------- Finishing configuration --------
-
Set DummyMoveDummy = (Last created unit)
-
Unit - Turn collision for DummyMoveDummy Off
-
Set DummyMovePoint[3] = (Position of DummyMoveDummy)
-
-------- Store the values --------
-
Unit Group - Add DummyMoveDummy to DummyMoveGroupEnnemy
-
Hashtable - Save Handle OfDummyMoveTrig as (Key unit) of (Key (Last created unit)) in DummyMove
-
Unit Group - Add (Last created unit) to DummyMoveGroupUnits
-
Hashtable - Save Handle OfDummyMoveDummy as (Key target) of (Key (Last created unit)) in DummyMove
-
Hashtable - Save DummyMoveAOE as (Key aoe) of (Key (Last created unit)) in DummyMove
-
Hashtable - Save DummyMoveCurDistance as (Key curdistance) of (Key (Last created unit)) in DummyMove
-
Hashtable - Save DummyMoveMaxDistance as (Key maxdistance) of (Key (Last created unit)) in DummyMove
-
Hashtable - Save DummyMoveDmg as (Key damage) of (Key (Last created unit)) in DummyMove
-
Hashtable - Save DummyMoveSpeed as (Key speed) of (Key (Last created unit)) in DummyMove
-
Hashtable - Save DummyMoveAngle as (Key angle) of (Key (Last created unit)) in DummyMove
-
Custom script: call RemoveLocation(udg_DummyMovePoint[1])
-
Custom script: call RemoveLocation(udg_DummyMovePoint[2])
-
Custom script: call RemoveLocation(udg_DummyMovePoint[3])
-
If ((DummyMove Hashtable Loop <gen> is on) Equal to False) then do (Trigger - Turn on DummyMove Hashtable Loop <gen>) else do (-------- do nothing BUT DONT USE THE ACTION NEVER --------)
-
-
-
DummyMove Hashtable Loop
-
Events
-
Time - Every 0.04 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in DummyMoveGroupUnits) Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Unit Group - Pick every unit in DummyMoveGroupUnits and do (Actions)
-
Loop - Actions
-
-------- Load all necessary variables stored in the Hashtable --------
-
Set DummyMoveTrig = (Load (Key unit) of (Key (Picked unit)) in DummyMove)
-
Set DummyMoveDummy = (Load (Key target) of (Key (Picked unit)) in DummyMove)
-
Set DummyMoveDmg = (Load (Key damage) of (Key (Picked unit)) from DummyMove)
-
Set DummyMoveSpeed = (Load (Key speed) of (Key (Picked unit)) from DummyMove)
-
Set DummyMoveAOE = (Load (Key aoe) of (Key (Picked unit)) from DummyMove)
-
Set DummyMoveCurDistance = (Load (Key curdistance) of (Key (Picked unit)) from DummyMove)
-
Set DummyMoveMaxDistance = (Load (Key maxdistance) of (Key (Picked unit)) from DummyMove)
-
Set DummyMoveAngle = (Load (Key angle) of (Key (Picked unit)) from DummyMove)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DummyMoveCurDistance Less than DummyMoveMaxDistance
-
-
Then - Actions
-
-------- Move the unit and update time remaining --------
-
Set DummyMovePoint[4] = (Position of DummyMoveDummy)
-
Set DummyMovePoint[5] = (DummyMovePoint[4] offset by DummyMoveSpeed towards DummyMoveAngle degrees)
-
Unit - Move (Picked unit) instantly to DummyMovePoint[5], facing DummyMoveAngle degrees
-
Special Effect - Create a special effect at DummyMovePoint[5] using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set DummyMoveGroupEnnemyCheck = (Units within DummyMoveAOE of DummyMovePoint[4] matching ((((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of DummyMoveDummy)) Equal to False)) and (((Matching unit) is in DummyMoveGroupEnnemy) Equal to False)) a
-
Unit Group - Pick every unit in DummyMoveGroupEnnemyCheck and do (Actions)
-
Loop - Actions
-
Unit Group - Add (Picked unit) to DummyMoveGroupEnnemy
-
Unit - Cause DummyMoveTrig to damage (Picked unit), dealing DummyMoveDmg damage of attack type Spells and damage type Normal
-
-
-
Hashtable - Save (DummyMoveCurDistance + DummyMoveSpeed) as (Key curdistance) of (Key (Picked unit)) in DummyMove
-
Custom script: call RemoveLocation(udg_DummyMovePoint[4])
-
Custom script: call RemoveLocation(udg_DummyMovePoint[5])
-
Custom script: call DestroyGroup (udg_DummyMoveGroupEnnemyCheck)
-
-
Else - Actions
-
-------- spell is done, clean up --------
-
Unit - Remove DummyMoveDummy from the game
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in DummyMove
-
-
-
-
-
-
-
-
Last edited: