HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

trigger-based spell problem

08-27-2003, 09:22 PM#1
35263526
In my RPG map, one of the hirable units is the Goblin. He has a skill called Satchel Charge that has a really short range and SHOULD make the building targeted explode after 10 seconds.

To do this I made a dummy spell based of Frost Nova and made two triggers. This is the first:
------------------------------------------------------------------------------------
Detect Order
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Issued order) Equal to Undead Lich - Frost Nova
(Unit-type of (Ordered unit)) Equal to Goblin
Actions
Set SatchelCustomValue = (SatchelCustomValue + 1)
Unit - Set the custom value of (Ordered unit) to SatchelCustomValue
Set SatchelTargetUnit[(Custom value of (Ordered unit))] = (Target unit of issued order)
------------------------------------------------------------------------------------

and here is the second:
------------------------------------------------------------------------------------
Detect Casting
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Satchel Charge
(Unit-type of (Casting unit)) Equal to Goblin
Actions
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Sound - Play BattleNetTick <gen> at 100.00% volume, attached to SatchelTargetUnit[(Custom value of (Casting unit))]
Wait 1.00 game-time seconds
Unit - Explode SatchelTargetUnit[(Custom value of (Casting unit))]
------------------------------------------------------------------------------------

SatchelCustomValue is an interger variable. SatchelTargetUnit is a Unit Array variable. What trigger 1 is meant to do is detect when Satchel Charge is used and store it in the array. What trigger 2 is supposed to do is play 10 Tick 3D sound from the target then make it explode. I did the Set Custom Value actions to make it sothat if one Goblin uses the ability, then another uses it before the first is finished, it doesn't change the target of the first.

When I try to use the ability in-game, it plays the Tick Sounds, but the target doesnt explode afterwards. I did some experimenting and I think using Wait actions messes up the trigger. Is there a way round this, or am I just doing something wrong?
08-27-2003, 09:55 PM#2
jeffsu
Cool idea! Wish I had a good answer for you, heh.
Try this: instead of using "explode unit" create a hidden unit with a huge 5000 dam attack and order it to hit the building. Give it an artillery attack so it looks like an explosion. Then remove the unit.
08-27-2003, 09:56 PM#3
35263526
Oh yeah. Could someone tell me if this will work for multiple units. I'm not sure cause I had to improvise a little when I realized that you couldn't using the casting unit's ID in the variable reference.
08-27-2003, 10:00 PM#4
35263526
thx for the idea, but I just looked at the bugs list on B.Nets site and I found out that wait actions reset Casting Unit.
So now the question is, is there another way to do this?

And thxfor saying its a cool idea. I haven't seen it anywhere before, so either i'm very imaginative or its not possible.

(rooting for the 1st) :D
08-27-2003, 10:03 PM#5
Shvegait
You could always set a variable equal to (Casting Unit) as the first action of the trigger, then reference the variable instead of (Casting Unit).
08-27-2003, 10:06 PM#6
35263526
OH MY GOD THANKYOU THANKYOU!!!!!!!!
08-27-2003, 10:10 PM#7
35263526
oh wait. I just tried but wont that make it so that if two goblins use the ability one after another it will make the first target the seconds target.

I know you can and im just being stupid, but how do you make it so that it stores something about the unit in the array so that it is unique. (if you dont understand my rambling how do i solve the above problem)
08-27-2003, 10:28 PM#8
jeffsu
Variable good idea -- don't know how simultaneous goblin attacks would work out though. Maybe worth testing?