- Joined
- Mar 27, 2008
- Messages
- 8,035
I don't know is it me, or is it Destroy SFX function is bugged ?
Okay, try these triggers above;
And yes, I cast this spell separate at a time (meaning that only 1 unit casting this spell during the duration respectively, so there's no case of MUi/non-MUI involved)
My question, why and how to solve it ?
I mean I want SFX longer than 2 seconds and I want to destroy them after 6 seconds, how ?
Actually, this is not the actual trigger, if this is the actual trigger, I would just make it as local variable (because local variable strangely works).
Actually, my trigger is that, I saved an SFX to a hashtable with a duration of 5.00 seconds, and in the loop trigger as usually, I would decrease the value of duration per interval until it reaches <0 and then I end the operation and destroy the SFX.
Problem now is that the SFX never gets destroyed, because somehow it relates the problem with local variable (because as I have mentioned earlier, local variable works with the Trigger 6 seconds), and I'm thinking if I link Cast and Loop trigger with local variable, I might be able to pull this off, but how would I link them since local variable only works within given trigger ?
If you have any idea, do tell
That is just my current idea and I don't know how to execute it.
These are my actual triggers for those who want to further understand the problem;
Okay, try these triggers above;
-
Wait 2 seconds
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-

Actions
-


Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
-


Set sfx = (Last created special effect)
-


Wait 2.00 seconds
-


Special Effect - Destroy sfx
-
-
-
Wait 6 seconds
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-

Actions
-


Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
-


Set sfx = (Last created special effect)
-


Wait 6.00 seconds
-


Special Effect - Destroy sfx
-
-
And yes, I cast this spell separate at a time (meaning that only 1 unit casting this spell during the duration respectively, so there's no case of MUi/non-MUI involved)
My question, why and how to solve it ?
I mean I want SFX longer than 2 seconds and I want to destroy them after 6 seconds, how ?
Actually, this is not the actual trigger, if this is the actual trigger, I would just make it as local variable (because local variable strangely works).
Actually, my trigger is that, I saved an SFX to a hashtable with a duration of 5.00 seconds, and in the loop trigger as usually, I would decrease the value of duration per interval until it reaches <0 and then I end the operation and destroy the SFX.
Problem now is that the SFX never gets destroyed, because somehow it relates the problem with local variable (because as I have mentioned earlier, local variable works with the Trigger 6 seconds), and I'm thinking if I link Cast and Loop trigger with local variable, I might be able to pull this off, but how would I link them since local variable only works within given trigger ?
If you have any idea, do tell
That is just my current idea and I don't know how to execute it.
These are my actual triggers for those who want to further understand the problem;
-
Cast
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-

Actions
-


Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
-


Set dummy = (Last created unit)
-


Custom script: set udg_key = GetHandleId(udg_dummy)
-


Set duration = 5.00
-


Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
-


Set sfx = (Last created special effect)
-


Hashtable - Save duration as 0 of key in hashtable
-


Hashtable - Save Handle Ofsfx as 1 of key in hashtable
-


Unit Group - Add dummy to group
-


Trigger - Turn on Untitled Trigger 003 <gen>
-
-
-
Loop
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


Unit Group - Pick every unit in group and do (Actions)
-



Loop - Actions
-




Set dummy = (Picked unit)
-




Custom script: set udg_key = GetHandleId(udg_dummy)
-




Set duration = (Load 0 of key from hashtable)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






duration Greater than 0.00
-
-





Then - Actions
-






Hashtable - Save (duration - 0.03) as 0 of key in hashtable
-
-





Else - Actions
-






-------- THIS PART DOES NOT WORKING --------
-






Set sfx = (Load 1 of key in hashtable)
-






Special Effect - Destroy sfx
-
-
-
-
-
-












