• 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.

[Solved] Trigger Question

Status
Not open for further replies.
Level 3
Joined
Aug 22, 2010
Messages
34
  • Spawn
    • Events
    • Conditions
    • Actions
      • -------- Spawn Units for Red --------
      • Game - Display to (Player group(Player 1 (Red))) for 10.00 seconds the text: LevelDescription[5]
      • -------- Change to 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
        • Then - Actions
          • Set TempPoint = (Center of Red Spawn 1 <gen>)
          • For each (Integer A) from 1 to 20, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Spawn_Unit_Type[5] for Player 10 (Light Blue) at TempPoint facing 0.00 degrees
              • -------- Change to 1 --------
              • -------- Spawn Effects --------
              • Set EnemiesAlive = (EnemiesAlive + 1)
              • Set TempPoint = (Position of (Last created unit))
              • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Fix Unit --------
              • Unit - Change color of (Last created unit) to Black
              • Unit - Add Invulnerable (Neutral) to (Last created unit)
              • Unit - Set the custom value of (Last created unit) to 1
              • Unit Group - Add (Last created unit) to LeakGroup[1]
              • -------- Special Tower Conditions --------
              • Trigger - Add to Ancient of Lore <gen> the event (Unit - (Last created unit) Takes damage)
              • Trigger - Add to Bash <gen> the event (Unit - (Last created unit) Takes damage)
              • Trigger - Add to Phase Disrupter <gen> the event (Unit - (Last created unit) Takes damage)
              • Trigger - Add to Fear <gen> the event (Unit - (Last created unit) Takes damage)
              • Trigger - Add to Death Knight <gen> the event (Unit - (Last created unit) Takes damage)
              • Trigger - Add to Multishot <gen> the event (Unit - (Last created unit) Takes damage)
              • Trigger - Add to Treant <gen> the event (Unit - (Last created unit) Takes damage)
              • Trigger - Add to Ancient of Wind Cyclone <gen> the event (Unit - (Last created unit) Takes damage)
              • -------- Spawn Location --------
              • Set TempPoint = (Center of Red Spawn 1 <gen>)
        • Else - Actions
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in (Units in Red Spawn <gen>) and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Center of Movement 1 <gen>)
          • Unit - Order (Picked unit) to Move To TempPoint
          • Custom script: call RemoveLocation( udg_TempPoint )
          • Unit - Set the custom value of (Picked unit) to 1
          • -------- Special Spawn Buffs --------
          • Set SpecialSpawnInt = (SpecialSpawnInt + 1)
          • -------- Level 2 Priest Inner Fire --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • SpecialSpawnInt Equal to 2
                  • Spawn_Unit_Type[5] Equal to (2) Priest
            • Then - Actions
              • Set SpecialSpawnInt = 0
              • Set TempPoint = (Center of Red Spawn <gen>)
              • Unit - Create 1 DUMMY CASTER OF SPECIALS for Player 1 (Red) at TempPoint facing Default building facing degrees
              • Unit - Add Inner Fire (Level 2 Priests) to (Last created unit)
              • Unit - Order (Last created unit) to Human Priest - Inner Fire (Picked unit)
              • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation( udg_TempPoint )
            • Else - Actions
It's supposed to cast Inner Fire on every other unit that it spawns.
Problem: It's not casting inner fire. If I remove
  • If - conditions
    • Spawn_Unit_Type[5] Equal to (2) Priest
it works as it should, but it works on every spawn level and I do not want that.
 
That condition doesn't make sense; you set Spawn_Unit_Type[5] to (2) Priest in the map initialization, obviously. It will always be equal to that value.
If you want to keep track of the level, increase an integer everytime the spawn type should change and use a condition If SpawnLevel < 2 then, make the dummies cast inner fire.
What is more, SpecialSpawnInt actually counts the units in that unit group, so it will work only when there are 2 units in that region.

Edit: dah ;D
 
Level 3
Joined
Aug 22, 2010
Messages
34
- where did you get the "Spawn_Unit_Type[5]"?...
It's set in another trigger. Earlier in this trigger it is referenced when spawning the units. Nothing changes between the two second wait.
- remove the wait...
Removing the wait does nothing.
- this >>> Unit - Add a 5.00 second... >>> put it after the dummy creation.
Changing this does nothing.
- do you know that this >>> Set SpecialSpawnInt = (SpecialSpawnInt + 1) will run on EVERY PICKED unit inside a group?...
Yes, that's the entire reason that it is inside of the pick every unit.

in red

Edit:
That condition doesn't make sense; you set Spawn_Unit_Type[5] to (2) Priest in the map initialization, obviously. It will always be equal to that value.
Nope. In my TD you pick what enemies spawn for your opponents. Spawn_Unit_Type[5] is defined 5 seconds before this trigger is run. It spawns the correct unit in the upper half of the trigger, but the condition stops it from working.

If you want to keep track of the level, increase an integer everytime the spawn type should change and use a condition If SpawnLevel < 2 then, make the dummies cast inner fire.
What is more, SpecialSpawnInt actually counts the units in that unit group, so it will work only when there are 2 units in that region.
There are always 20 units in the region when that part of the trigger runs. And I can't do it based on level because there are four possible spawn choices each level.

Edit: dah ;D

redd

Note: If I remove the condition, exactly half of the spawned units get Inner Fire'd. This is good, but it happens every level without the condition.
 
- where did you get the "Spawn_Unit_Type[5]"?...
>>> you mean this is constant?...

- remove the wait...
>>> I wrote this coz of efficiency, waits ruin most of triggering stuffs...

- this >>> Unit - Add a 5.00 second... >>> put it after the dummy creation...
>>> I wrote this in case you have an AI caster, the dummy wont cast if your trigger is like that...
see this for more info >>> http://www.hiveworkshop.com/forums/2002741-post22.html

- do you know that this >>> Set SpecialSpawnInt = (SpecialSpawnInt + 1) will run on EVERY PICKED unit inside a group?...
>>> just asking...

I think you should put the main trigger as well...
 
Status
Not open for further replies.
Top