So after much confusion on the best way to set up a tome (attribute) system, I've determined the best way to do so is to have the item instantly consumed by the hero when bought. This (I'm told) is done in triggers.
MY CURRENT SETUP:
I have a shop with abilities that let my hero interact and buy from it. The tomes are items, linked to units, which the shop uses the "train" ability type to create these items and place in my hero's inventory. I need this item to be instantly consumed (since stacking is apparently near to impossible with this editor) and on consumption, I want the corresponding attribute of my hero to increase.
MY PROBLEM:
I don't know which triggers to use. I've messed with it for a while now and I can't seem to get it working. ALSO, from what I've seen, the triggers which appear to be right, only return the unit actually creating the item, which is the shop.. So even if I got it to work, it would increase the shops attribute by 1.. which clearly isn't right...
Help?
Assuming your heroes have an inventory bag that can hold said tomes, I would use an 'Any unit gets item/receives item event', then do a pick each unit in triggering unit's inventory, then scan for said items, then add your attributes/remove item from their inventory from there.
I should add that attributes are rather fickle when used with things other than veterancy, invisible buffs tend to work better.
Yeah I have the veterancy attributes done perfectly, but I really need this shop system to work! Also, I'm looking in the triggers and there is no such event "unit gets or receives item". Or am I missing something? I feel like I am missing something because on this forum, everyone posts triggers in program editing format (which I'm quite familiar with programming), but in my editor, it only has the usual table view... This might sound really silly but I am brand new to this forum/editor so I suppose no harm in asking lol
If it counted how many tomes were in someones inventory every time the ability was used, wouldn't it increase everyone's attributes by what they already have every time someone buys something new?
If it counted how many tomes were in someones inventory every time the ability was used, wouldn't it increase everyone's attributes by what they already have every time someone buys something new?
Not if the tomes are removed immediately after they are bought. The ability being used is the one required to buy the item, not an ability on the tome itself. You should be able to destroy an item directly in a unit's inventory. If that's not possible, you can always order the unit to drop the item, then destroy it.
So after much confusion on the best way to set up a tome (attribute) system, I've determined the best way to do so is to have the item instantly consumed by the hero when bought. This (I'm told) is done in triggers. MY CURRENT SETUP: I have a shop with abilities that let my hero interact and buy from it. The tomes are items, linked to units, which the shop uses the "train" ability type to create these items and place in my hero's inventory. I need this item to be instantly consumed (since stacking is apparently near to impossible with this editor) and on consumption, I want the corresponding attribute of my hero to increase. MY PROBLEM: I don't know which triggers to use. I've messed with it for a while now and I can't seem to get it working. ALSO, from what I've seen, the triggers which appear to be right, only return the unit actually creating the item, which is the shop.. So even if I got it to work, it would increase the shops attribute by 1.. which clearly isn't right... Help?
@nickthegreat2468: Go
Assuming your heroes have an inventory bag that can hold said tomes, I would use an 'Any unit gets item/receives item event', then do a pick each unit in triggering unit's inventory, then scan for said items, then add your attributes/remove item from their inventory from there.
I should add that attributes are rather fickle when used with things other than veterancy, invisible buffs tend to work better.
For tomes you could also use an Ability Is Used event, then enumerate the map to find which units have tomes in their inventories.
@Deadzergling: Go
Yeah I have the veterancy attributes done perfectly, but I really need this shop system to work! Also, I'm looking in the triggers and there is no such event "unit gets or receives item". Or am I missing something? I feel like I am missing something because on this forum, everyone posts triggers in program editing format (which I'm quite familiar with programming), but in my editor, it only has the usual table view... This might sound really silly but I am brand new to this forum/editor so I suppose no harm in asking lol
@BasharTeg: Go
If it counted how many tomes were in someones inventory every time the ability was used, wouldn't it increase everyone's attributes by what they already have every time someone buys something new?
Not if the tomes are removed immediately after they are bought. The ability being used is the one required to buy the item, not an ability on the tome itself. You should be able to destroy an item directly in a unit's inventory. If that's not possible, you can always order the unit to drop the item, then destroy it.