Warcraft III resources & community, 2003–2006 · archived

need help with a trigger!!!

16 posts
#1

need help with a trigger!!!

how do i make a trigger so that when a player types in -sell or somthing like that all the players footmen die (explode) and that player gets one gold for each footman that died this way? should work more than once. and also once the knight upgrade is researched it should give you four gold for each knight. please help me. thx.
#2
Events:
Player - Player 1 (Red) types a chat message containing -sell as An exact match (do this for every player)

Conditions: Any

Actions:
Player - Add (Number of units in (Units owned by (Triggering player) of type Footman)) to (Triggering player) Current gold

Player - Add ((Number of units in (Units owned by (Triggering player) of type Knight)) x 4) to (Triggering player) Current gold

Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) Equal to Footman) or ((Unit-type of (Matching unit)) Equal to Knight))) and do (Actions)
Loop - Actions
Special Effect - Create a special effect at (Position of (Picked unit)) using UI\Feedback\GoldCredit\GoldCredit.mdl
Unit - Explode (Picked unit)

This also creates a gold effect on the sold unit, it will look wierd if like 20 footmen suddenly explodes...
#3
is this trigger tested?
because it isnt working for me. please help
#4
Well, i haven't tried it, but it should work, i've done things like this many times...

EDIT: Tell me what doesn't work.
#5
i love the trigger. you get the gold and everthing works fine until its supposed to kill the units but it doesnt it just gives you the gold for them and leaves them there. thx--AlphaChicken
#6
I think your problem is in the
Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) Equal to Footman) or ((Unit-type of (Matching unit)) Equal to Knight))) and do (Actions)
command.
Change it to Picked Unit. So the trigger would be like this:
Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Unit-type of (Picked Unit)) Equal to Footman) or ((Unit-type of (Picked Unit)) Equal to Knight))) and do (Actions)
#7
Well, the Matching Condition function is what the Matching commands are for, isn't it? The Picked unit function is what happens after you've picked the units, the Matching is when you're picking them.
#8
The wickerman's trigger looks fine. Except that he doesn't destroy the special effects that he create, but that hasn't anything to do with the trigger nto working. It works even if you don't destroy the special effects.
#9
No, it is the Matching Unit part. Matching Unit would only be used if you had an action previously that asked if there are units matching a condition. I'm not really sure how to explain this, just try my method out and see if it works.
#10
No, there if you look at his trigger it already asks for the matching unit.

Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) Equal to Footman) or ((Unit-type of (Matching unit)) Equal to Knight))) and do (Actions)
#11
It do destroy the effect, many effect destroys themself automathicly (like gold effect, unsummon etc.), you can see them loop in the effect selection. It's models like attachable items and units that has to be taken away manually. :roll:
#12
I'm not really sure how to explain it, but the Matching Unit would be refering to a matching condition before. Basically what the trigger would say if it is my way is Take every unit owned by the trigering player but only if they are a knight or footman, so matching unit doesn't make sense.
#13
The Matching unit must match either being a footman or a knight to do following actions as a picked unit. Now, there's no need to make it this way, simply copy it into two triggers and use "owned by player of type", but i shorted it down to one, and for what i know, it should work.
#14
TheWickerMan's trigger is working fine. Sorry, oz02, but TheWickerMan is right, it must be "matching unit", "picked unit" doesn't work
#15
Oh well, I guess I got confused. It happens a lot with me, that I think something reads one way until someone explains it in a diferent way... It's a really weird habit of mine.