• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger Helps!

Status
Not open for further replies.
Level 9
Joined
Feb 15, 2013
Messages
372
Guys i have problem with this trigger, My map Ancient's Keep have a circle of power's spell which is when the circle of power cast the ability, the hero that owned by the player will teleport to base over 5 seconds.

But if multiple player cast, it will bug...
[trigger=Teleport]
Teleport
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Teleport
Actions
Set TeleportCount = (TeleportCount + 1)
Set TeleportCaster[TeleportCount] = (Triggering unit)
Set TeleportRealCount[TeleportCount] = 4
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of TeleportCaster[TeleportCount])) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A Hero) Equal to True
Then - Actions
Set TeleportCasterUnit[TeleportCount] = (Picked unit)
Unit - Pause TeleportCasterUnit[TeleportCount]
Else - Actions
Special Effect - Create a special effect attached to the origin of TeleportCaster[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[1] = (Last created special effect)
Special Effect - Create a special effect attached to the origin of TeleportCasterUnit[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[2] = (Last created special effect)
Trigger - Turn on Teleport Count <gen>
[/trigger]
[trigger=Teleport Count]
Teleport Count
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer TeleportCounts) from 1 to TeleportCount, do (Actions)
Loop - Actions
Wait 0.75 seconds
Set TeleportRealCounts[TeleportCounts] = (TeleportRealCounts[TeleportCounts] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TeleportRealCounts[TeleportCounts] Equal to TeleportRealCount[TeleportCounts]
Then - Actions
Set TeleportRealCounts[TeleportCounts] = 0
Set TeleportCount = (TeleportCount - 1)
Special Effect - Destroy TeleportEffect[1]
Special Effect - Destroy TeleportEffect[2]
Unit - Move TeleportCasterUnit[TeleportCounts] instantly to (Position of TeleportCaster[TeleportCounts])
Unit - Unpause TeleportCasterUnit[TeleportCounts]
Else - Actions
[/trigger]

+REP thanks
 
Level 9
Joined
Feb 15, 2013
Messages
372
okay

EDIT:
I have changed abit, but still not work
I have 2 hero in a map with Test Mode and i use the ability from Circle of Power, it will only teleport 1st hero but not 2nd, 2nd is paused
[trigger=Teleport]
Teleport
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Teleport
Actions
Set TeleportCount = (TeleportCount + 1)
Set TeleportCaster[TeleportCount] = (Triggering unit)
Set TeleportRealCount[TeleportCount] = 5
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of TeleportCaster[TeleportCount])) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A Hero) Equal to True
Then - Actions
Set TeleportCasterUnit[TeleportCount] = (Picked unit)
Unit - Pause TeleportCasterUnit[TeleportCount]
Else - Actions
Special Effect - Create a special effect attached to the origin of TeleportCaster[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[1] = (Last created special effect)
Special Effect - Create a special effect attached to the origin of TeleportCasterUnit[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[2] = (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TeleportCount Equal to 1
Then - Actions
Trigger - Turn on Teleport Count <gen>
Else - Actions
[/trigger]
[trigger=Teleport Count]
Teleport Count
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer TeleportCounts) from 1 to TeleportCount, do (Actions)
Loop - Actions
Set TeleportRealCount[TeleportCounts] = (TeleportRealCount[TeleportCount] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TeleportRealCounts[TeleportCounts] Less than or equal to 0
Then - Actions
Special Effect - Destroy TeleportEffect[2]
Special Effect - Destroy TeleportEffect[1]
Unit - Unpause TeleportCasterUnit[TeleportCounts]
Unit - Move TeleportCasterUnit[TeleportCounts] instantly to (Position of TeleportCaster[TeleportCounts])
Set TeleportRealCounts[TeleportCounts] = TeleportRealCounts[TeleportCount]
Set TeleportCaster[TeleportCounts] = TeleportCaster[TeleportCount]
Set TeleportCaster[TeleportCount] = No unit
Set TeleportCasterUnit[TeleportCounts] = TeleportCasterUnit[TeleportCount]
Set TeleportCasterUnit[TeleportCount] = No unit
Set TeleportCount = (TeleportCount - 1)
Set TeleportCounts = (TeleportCounts - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TeleportCount Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
[/trigger]
 
In your second trigger never use 1.00 as a spell delay. Use 0.03 when using GUI.

Your effects are not MUI. You need to index / de-index them.
Your second trigger also leaks a location and your first trigger leaks a unit group.

If you are trying to teleport all units in the area with your hero that casts the spell then you will need a different method of teleporting.

Instead of picking units in group around the caster at the beginning of the spell only move those units in the second trigger when the TeleportRealCounts[] becomes 0. This will allow all units to teleport around the caster at that time.

In your ITE in the first trigger you also need to check and see if picked unit = the unit casting the spell so that the picked unit is not picked twice.

If you explain exactly how you want this spell to work I can help you to better get what you want out of it.
 
Status
Not open for further replies.
Top