| 10-10-2003, 10:43 AM | #1 |
well... i made this trigger, but for something it just doesn't work! ;( someone plz help me, thxs ;) noblade Events Unit - A unit owned by Player 1 (Red) Acquires an item Unit - A unit owned by Player 2 (Blue) Acquires an item Unit - A unit owned by Player 3 (Teal) Acquires an item Unit - A unit owned by Player 4 (Purple) Acquires an item Unit - A unit owned by Player 5 (Yellow) Acquires an item Unit - A unit owned by Player 6 (Orange) Acquires an item Unit - A unit owned by Player 7 (Green) Acquires an item Unit - A unit owned by Player 8 (Pink) Acquires an item Unit - A unit owned by Player 9 (Gray) Acquires an item Conditions ((Triggering unit) is A Hero) Equal to True (Item-type of (Item being manipulated)) Equal to Assassin's Blade [Unique] Actions Set items = 0 For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Assassin's Blade [Unique]) then do (Set items = (items + 1)) else do (Do nothing)) If (items Greater than 1) then do (Hero - Drop (Item being manipulated) from (Hero manipulating item)) else do (Do nothing) |
| 10-10-2003, 11:48 AM | #2 |
Why not just use the trigger I gave you ? It looks a bit like it, but you have changed some stuff .... wich actually just makes it more complicated... :P |
| 10-10-2003, 01:17 PM | #3 | |
Quote:
what?! when did you give me a trigger?!! wtf???? Anyone know? |
| 10-10-2003, 04:17 PM | #4 |
Wasn't u then I guess.... Could have sworn :P Well, I answer alot of topics...so...BUT! Anyways here is the trigger I use, wich works perfectly: First trigger, to determin that red aquires a weapon: Red Dagger Aquire Events Unit - A unit owned by Player 1 (Red) Acquires an item Conditions (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Weapon Equal to 1 Then - Actions Set weapon = 2 Hero - Drop (Item being manipulated) from (Triggering unit) Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to Player 1 (Red))) the text: You already have a ... Else - Actions Set weapon = 1 Second trigger, to find out when the item is dropped: Red Dagger Loose Events Unit - A unit owned by Player 1 (Red) Loses an item Conditions (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Weapon Equal to 2 Then - Actions Do nothing Set Weapon = 1 Else - Actions Set Weapon = 0 IF the hero tries to pick up another weapon (REMEMBER, if you have more people in, you will need a Integer for each of them...so you need to do an event for each player) the first trigger will activate and see that weapon=1 and run the "you already have a weapon" chat command and drop the item. The place in the first trigger, where weapon=2, is to ensure that the guy doesn't buy another weapon, it get's dropped and his "weapon" allowment is reduced back to 0 again. If he drops it, it will get reduced to 0 again. Hope this helps you :) (Funny how I can answer the same question 2 times in 2 days :P ) |
| 10-10-2003, 04:36 PM | #5 |
Here is a condition~ Boolean comparison - hero - hero has item of type i think you can use it~ but,if your hero can only use one weapon and there are many kinds of weapon in your map, Zachary_Shadow's trigger is better~ ps.my english is poor,i hope u know what i say.... |
| 10-10-2003, 07:34 PM | #6 | |
Quote:
But... How should I set the Integer....? I have 9 ppl in the game (maximun, not always 9...) |
| 10-10-2003, 07:42 PM | #7 |
The easiest way.... You see the variable called "weapon" in his trigger? Make it an array with 9 then in his trigger where is says "weapon" replace it with: weapon[slot number of player(owner of unit(unit manipulating item))] and make the event to be a generic "Unit - Unit aquires item" instead of "Unit - A unit owned by Player 1 (Red) Acquires an item" |
| 10-10-2003, 08:06 PM | #8 |
Or you could always just make a integer option for each of the players: WeaponRed WeaponBlue And so on, and set it for each person. Lot bigger but the simplest way and it will work like that. Not totaly sure what AllPainful's array would do...can u explain that please, as it sounds 10000 times easier to do it that way :) |
| 10-10-2003, 08:17 PM | #9 |
The array is essentially: Weapon[1] Weapon[2] Weapon[3] Weapon[4] Weapon[5] Weapon[6] Weapon[7] Weapon[8] Weapon[9] And the: slot number of player(owner of unit(unit manipulating item)) Is what does the number, reverse engeneer it: slot number of player(owner of unit(unit manipulating item)) It returns the slot number (in other words the player number) of the player who owns the unit doing the maniputlating. So if player one was doing the manipulating then: Weapon[slot number of player(owner of unit(unit manipulating item))] would be the same as: Weapon[1] |
| 10-10-2003, 09:39 PM | #10 |
Ahh....think I get it now :) So the array determin wich player the Weapon Integer belongs to, then sets it to 1 if he picks up an item...and so on ? :) Nice... |
