| 08-30-2003, 05:00 PM | #1 |
Ok so im making this trigger where you put 3 of the same item on a hero, the hero casts a spell and if he has all 3 it combines them into something new. The problem is that the editor doesnt recognize if it has all 3, it only check if he has one. Here is the trigger... could someone help? Events Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Forge ((Triggering unit) has an item of type Item A) Equal to True ((Triggering unit) has an item of type Item A) Equal to True ((Triggering unit) has an item of type Item A) Equal to True ((Triggering unit) has an item of type Item B) Equal to True Actions Item - Remove (Item carried by (Triggering unit) of type Item A) Item - Remove (Item carried by (Triggering unit) of type Item A) Item - Remove (Item carried by (Triggering unit) of type Item A) Item - Remove (Item carried by (Triggering unit) of type Item B) Hero - Create Item C and give it to (Triggering unit) Another problem I have with my other triggers like this one that only use 2 items is that if you fill up the inventory with random items and use the spell, it will combine the 2 items that work together and leave all the other. Is there a way to check to make sure there are no other items in the inventory when it spell is cast then the ones that work together? |
| 08-30-2003, 05:31 PM | #2 |
Lol of course tats not ganna work… because you are checking for the same thing 3 times. There are many ways to do this… here is a way I can think of right now. Make a trigger, EVENT: hero acquires item CON: Item type = a) ACTION: set X=X+1 Then make another trigger that activates when he casts the spell and if X=3 then it transforms the item… (also make sure you make a trigger thet makes X=X-1 if the hero drops the item) OR you could make it so it checks hero's inventory slots. So for your conditions you could have if “inventory slot 1 of hero = item type A� and “inventory slot 2 of hero = item type A� and “inventory slot 3 of hero = item type A� then… OR you could make a trigger, EVENT: hero casts spell CON: spell type = (whatever it is) Action: If item A = item in slot 1 of hero inventory then set X=X+1 else do nothing If item A = item in slot 2 of hero inventory then set X=X+1 else do nothing … If item A = item in slot 6 of hero inventory then set X=X+1 else do nothing If X=3 then (transform item) else set X=0 Now that i think about it the last one is the easiest one... just go with the last one. |
| 08-30-2003, 06:17 PM | #3 |
Im really noob at variables so could you by any chance go into a bit more detail of how you did the?: Action: If item A = item in slot 1 of hero inventory then set X=X+1 else do nothing |
| 08-30-2003, 06:41 PM | #4 |
make an If/Then/Else action then make the IF: Items - Item type of "Weapon A" equals to (item carried by hero in slot 1) (or the other way around... (item carried by hero in slot 1) equals to "Weapon A") Then: Set variable. create an integer variable, say you call it X, then set X=X+1. Else: do nothing |
| 08-30-2003, 08:39 PM | #5 |
Still cant find how to set that under the "IF" condition.... I looked but when I picked Item-Type Comparison it wont let me set one of them to "Item carried by hero in slot 1" I checked a lot of the comparisons but couldnt find one that would allow me to set it like that. I must be missing something.... do I need an enhanced editor? |
| 08-30-2003, 10:05 PM | #6 |
no you dont need anything else but the editor... here is how u do it exactly: in condition, pick Item-Type comparison then click on (Item-Type of (last created item), a new window will appear, then click on "Last created item" then change it to item carried by hero. |
