- Joined
- Oct 14, 2005
- Messages
- 37
In my map, I want to have an item such that when you 'use' a charge of the item, it instead drops an item of that type with one charge next to the hero OR if there is already an item of that type close to the hero, adds a charge to the pre-existing item. I already have a trigger that when you pick up an item, it adds to the charges of one you already have, so in theory this should be a zero-sum system - 'dropping' and picking up the item in any combination should result in the same number of charges existing.
However, my trigger for 'dropping' the item doesn't work correctly - it adds a charge to EVERY item of that type near the hero, and drops a new item regardless, for a net increase in the number of item charges. Here is the text of my trigger:
Item Uncombine Hydra Scale
Events
A unit Uses An item
Conditions
[Item-type of [Item being manipulated]] Equal to Hydra Scale
Actions
Item - Pick every item in [Region centered at [Position of [Hero manipulating item]] with size [256.00, 256.00]] and do [Actions]
Loop - Actions
If [All Conditions are True] then do [Then actions] else do [Else actions]
If - Conditions
Item-type of [Picked item] Equal to Hydra Scale
[[Picked item] is Owned] Not equal to True
Then - Actions
Item - Set charges remaining in [Picked Item] to [[Charges remaining in [Picked item]] + 1]
Skip remaining actions
Else - Actions (None)
Item - Create Hydra Scale at [Position of [Hero manipulating item]
As best as I can figure the Skip remaining actions command is not being implemented. Is there a better way to do this, or at least a way to fix this without using a boolean variable to stop iterating and create the item?
However, my trigger for 'dropping' the item doesn't work correctly - it adds a charge to EVERY item of that type near the hero, and drops a new item regardless, for a net increase in the number of item charges. Here is the text of my trigger:
Item Uncombine Hydra Scale
Events
A unit Uses An item
Conditions
[Item-type of [Item being manipulated]] Equal to Hydra Scale
Actions
Item - Pick every item in [Region centered at [Position of [Hero manipulating item]] with size [256.00, 256.00]] and do [Actions]
Loop - Actions
If [All Conditions are True] then do [Then actions] else do [Else actions]
If - Conditions
Item-type of [Picked item] Equal to Hydra Scale
[[Picked item] is Owned] Not equal to True
Then - Actions
Item - Set charges remaining in [Picked Item] to [[Charges remaining in [Picked item]] + 1]
Skip remaining actions
Else - Actions (None)
Item - Create Hydra Scale at [Position of [Hero manipulating item]
As best as I can figure the Skip remaining actions command is not being implemented. Is there a better way to do this, or at least a way to fix this without using a boolean variable to stop iterating and create the item?