Deleted member 177737
D
Deleted member 177737
Hey, I'm creating an ability that when cast on a point will create a dummy unit, then all units not friendly to player 1 will have their location and facing saved then ordered to move towards the dummy unit. After that a countdown timer is started.
After that I have two triggers;
The first sends the units back after the countdown from the main trigger finished and then starts another countdown timer.
The second orders the units to face their original facing.
When I go in-game and cast the spell on a point near an enemy nothing happens.
As far as I can think there is some problem with the unit group in the first trigger. (Yes, I know that this has many leaks. I'll clean it up when I get it working)
+rep
After that I have two triggers;
The first sends the units back after the countdown from the main trigger finished and then starts another countdown timer.
The second orders the units to face their original facing.
When I go in-game and cast the spell on a point near an enemy nothing happens.
-
Throw Rock
-
Events
- Unit - A unit Finishes casting an ability
-
Conditions
- (Ability being cast) Equal to Throw Rock
-
Actions
- Set Temporary_Points[1] = (Target point of ability being cast)
- Unit - Create 1 Dummy (Throw Rock) for Neutral Passive at Temporary_Points[1] facing Default building facing degrees
- Set Temporary_Units[1] = (Last created unit)
-
Unit Group - Pick every unit in (Units within 400.00 of Temporary_Points[1] matching (((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
-
Loop - Actions
- -------- Increases the temp interger. --------
- Set Temporary_Interger = (Temporary_Interger + 1)
- -------- Saves the picked unit. --------
- Set Temporary_Units2[Temporary_Interger] = (Picked unit)
- -------- Saves the picked unit's original position. --------
- Set Temporary_Points2[Temporary_Interger] = (Position of Temporary_Units[Temporary_Interger])
- -------- Saves the facing of the unit. --------
- Set Temporary_UnitFacing[Temporary_Interger] = (Facing of Temporary_Units[Temporary_Interger])
- -------- Tells the picked unit to move towards the point that the spell was cast to. --------
- Unit - Order Temporary_Units2[Temporary_Interger] to Move To Temporary_Points[1]
-
Loop - Actions
- Countdown Timer - Start Timer_ThrowRockAbility[1] as a One-shot timer that will expire in 35.00 seconds
- Unit - Remove Temporary_Units[1] from the game
- Set Temporary_Interger2 = Temporary_Interger
-
Events
-
Throw Rock Unit Reset
-
Events
- Time - Timer_ThrowRockAbility[1] expires
- Conditions
-
Actions
-
Unit Group - Pick every unit in Temporary_UnitGroup[1] and do (Actions)
-
Loop - Actions
- Unit - Order Temporary_Units2[Temporary_Interger] to Move To Temporary_Points[Temporary_Interger]
- Set Temporary_Interger = (Temporary_Interger - 1)
-
Loop - Actions
- Countdown Timer - Start Timer_ThrowRockAbility[2] as a One-shot timer that will expire in 15.00 seconds
-
Unit Group - Pick every unit in Temporary_UnitGroup[1] and do (Actions)
-
Events
-
Throw Rock Unit Facing Reset
-
Events
- Time - Timer_ThrowRockAbility[2] expires
- Conditions
-
Actions
-
Unit Group - Pick every unit in Temporary_UnitGroup[1] and do (Actions)
-
Loop - Actions
- Unit - Make Temporary_Units2[Temporary_Interger2] face Temporary_Points2[Temporary_Interger2] over 0.00 seconds
- Set Temporary_Interger2 = (Temporary_Interger2 - 1)
-
Loop - Actions
-
Unit Group - Pick every unit in Temporary_UnitGroup[1] and do (Actions)
-
Events
As far as I can think there is some problem with the unit group in the first trigger. (Yes, I know that this has many leaks. I'll clean it up when I get it working)
+rep