• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] 2 bugged triggers

Status
Not open for further replies.
Level 11
Joined
Feb 14, 2009
Messages
884
Hello fellow HiverZ!

I have these 2 triggers on my map:


  • Provoked
    • Events
      • Unit - Wanderer of the Glacier 0014 <gen> Takes damage
      • Unit - Wanderer of the Glacier 0014 <gen> Acquires a target
    • Conditions
      • KriomplastrosEntered Equal to False
    • Actions
      • Set KriomplastrosBlock = (Center of KriomplastrosBlock <gen>)
      • Set KriomplastrosEntered = True
      • Set KriomplastrosSpawn1 = (Center of KriomplastrosSpawn1 <gen>)
      • Set KriomplastrosSpawn2 = (Center of KriomplastrosSpawn2 <gen>)
      • Set KriomplastrosSpawn3 = (Center of KriomplastrosSpawn3 <gen>)
      • Set KriomplastrosSpawn4 = (Center of KriomplastrosSpawn4 <gen>)
      • Set KriomplastrosPriest1 = (Center of KriomplastrosPriest1 <gen>)
      • Set KriomplastrosPriest2 = (Center of KriomplastrosPriest2 <gen>)
      • Destructible - Pick every destructible in KriomplastrosBlock <gen> and do (Actions)
        • Loop - Actions
          • Destructible - Resurrect (Picked destructible) with (Max life of (Last created destructible)) life and Show birth animation
          • Destructible - Make (Picked destructible) Invulnerable
      • Unit - Create 1 Fallen Priest (Mana) for Neutral Hostile at KriomplastrosPriest1 facing 300.00 degrees
      • Unit - Create 1 Fallen Priest (Life) for Neutral Hostile at KriomplastrosPriest2 facing 0.00 degrees
      • Unit - Create 1 Reanimated Archer for Neutral Hostile at KriomplastrosSpawn1 facing 10.00 degrees
      • Unit - Create 1 Reanimated Archer for Neutral Hostile at KriomplastrosSpawn2 facing 350.00 degrees
      • Unit - Create 1 Reanimated Archer for Neutral Hostile at KriomplastrosSpawn3 facing 0.00 degrees
      • Unit - Create 1 Reanimated Archer for Neutral Hostile at KriomplastrosSpawn4 facing 0.00 degrees
      • Special Effect - Create a special effect at KriomplastrosPriest1 using Abilities\Spells\Undead\Darksummoning\DarkSummonTarget.mdl
      • Set KriomplastrosPriestSE1 = (Last created special effect)
      • Special Effect - Create a special effect at KriomplastrosPriest2 using Abilities\Spells\Undead\Darksummoning\DarkSummonTarget.mdl
      • Set KriomplastrosPriestSE2 = (Last created special effect)
      • Game - Display to (All players) the text: |cff306EFFKriomplas...
      • Environment - Remove (Last created weather effect)
      • Environment - Create at Snow <gen> the weather effect Northrend Blizzard
      • Environment - Turn (Last created weather effect) On
      • Environment - Set fog to style Linear, z-start 1000.00, z-end 8000.00, density 10.00 and color (60.00%, 60.00%, 100.00%)
      • Game - Set the time of day to 0.00
      • Game - Set time of day speed to 0.00% of the default speed
      • Player Group - Pick every player in (All players) and do (Camera - Shake the camera for (Picked player) with magnitude 3.00)
      • Sound - Play FlashBack1Second <gen>
      • Wait for (Last played sound) to be 0.10 seconds from finished playing
      • Sound - Destroy (Last played sound)
      • Player Group - Pick every player in (All players) and do (Camera - Stop swaying/shaking the camera for (Picked player))
      • Wait 2.00 seconds
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Destroy KriomplastrosPriestSE1
      • Special Effect - Destroy KriomplastrosPriestSE2
      • Custom script: call RemoveLocation (udg_KriomplastrosBlock)
      • Custom script: call RemoveLocation (udg_KriomplastrosSpawn1)
      • Custom script: call RemoveLocation (udg_KriomplastrosSpawn2)
      • Custom script: call RemoveLocation (udg_KriomplastrosSpawn3)
      • Custom script: call RemoveLocation (udg_KriomplastrosSpawn4)
      • Custom script: call RemoveLocation (udg_KriomplastrosPriest1)
      • Custom script: call RemoveLocation (udg_KriomplastrosPriest2)

  • Raid Check
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Number of units in (Units in KriomplastrosArea <gen> matching ((Owner of (Matching unit)) Equal to Player 1 (Red)))) Equal to 0
      • KriomplastrosEntered Equal to True
    • Actions
      • Wait 3.00 seconds
      • Quest - Display to (All players) the Quest Failed message: |cffff3333Raid Fail...
      • Set KriomplastrosEntered = False
      • Set KriomplastrosInitial = (Center of KriomplastrosInitial <gen>)
      • Unit - Move Wanderer of the Glacier 0014 <gen> instantly to KriomplastrosInitial, facing 330.00 degrees
      • Unit - Set life of Wanderer of the Glacier 0014 <gen> to 100.00%
      • Unit - Set mana of Wanderer of the Glacier 0014 <gen> to 100.00%
      • Environment - Remove (Last created weather effect)
      • Environment - Create at Snow <gen> the weather effect Northrend Snow (Heavy)
      • Environment - Turn (Last created weather effect) On
      • Environment - Reset fog to default values
      • Game - Set the time of day to 8.00
      • Game - Set time of day speed to 100.00% of the default speed
      • Set KriomplastrosAllies = (Units within 1000.00 of (Center of KriomplastrosSpawn2 <gen>) matching (((Owner of (Matching unit)) Equal to Neutral Hostile) and ((Unit-type of (Matching unit)) Not equal to Wanderer of the Glacier)))
      • Unit Group - Pick every unit in KriomplastrosAllies and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Destructible - Pick every destructible in KriomplastrosBlock <gen> and do (Actions)
        • Loop - Actions
          • Destructible - Kill (Picked destructible)
      • Custom script: call DestroyGroup(udg_KriomplastrosAllies)
