HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trying to fasion a spell/unit

07-30-2008, 04:19 PM#1
samsunglova
this is my trigger
Trigger:
peon bombs
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Itty Bitty Mine Peon
Collapse Actions
Unit - Add Item Place Goblin Land Mine to (Triggering unit)

itty bitty mine peon only has one spell (burrow)
once he burrows i'd like for him to blow up like a land mine when units get close
07-30-2008, 06:00 PM#2
Themerion
Is the effect supposed to be reversible (can the peon become unburrowed again)?
07-30-2008, 06:34 PM#3
samsunglova
Yes... he'll only blow up when he's "in the dirt"
07-30-2008, 07:08 PM#4
Themerion
You cannot use Place land mine. Checking a goblin land mine shows that it has these abilities:
  • Mine - exploding (Goblin Land Mine)
  • AOE Damage Upon Death (Goblin Mine)

If you add those abilities, the peon is supposed to blow up ^^

Also, for knowing when to remove and when to add the abilities, you just do an Integer Comparison for the Unit Ability Level. If (level == 1) then the unit has the abilities (he is burrowed), and you should remove the abilities when he does unburrow. Else, add the abilities.
07-30-2008, 10:03 PM#5
samsunglova
Trigger:
peon bombs
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Itty Bitty Mine Peon
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to Burrow
Collapse Then - Actions
Unit - Add AOE damage upon death (Goblin Mine) to (Triggering unit)
Unit - Add Mine - exploding (Goblin Land Mine) to (Triggering unit)
Else - Actions

how do i add in if unborrowed using burrow or burrowed using burrow
07-31-2008, 12:24 AM#6
Anitarf
Check for the current level of AoE damage ability on the unit, if it's greater than 0 then the unit has the ability, meaning you already added the ability to it earlier when it was burrowing, so now it's unborrowing and the abilities should be removed. Likewise, if the unit doesn't have the abilities then that means the last time the spell ran the abilities were removed, so that means it was unburrowing last time and is burrowing now, so the abilities should be added to it.

Also, I'd use the "starts the effect of an ability" event instead of the one you're currently using, which only runs if the unit finishes it's casting animation, however players can interrupt that animation before the end and still get the spell's effect without triggering your event, potentialy breaking your system.
07-31-2008, 02:31 AM#7
samsunglova
So this is what I got

Trigger:
peon bombs
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Itty Bitty Mine Peon
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to Burrow
(Level of AOE damage upon death (Goblin Mine) for (Triggering unit)) Equal to 1
Collapse Then - Actions
Unit - Remove AOE damage upon death (Goblin Mine) from (Triggering unit)
Unit - Remove Mine - exploding (Goblin Land Mine) from (Triggering unit)
Collapse Else - Actions
Unit - Add AOE damage upon death (Goblin Mine) to (Triggering unit)
Unit - Add Mine - exploding (Goblin Land Mine) to (Triggering unit)
but doesn't work
07-31-2008, 02:51 AM#8
JamesBond
Tried to use Add abilitys on THEN instead of ELSE? ;)
07-31-2008, 02:58 AM#9
samsunglova
What? You basically just said whatever you put in 'Else' doesn't function. The way the trigger is set up is fine. I just don't know why it doesn't work.
07-31-2008, 10:58 AM#10
Themerion
Add Game - Text Message everywhere in the trigger; to find out what happends when (if) it runs.
07-31-2008, 12:00 PM#11
samsunglova
Trigger:
peon bombs
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Itty Bitty Mine Peon
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to Burrow
(Level of AOE damage upon death (Goblin Mine) for (Triggering unit)) Equal to 1
Collapse Then - Actions
Game - Display to (All players) the text: I get rid of the bo...
Unit - Remove AOE damage upon death (Goblin Mine) from (Triggering unit)
Unit - Remove Mine - exploding (Goblin Land Mine) from (Triggering unit)
Collapse Else - Actions
Game - Display to (All players) the text: I give the bomb
Unit - Add AOE damage upon death (Goblin Mine) to (Triggering unit)
Unit - Add Mine - exploding (Goblin Land Mine) to (Triggering unit)

When they burrow, it says I give the bomb... but when I unburrow it doesn't say I get rid of the bomb...

also a quick question if you know...

Trigger:
Set Integers[4] = (Random integer number between 1 and 3)
That works at map initial? And say i have 3 triggers that start at .01 elasped each with a condition of if integers[4] = 1 2 or 3
Why would that not work? and by not working... IT ALWAYS picks 3
07-31-2008, 06:00 PM#12
Themerion
But wait... doesn't burrow work like a morph? It replaces the unit with another one, right?

So you don't need a trigger at all. Just add the two abilities (mine exploding and AOE damage on death) to the unit-type Itty Bitty Mine Peon (Burrowed) in the Object Editor.

The Random function is infamous for not being very random. It usually picks the same thing in the beginning if you do sequential tests. If it's map init or elapsed time X doesn't matter. However, it can actually vary if played at another time, so it's as random as you can get in Warcraft.
07-31-2008, 08:31 PM#13
samsunglova
Thank you very much.
07-31-2008, 10:18 PM#14
Anitarf
Wait, do you pick a new random value for your variable in each of those 3 triggers that run at .01 elapsed game time, or do you just set it to one random value at map init and then leave it like that?