| 08-02-2002, 12:48 AM | #1 |
Guest | Ok... i see no reason why this isn't working. I have an array variable called "numberofunits" set up for the number of units each player has in a specific region. In order to test it, every .5 seconds i'm having it display how many units each player has in the region. Ok.. this trigger works: Events: Time - Every .5 seconds of game time Actions: Player Group - Pick every player in (All players) and do (Set numberofunits[(Player number of (Picked player))] = (Number of units in (Units in UpLeft2 <gen> matching (((Owner of (Matching unit)) Equal to (Picked player)). This works perfectly except for the fact it counts dead units! Ok.. so I decide to use an AND condition with both the player comparison and a boolean comparison so that the unit being alived equals true... so I select the AND condition and for the first I put the exact same thing I put before and for the 2nd I put (((Matching unit) is alive) Equal to True) and now for some reason it says all of the players have 0 units in the region! So I made a new one where BOTH and conditions said the exact same thing (Owner of (Matching unit)) Equal to (Picked Player)) and it still says 0! This means either I am using the and condition incorrectly or there is a bug with it! Any ideas? Thx in advance! -John |
| 08-02-2002, 01:06 AM | #2 |
Guest | I'm not sure about your "and" problem, but setting up your trigger like the following might work around that problem... Events: Unit Enters <Your Region> Actions: Remove all corpses in <Your Region> Player Group - Pick every player in (All players) and do (Set numberofunits[(Player number of (Picked player))] = (Number of units in (Units in UpLeft2 <gen> matching (((Owner of (Matching unit)) Equal to (Picked player)). note: you might need a short wait somewhere before setting the variables because of the weirdness of the "enters region" trigger |
| 08-02-2002, 04:01 AM | #3 |
Guest | i'd rather not get rid of the corpses in the region cause I want them to be able to be raised by a necromancer. get this though... by changing it to Units owned by picked player matching the conditions the unit is in the region and the unit is alive.. it works! I don't understand why this works and the other doesn't. I'd actually rather get the other one working still though cause I believe it is more efficient (it only has to check all the units in the region, not all the units owned by the player). Any ideas why this works and my other trigger did not? Thx! |
| 08-02-2002, 07:35 AM | #4 |
Try using picked player instead of owner of (matching unit). I dont think the bug is from the AND part, I have a feeling its the 2 'matching unit' functions. |
