As the title implies, I want a trigger to use an item, or at least pretend to use an item. I got the trigger set up fine, ability w/ dummy effect triggering it, all that good stuff, along with a working Healing Potion w/ 5 charges. Additionally I have arrays constantly getting updated w/ item names (strings) to keep a very close eye on what is in the inventory at any time.
Issue I'm having is, how do I get a trigger to use an item. Found an action "Add Charge Used For Unit", which I'm guessing is close, but I'm not exactly clear how to use the function. For unit I'm pretty sure I'll have to use Pick each unit in (All items carried by (Triggering unit)), and do some conditions of item container, item slot, etc from there, which isn't a problem. Amount of charges to add will obviously be 1.
What is completely throwing me is the string field, have no idea what it wants here.
The inventory ability has two commands to use items "Item Use (Instant)" and "Item Use (Target)". You can issue an order to your unit to use those ability commands.
However you have to include the item you want to use into the order before. You can do this via custom script using the function "OrderSetTargetItem(order,item)".
Found a solution to my problem, well at least kind of. It doesn't exactly use the unit, it simply removes the charges and if charges == 0 it removes the item. The String I was looking for was under Effect Cost:Charge:Link, which was Item/HealingPotion. I would be curious to know more about what you were talking about though Talon. I haven't bothered to put a healing effect in yet, but that is relatively simple. Will have to go through a somewhat messy case statement when I add more potions, but only predict about a dozen potions/scrolls will even exist, so not too bad at all.
Leaving a screenshot of the trigger as it is for any interested. It is obviously only checking the first slot, you'll likely want to make it check through your entire bag.
ATTACHMENTS
PotionUser.jpg
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
As the title implies, I want a trigger to use an item, or at least pretend to use an item. I got the trigger set up fine, ability w/ dummy effect triggering it, all that good stuff, along with a working Healing Potion w/ 5 charges. Additionally I have arrays constantly getting updated w/ item names (strings) to keep a very close eye on what is in the inventory at any time.
Issue I'm having is, how do I get a trigger to use an item. Found an action "Add Charge Used For Unit", which I'm guessing is close, but I'm not exactly clear how to use the function. For unit I'm pretty sure I'll have to use Pick each unit in (All items carried by (Triggering unit)), and do some conditions of item container, item slot, etc from there, which isn't a problem. Amount of charges to add will obviously be 1.
What is completely throwing me is the string field, have no idea what it wants here.
The inventory ability has two commands to use items "Item Use (Instant)" and "Item Use (Target)". You can issue an order to your unit to use those ability commands. However you have to include the item you want to use into the order before. You can do this via custom script using the function "OrderSetTargetItem(order,item)".
@Talon0815: Go
Found a solution to my problem, well at least kind of. It doesn't exactly use the unit, it simply removes the charges and if charges == 0 it removes the item. The String I was looking for was under Effect Cost:Charge:Link, which was Item/HealingPotion. I would be curious to know more about what you were talking about though Talon. I haven't bothered to put a healing effect in yet, but that is relatively simple. Will have to go through a somewhat messy case statement when I add more potions, but only predict about a dozen potions/scrolls will even exist, so not too bad at all.
Leaving a screenshot of the trigger as it is for any interested. It is obviously only checking the first slot, you'll likely want to make it check through your entire bag.