• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

need help with a trigger!!!

Status
Not open for further replies.
Level 5
Joined
Jun 18, 2004
Messages
136
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.
 
Level 6
Joined
Mar 25, 2004
Messages
235
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...
 
Level 5
Joined
Jun 18, 2004
Messages
136
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
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
I think your problem is in the
Code:
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:
Code:
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)
 
Level 1
Joined
Jul 21, 2004
Messages
7
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.
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
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.
 
Level 1
Joined
Jul 21, 2004
Messages
7
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)
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
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.
 
Level 6
Joined
Mar 25, 2004
Messages
235
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.
 
Status
Not open for further replies.
Top