I have a potion and a hero. My hero picks the potion up. He finds a second one and picks that up too. He now has 2 potions and in the inventory pane, they stack.
The hero pawns the potions. Upon sale, he gets the value of ONE potion using the standard pawn ability.
So I turned to triggers. However the same problem arises. I can't seem to get how many charges a particular inventory item contains.
TL;DR Inventory items with charges don't seem to sell for the correct amount. Can you fetch the charge count with triggers somehow?
Unfortunately I don't have a working example in GUI, but here's some sample galaxy for such a function. Note that you need to reference the item's charge link, under the item's Effect Cost.
Whoops- I remember now- my map's items had initial charges of 99 (so 99 - Charges Used = Charges Remaining). For whatever reason you can get charges spent, but not charges remaining.
Nope, it's code copy/pasted from rogue star that I had on hand. It could be modified with catalog functions to be more general, but I figured Tya didn't need so much hand holding :P
If you give all items the same charge link you can do it with a single function call. As pure items there is no need for separate charge links anyway (they might be useful for equip able units that can use the charges separately).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a potion and a hero. My hero picks the potion up. He finds a second one and picks that up too. He now has 2 potions and in the inventory pane, they stack.
The hero pawns the potions. Upon sale, he gets the value of ONE potion using the standard pawn ability.
So I turned to triggers. However the same problem arises. I can't seem to get how many charges a particular inventory item contains.
TL;DR Inventory items with charges don't seem to sell for the correct amount. Can you fetch the charge count with triggers somehow?
Unfortunately I don't have a working example in GUI, but here's some sample galaxy for such a function. Note that you need to reference the item's charge link, under the item's Effect Cost.
@PirateArcade | I make games | Ask me things on Discord
@greythepirate: Go
that's really not a general purpose action to get the item charge count for any item of any type
there are item libraries here on mapster, just check them out.
@greythepirate: Go
Looks like this returns how many charges were spent, but I'll see if it'll work anyway!
@TyaArcade: Go
Whoops- I remember now- my map's items had initial charges of 99 (so 99 - Charges Used = Charges Remaining). For whatever reason you can get charges spent, but not charges remaining.
@FunkyUserName: Go
Nope, it's code copy/pasted from rogue star that I had on hand. It could be modified with catalog functions to be more general, but I figured Tya didn't need so much hand holding :P
@PirateArcade | I make games | Ask me things on Discord
If you give all items the same charge link you can do it with a single function call. As pure items there is no need for separate charge links anyway (they might be useful for equip able units that can use the charges separately).