- Joined
- Dec 25, 2014
- Messages
- 109
So, i've been making a spell that to call a group of horsemen to move forward and damaging units. The problem with this is that when i cast another one while the previous is still ongoing, the units i created wont do anything, instead the one i cast before still ongoing and somehow going longer than intended. But if i do it one by one it works. I need help what to fix, thanks.
Here is the triggers
Here is the triggers
-
To Arms Initialize
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- This trigger is mean to create and initialize any data needed --------
-
Set ToArms_DummyUnit = Knight (Dummy)
-
Set ToArms_DummyAbility = Fuzzy (Dummy)
-
-------- ---- --------
-
Set ToArms_CollisionSize[1] = 150.00
-
Set ToArms_CollisionSize[2] = 150.00
-
Set ToArms_CollisionSize[3] = 150.00
-
Set ToArms_CollisionSize[4] = 150.00
-
-------- ---- --------
-
Set ToArms_Damage[1] = 70.00
-
Set ToArms_Damage[2] = 90.00
-
Set ToArms_Damage[3] = 110.00
-
Set ToArms_Damage[4] = 130.00
-
-------- ---- --------
-
Set ToArms_Distance[1] = 600.00
-
Set ToArms_Distance[2] = 800.00
-
Set ToArms_Distance[3] = 1000.00
-
Set ToArms_Distance[4] = 1200.00
-
-------- ---- --------
-
Set ToArms_Knights[1] = 3
-
Set ToArms_Knights[2] = 4
-
Set ToArms_Knights[3] = 5
-
Set ToArms_Knights[4] = 6
-
-------- ---- --------
-
-------- ---- --------
-
Set ToArms_Offset[1] = 200.00
-
Set ToArms_Offset[2] = 200.00
-
Set ToArms_Offset[3] = 200.00
-
Set ToArms_Offset[4] = 200.00
-
-------- ---- --------
-
Set ToArms_Speed[1] = 325.00
-
Set ToArms_Speed[2] = 325.00
-
Set ToArms_Speed[3] = 325.00
-
Set ToArms_Speed[4] = 325.00
-
-------- ---- --------
-
Set ToArms_AttackType = Chaos
-
Set ToArms_DamageType = Normal
-
-------- ---- --------
-
Set ToArms_SFX = Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
-
-------- ---- --------
-
-
-
To Arms Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to To Arms! (Cairne)
-
((Triggering unit) is A Hero) Equal to True
-
-
Actions
-
Set ToArms_Ability = (Ability being cast)
-
-------- ---- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ToArms_IndexSize Equal to 0
-
-
Then - Actions
-
Game - Display to (All players) the text: Trigger turned on
-
Trigger - Turn on To Arms Loop <gen>
-
-
Else - Actions
-
-
Set ToArms_IndexSize = (ToArms_IndexSize + 1)
-
-------- ---- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ToArms_IndexSize Greater than ToArms_IndexMax
-
-
Then - Actions
-
Set ToArms_Index[ToArms_IndexSize] = ToArms_IndexSize
-
Set ToArms_IndexMax = ToArms_IndexSize
-
-
Else - Actions
-
-
-------- ---- --------
-
Set ToArms_Int = ToArms_Index[ToArms_IndexSize]
-
-------- ---- --------
-
Set ToArms_Unit[ToArms_Int] = (Triggering unit)
-
-------- ---- --------
-
Unit Group - Add ToArms_Unit[ToArms_Int] to ToArms_TempUnitGroup
-
-------- ---- --------
-
Set ToArms_Owner[ToArms_Int] = (Owner of ToArms_Unit[ToArms_Int])
-
-------- ---- --------
-
Set ToArms_AbilityLevel[ToArms_Int] = (Level of ToArms_Ability for ToArms_Unit[ToArms_Int])
-
-------- ---- --------
-
Set ToArms_FinalDistance[ToArms_AbilityLevel[ToArms_Int]] = (ToArms_Distance[ToArms_AbilityLevel[ToArms_Int]] x (Real(ToArms_Knights[ToArms_AbilityLevel[ToArms_Int]])))
-
-------- ---- --------
-
Set ToArms_Angle[ToArms_Int] = (Facing of ToArms_Unit[ToArms_Int])
-
-------- ---- --------
-
Set ToArms_UnitPoint = (Position of ToArms_Unit[ToArms_Int])
-
-------- ---- --------
-
Set ToArms_Point = (ToArms_UnitPoint offset by 0.00 towards ToArms_Angle[ToArms_Int] degrees)
-
-------- ---- --------
-
For each (Integer A) from 1 to ToArms_Knights[ToArms_AbilityLevel[ToArms_Int]], do (Actions)
-
Loop - Actions
-
Set ToArms_Real = (ToArms_Real + (360.00 / (Real(ToArms_Knights[ToArms_AbilityLevel[ToArms_Int]]))))
-
-------- ---- --------
-
Set ToArms_Formation = (ToArms_Point offset by ToArms_Offset[ToArms_AbilityLevel[ToArms_Int]] towards ToArms_Real degrees)
-
-------- ---- --------
-
Unit - Create 1 ToArms_DummyUnit for ToArms_Owner[ToArms_Int] at ToArms_Formation facing ToArms_Angle[ToArms_Int] degrees
-
Unit - Turn collision for (Last created unit) Off
-
Unit Group - Add (Last created unit) to ToArms_TempDummyGroup[ToArms_Int]
-
-------- ---- --------
-
Custom script: call RemoveLocation(udg_ToArms_Formation)
-
-
-
-------- ---- --------
-
-------- ---- --------
-
Custom script: call RemoveLocation(udg_ToArms_UnitPoint)
-
Custom script: call RemoveLocation(udg_ToArms_Point)
-
-
-
To1 Arms Condtions
-
Events
-
Conditions
-
((Matching unit) is A structure) Equal to False
-
((Matching unit) is Ethereal) Equal to False
-
((Matching unit) is an illusion) Equal to False
-
((Matching unit) is alive) Equal to True
-
((Matching unit) is in ToArms_TempTargetGroup[ToArms_DummyIndex]) Equal to False
-
((Matching unit) belongs to an enemy of ToArms_Owner[ToArms_Int]) Equal to True
-
-
Actions
-
-------- Configure your conditions above --------
-
-
-
To Arms Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer ToArms_Loop) from 1 to ToArms_IndexSize, do (Actions)
-
Loop - Actions
-
-------- ---- --------
-
Set ToArms_Int = ToArms_Index[ToArms_Loop]
-
-------- ---- --------
-
Unit Group - Pick every unit in ToArms_TempUnitGroup and do (Actions)
-
Loop - Actions
-
Set ToArms_TempUnit[ToArms_Int] = (Picked unit)
-
-------- ---- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ToArms_FinalDistance[ToArms_AbilityLevel[ToArms_Int]] Greater than 0.00
-
-
Then - Actions
-
Unit Group - Pick every unit in ToArms_TempDummyGroup[ToArms_Int] and do (Actions)
-
Loop - Actions
-
-------- ---- --------
-
Set ToArms_TempDummy[ToArms_Int] = (Picked unit)
-
-------- ---- --------
-
Set ToArms_DummyIndex = (Custom value of ToArms_TempDummy[ToArms_Int])
-
-------- ---- --------
-
Set ToArms_DummyLoc[ToArms_Int] = (Position of ToArms_TempDummy[ToArms_Int])
-
-------- ---- --------
-
Set ToArms_TargetGroup[ToArms_DummyIndex] = (Units within ToArms_CollisionSize[ToArms_AbilityLevel[ToArms_Int]] of ToArms_DummyLoc[ToArms_Int] matching ((Evaluate To Arms Condtions <gen> conditions) Equal to True))
-
-------- ---- --------
-
Unit Group - Pick every unit in ToArms_TargetGroup[ToArms_DummyIndex] and do (Actions)
-
Loop - Actions
-
-------- ---- --------
-
Set ToArms_TempTarget[ToArms_DummyIndex] = (Picked unit)
-
-------- ---- --------
-
Unit Group - Add ToArms_TempTarget[ToArms_DummyIndex] to ToArms_TempTargetGroup[ToArms_DummyIndex]
-
-------- ---- --------
-
Special Effect - Create a special effect attached to the chest of ToArms_TempTarget[ToArms_DummyIndex] using Abilities\Spells\Other\Stampede\MissileDeath.mdl
-
Special Effect - Destroy (Last created special effect)
-
-------- ---- --------
-
Unit - Create 1 Dummy for ToArms_Owner[ToArms_Int] at ToArms_DummyLoc[ToArms_Int] facing Default building facing degrees
-
Unit - Add ToArms_DummyAbility to (Last created unit)
-
Unit - Set level of ToArms_DummyAbility for (Last created unit) to ToArms_AbilityLevel[ToArms_Int]
-
Unit - Order (Last created unit) to Human Sorceress - Slow ToArms_TempTarget[ToArms_DummyIndex]
-
Unit - Cause ToArms_TempUnit[ToArms_Int] to damage ToArms_TempTarget[ToArms_DummyIndex], dealing ToArms_Damage[ToArms_AbilityLevel[ToArms_Int]] damage of attack type ToArms_AttackType and damage type ToArms_DamageType
-
-------- ---- --------
-
-
-
Custom script: call DestroyGroup(udg_ToArms_TargetGroup[udg_ToArms_DummyIndex])
-
-------- ---- --------
-
Set ToArms_MovetoLoc[ToArms_Int] = (ToArms_DummyLoc[ToArms_Int] offset by (ToArms_Speed[ToArms_AbilityLevel[ToArms_Int]] / 33.00) towards ToArms_Angle[ToArms_Int] degrees)
-
-------- ---- --------
-
Unit - Move ToArms_TempDummy[ToArms_Int] instantly to ToArms_MovetoLoc[ToArms_Int]
-
-------- ---- --------
-
Special Effect - Create a special effect at ToArms_MovetoLoc[ToArms_Int] using ToArms_SFX
-
Special Effect - Set Scale of (Last created special effect) to 0.15
-
Special Effect - Destroy (Last created special effect)
-
-------- ---- --------
-
Custom script: call RemoveLocation(udg_ToArms_MovetoLoc[udg_ToArms_Int])
-
Custom script: call RemoveLocation(udg_ToArms_DummyLoc[udg_ToArms_Int])
-
-
-
Set ToArms_FinalDistance[ToArms_AbilityLevel[ToArms_Int]] = (ToArms_FinalDistance[ToArms_AbilityLevel[ToArms_Int]] - (ToArms_Speed[ToArms_AbilityLevel[ToArms_Int]] / 33.00))
-
-
Else - Actions
-
-------- ---- --------
-
Unit Group - Pick every unit in ToArms_TempTargetGroup[ToArms_DummyIndex] and do (Actions)
-
Loop - Actions
-
-------- ---- --------
-
Set ToArms_TempTarget[ToArms_DummyIndex] = (Picked unit)
-
-------- ---- --------
-
Unit Group - Remove ToArms_TempTarget[ToArms_DummyIndex] from ToArms_TempTargetGroup[ToArms_DummyIndex]
-
-
-
-------- ---- --------
-
Unit Group - Pick every unit in ToArms_TempDummyGroup[ToArms_Int] and do (Actions)
-
Loop - Actions
-
-------- ---- --------
-
Set ToArms_TempDummy[ToArms_Int] = (Picked unit)
-
-------- ---- --------
-
Unit Group - Remove ToArms_TempDummy[ToArms_Int] from ToArms_TempDummyGroup[ToArms_Int]
-
-------- ---- --------
-
Unit - Remove ToArms_TempDummy[ToArms_Int] from the game
-
-
-
-------- ---- --------
-
Set ToArms_Index[ToArms_Loop] = ToArms_Index[ToArms_IndexSize]
-
Set ToArms_Index[ToArms_IndexSize] = ToArms_Int
-
Set ToArms_IndexSize = (ToArms_IndexSize - 1)
-
Set ToArms_Loop = (ToArms_Loop - 1)
-
-------- ---- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ToArms_IndexSize Equal to 0
-
-
Then - Actions
-
-------- ---- --------
-
Unit Group - Remove ToArms_TempUnit[ToArms_Int] from ToArms_TempUnitGroup
-
-------- ---- --------
-
Game - Display to (All players) the text: Trigger turned off
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-
-
-
-
-