| 12-23-2003, 06:58 AM | #1 |
I have a trigger that makes it so that when a unit has an item it wont get damaged in a certain area it works but it also damages the enemy units and i dont want it to damage enemy units help fixing this problem would be greatly appretiated here is the trigger. Unit Group - Pick every unit in (Units in X Blizzard2 <gen>) and do (If ((((Owner of (Picked unit)) is an ally of Player 1 (Red)) Equal to True) and (((Item-type of (Item carried by (Picked unit) of type Winter Coat)) Equal to Winter Coat) or (((Picked unit) belongs to an ally of Player 1 (Red)) Not equal to True))) The condition is above and i have no idea why it does not work. |
| 12-23-2003, 07:05 AM | #2 |
(((Item-type of (Item carried by (Picked unit) of type Winter Coat)) Equal to Winter Coat) or (((Picked unit) belongs to an ally of Player 1 (Red)) Not equal to True))) the whole last part makes absolutly no sense. item type of winter coat equelt o winter coat? arent you just repeating yourself? im not sure what all that is for... why is there an "or" in there? it hepls if you read over your trigers a few times..... |
| 12-23-2003, 07:13 AM | #3 |
Yes, the reason i have the or there is because i dont want it to damage enemy units but it damages enemies. I need to know how to make it do no damage to enemies |
| 12-23-2003, 07:39 AM | #4 | |
Quote:
Messy. A bit of advice, always, and I mean ALWAYS use the 'multiple' version of the Or's or And's, it makes it so much easier to read when you are trouble shooting. We have: If (Owner of picked unit is an ally of player 1 equal to true) and Item type of Item carried by picked unit of type Winter Coat equal to Winter Coat. Those are anded together, and the second one makes no sense. I assume you are missing a slot assignment in the above 'copy'. You are comparing one item to itself. Lets try this over again, since I think you need to redo the statement. You want to make it so that all units allied to a player (1) will not take damage, but all other units will take damage as normal, yes? But only if Player one has a certain Item equipped? One ways: Test Events Unit - A unit Acquires an item Conditions (Owner of (Hero manipulating item)) Equal to Player 1 (Red) (Item-type of (Item being manipulated)) Equal to Tome of Experience Actions Set B_MultiItem = True Test Events Unit - A unit Loses an item Conditions (Item-type of (Item being manipulated)) Equal to Tome of Experience (Owner of (Hero manipulating item)) Equal to Player 1 (Red) Actions Set B_MultiItem = False These two triggers will keep track of whether or not you have equipped the item you are looking for (Note, change whatever variable names to whatever you are working with. Then, when you are doing the damage condition just do: B_MultiItem Equal to False Before attempting to do whatever damage you will do, to units allied to player 1. Got it? |
| 12-23-2003, 07:47 AM | #5 |
Not exactly... i wanted to make it so enemy units take no damage but, if any player allied to player 1 doesnt have an item they take damage but if any of them have the item then the ONE with the item doesnt take damage but they only avoid damage by having the item in their inventory anywhere I have it set to where a unit enters a region and they take damage every second unless they have the item or if the unit is an enemy so the enemies and the heros with items wont take damage |
