I recently ran into somewhat of a wall while triggering. In one trigger, if a unit enters a region and has a specific item, the trigger will do stuff. However, I can't find a way to create a condition that will check to see if the unit will have the item in any inventory slot. Is there a simple way to do that?
edit: My current workaround was to give each item a dummy behavior and have the condition check to see if that behavior exists
second edit: How do I get the game to remove a specific inventory item?
use a check on unit groups, units in unit group meet condition. the unit group is Unit - items beared by unit (unit is your hero) and the other condtions have a check for unit type.
this also answers your 2nd question. you take unit 1 of unitgroup (same as above)
BarrelofAleEventsUnit-AnyUnitEntersAleRegionLocalVariablesConditions(Unittypeof(Triggeringunit))==Ship-Smuggler-Unit((Triggeringunit)hasAleContract)==True((Triggeringunit)hasAle)==FalseActionsUnit-CreateoneAleitemintheinventoryof(Triggeringunit)UnitGroup-Add(Lastcreatedinventoryitem)toTraderItemUI-Display"You have picked up a barrel of ale!..."for(Playergroup((Triggeringplayer)))toSubtitlearea
Will this work with multiple smuggler or will it erase the item (Ale) for other smugglers if one of them turns it in first? Trader Item is a global variable for a unit group. The trigger adds the created inventory item to the Trader Item unit group. When the smuggler reaches a specific region, a new trigger picks every unit in Trader Group and removes it.
edit: did some tests. This current trigger will remove items for all players carrying that item (ale) if one of them turns it in first. What can I do to avoid that?
I recently ran into somewhat of a wall while triggering. In one trigger, if a unit enters a region and has a specific item, the trigger will do stuff. However, I can't find a way to create a condition that will check to see if the unit will have the item in any inventory slot. Is there a simple way to do that?
edit: My current workaround was to give each item a dummy behavior and have the condition check to see if that behavior exists
second edit: How do I get the game to remove a specific inventory item?
@Stormahawk: Go
use a check on unit groups, units in unit group meet condition. the unit group is Unit - items beared by unit (unit is your hero) and the other condtions have a check for unit type.
this also answers your 2nd question. you take unit 1 of unitgroup (same as above)
@FunkyUserName: Go
Can you give an example?
Here is what I have so far:
And the response trigger:
Will this work with multiple smuggler or will it erase the item (Ale) for other smugglers if one of them turns it in first? Trader Item is a global variable for a unit group. The trigger adds the created inventory item to the Trader Item unit group. When the smuggler reaches a specific region, a new trigger picks every unit in Trader Group and removes it.
edit: did some tests. This current trigger will remove items for all players carrying that item (ale) if one of them turns it in first. What can I do to avoid that?
here
Thanks! That helped a lot. I was able to resolve the issue.