Hi all... looking for some help or thoughts / idea.
Basically, i want to be able to prevent one unit from being able to give an item from that units inventory to another unit.
Especially where the two unit owners are Allies, i want to prevent player 1 (unit A) giving items from unit A's inventory to Player 2 (unit B).
I'm trying this in triggers:
I detect an Inventory manipulation event (Any Unit Gives Any Item) and then check the target unit.
If the owner of the target unit is NOT the same as the source unit, i want to cancel the event - ie: give of item should fail.
Issues: I dont know how to cancel the event (is this even possible).
I would be happy if i could just change the target unit.
Can i do this in triggers?
Alternatively can i do it with data ? if so ... any pointers as to how would be appreciated.
you could allow only player units ( the ownership of the items itself) for the inventory. depends on your setup, can you tell us more about the item system. you wouldn't be able to pickup neutral items anymore.
The only issue with that is that it Removes the inventory item. Ideally I'd want to drop it on the ground, rather than remove it. I can work out how to sell the item.... lets see if i can find a way to drop it instead...
OK, so further experiment ... what i actually am pleased with is if the item just drops to the ground, instead of going into the targets inventory. This is achieved like this:
Hi all... looking for some help or thoughts / idea.
Basically, i want to be able to prevent one unit from being able to give an item from that units inventory to another unit. Especially where the two unit owners are Allies, i want to prevent player 1 (unit A) giving items from unit A's inventory to Player 2 (unit B).
I'm trying this in triggers: I detect an Inventory manipulation event (Any Unit Gives Any Item) and then check the target unit. If the owner of the target unit is NOT the same as the source unit, i want to cancel the event - ie: give of item should fail.
Issues: I dont know how to cancel the event (is this even possible). I would be happy if i could just change the target unit.
Can i do this in triggers? Alternatively can i do it with data ? if so ... any pointers as to how would be appreciated.
Thanks in advance.
Does Issue Order Stop command not work?
you could allow only player units ( the ownership of the items itself) for the inventory. depends on your setup, can you tell us more about the item system. you wouldn't be able to pickup neutral items anymore.
@FunkyUserName: Go
Let me just try it ... ... i figured i was probably missing something obvious ...
Ummm.... No. Order Stop does not work ... Experimenting.
I can mostly get what i want like this:
The only issue with that is that it Removes the inventory item. Ideally I'd want to drop it on the ground, rather than remove it. I can work out how to sell the item.... lets see if i can find a way to drop it instead...
OK, so further experiment ... what i actually am pleased with is if the item just drops to the ground, instead of going into the targets inventory. This is achieved like this: