• 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] A nasty bug stops my trigger from properly working.

Status
Not open for further replies.
Level 2
Joined
Apr 22, 2010
Messages
25
Okay here is the deal i have this:
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Field of Frost
  • Actions
    • Set FoFCaster = (Casting unit)
    • Sound - Play DeathKnightWarcry1 <gen> at 100.00% volume, located at (Position of (Casting unit)) with Z offset 0.00
    • Trigger - Run Destroy Sound <gen> (ignoring conditions)
    • For each (Integer A) from 1 to (4 + (Level of Field of Frost for (Casting unit))), do (Actions)
      • Loop - Actions
        • Set FoFGrp = (Units within 800.00 of (Position of (Casting unit)) matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is alive) Equal to True))))
        • Unit Group - Pick every unit in FoFGrp and do (Actions)
          • Loop - Actions
            • Unit - Cause (Casting unit) to damage (Picked unit), dealing ((3.00 x (1.00 x (Real((Strength of (Casting unit) (Include bonuses)))))) + 0.00) damage of attack type Magic and damage type Magic
            • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Blizzard\BlizzardTarget.mdl
            • Trigger - Run Destroy SFX <gen> (ignoring conditions)
            • Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
            • Trigger - Run Destroy SFX <gen> (ignoring conditions)
        • Trigger - Run Field of Frost Stun <gen> (ignoring conditions)
        • Custom script: call DestroyGroup (udg_FoFGrp)
        • Wait 3.00 game-time seconds
  • Actions
    • Unit - Create 1 Dummy 3 for (Owner of FoFCaster) at (Position of FoFCaster) facing Default building facing degrees
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Unit - Add War Stomp (DummyFoF) to (Last created unit)
    • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
The spell should pulse every 3 seconds damage and stunning enemy units for 1 second. The bug and problem is the second trigger (with the dummy) stops the damage portion from the main trigger. I do not know why but i tested the main trigger when the secondary trigger was disabled and it worked fine. So my question is how can i overcome this bug ? Also another thing, about the sound part of the trigger it only functions on the first cast of the spell ingame, any additional casts do not play the sound and i'd like to know how to fix that too, thanks in advance.
 
Level 10
Joined
Jul 12, 2009
Messages
321
The bug and problem is the second trigger (with the dummy) stops the damage portion from the main trigger. I do not know why but i tested the main trigger when the secondary trigger was disabled and it worked fine. So my question is how can i overcome this bug?

Use Triggering unit instead of Casting unit; FYI, Casting unit and Target unit of ability being cast are overwritten when another unit casts a spell, which you are doing in that second trigger. Triggering unit is preserved, however.

BTW, you really should not be using a wait within a For Integer A loop. Any other trigger that also wants to use Integer A while this spell is running will conflict. You should use a periodic trigger, timers, or a unique variable for the loop.

Also another thing, about the sound part of the trigger it only functions on the first cast of the spell ingame, any additional casts do not play the sound and i'd like to know how to fix that too, thanks in advance.
Can't tell, since you haven't posted the trigger Destroy Sound <gen>. If it does what it's named, you're destroying the sound and thus can't play it a second time.
 
Level 2
Joined
Apr 22, 2010
Messages
25
This is the sound destroying trigger, i still have no idea what it does it was basicly a modified copy of a working special effect destroying trigger intended to clear leaks..
  • Actions
    • Custom script: local sound udg_Sound
    • Set Sound = (Last played sound)
    • Wait 2.50 seconds
    • Sound - Destroy Sound
If that is why the sound isn't played again then how should i clear the leak and be able to hear the sound every time the spell is cast ?
Also for the integer A i will see what i can do about it and thanks for pointing out where the problem is.
 
Level 2
Joined
Apr 22, 2010
Messages
25
I remade the trigger without any wait/Integer A and its working, the only thing that bothers me is how to make my sound play on every cast and clear the leak without destroying the sound for the rest of the game.
 
Level 2
Joined
Apr 22, 2010
Messages
25
I have no idea what hashtable or indexing is , could you give me an example, please.
And also is it possible/sufficient to just destroy the created variable in the second trigger with Destroy last played sound ?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I have no idea what hashtable or indexing is , could you give me an example, please.

Indexing and Hashtables are used for making a spell Multi User Instanceable (MUI) This means that multiple users can cast the spell at the same time without causing bugs/problems.

Here is a tutorial on hashtables:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/

a tutorial on indexing and MUI (it's in chapter 3):
http://www.hiveworkshop.com/forums/1276157-post1.html
 
Level 2
Joined
Apr 22, 2010
Messages
25
My thanks for the tutorials i will take a look at them and handle the leak like it was suggested.
I will comment whether i succeeded or not.



Success, thanks to Deuterium's tutorial i was able to make the sound destruction trigger perfect at what i want it to do, additionally i was able to learn some interesting facts about gui. Special thanks to him and Hashjie for pointing out the tut for me.
 
Last edited:
Status
Not open for further replies.
Top