The problems are:

In trigger one, it's all fine the first time. But, if it runs more than once, the sound doesn't play the 2nd time (nor the 3rd, 4th etc...). Does it have to do with the Destroy Sound command?

Trigger two works fine, only it runs 4 times in a row every one second (well, at least the message is displayed 4 times, so I assume the whole trigger runs 4 times). I can't understand this, since there is a KriomplastrosEntered Equat to True in the Conditions, and there is a Set KriomplastrosEntered = False inside the trigger.

Any help is appreciated :cool:

PS. No comments about my waits unless you tell me why waits are not recommended in GUI (nobody has answered me that one oO)
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
umm, its the Destroy sound command.
+ The bad thing about wait is that you need to be precise, and the Variables Could be bugged if you set them in a wait. if you use them multiple times, like a Destroy option, if you set a variable to a lets say, unit, and thats the variable, and it sets off in the same trigger with "Set Unit Variable" and a wait, Destroy that unit, and if you do the first trigger 2 times in game, it will only destroy the last setted unit..
 
Level 11
Joined
Feb 14, 2009
Messages
884
  1. If I remove the Destroy Sound line, wouldn't it leak? How do I use the same sound more than once and still keep it leakless?
  2. How can I replace the Wait without bugging the trigger?
  3. Does the 2nd trigger bug because of the wait?

EDIT: I removed the 3-sec wait from the 2nd trigger and it bugs no more.
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
I know a solution that got a 99.9999% chance to remove leaks,
Variable Type Sound, whatever name you like, Array 10000.
  • Set Attack_Sounds[Random number from 1 to 8972 or what the cap is. - Last Created Sound
  • Boss Dies
    • Events
      • YOURUNIT dies
    • Conditions
    • Actions
      • For each loop integer a 1 to the Variable array
        • Loop Actions
          • Destroy Attack_Sounds([Integer A])
EDIT: Will check the triggers

EDIT: The first one leaks with the Special effects, but you could use 3 of those variables that i posted and to the same stuff, just in that trigger.
The Second one doesnt leak since its in the beginning
 
Level 11
Joined
Feb 14, 2009
Messages
884
So, are you suggesting that I use a Sound array to play the sound as many times as I need? Handy, will try it...
 
Level 9
Joined
May 30, 2008
Messages
430
I don't think sounds leak but whatever, when u use "destroy sound" the sound can't be used second time. And if u think logical between Create special effect and Play sound there is a diference when u are creating song and just playing it:cute: after all u are playing the song not creating new one so it don't leak
 
Status
Not open for further replies.
Top