| 07-30-2008, 04:19 PM | #1 |
this is my trigger Trigger: 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 |
Is the effect supposed to be reversible (can the peon become unburrowed again)? |
| 07-30-2008, 06:34 PM | #3 |
Yes... he'll only blow up when he's "in the dirt" |
| 07-30-2008, 07:08 PM | #4 |
You cannot use Place land mine. Checking a goblin land mine shows that it has these abilities:
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 |
| 07-31-2008, 12:24 AM | #6 |
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 |
So this is what I got Trigger: peon bombs![]() Actions![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions) |
| 07-31-2008, 02:51 AM | #8 |
Tried to use Add abilitys on THEN instead of ELSE? ;) |
| 07-31-2008, 02:58 AM | #9 |
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 |
Add Game - Text Message everywhere in the trigger; to find out what happends when (if) it runs. |
| 07-31-2008, 06:00 PM | #12 |
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 |
Thank you very much. |
| 07-31-2008, 10:18 PM | #14 |
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? |
