Can't find a thread on this so here it is. After using the trigger to consume a newly created inventory item, everytime the item is used, instead of using another charge, it resets to its original charge size.
Anyone any ideas? The function used is Add <number> use charge <charge link> on unit <Last created inventory item>
I used a trigger to create an inventory item in a unit. Originally the item has 3 charge, I wanted it only to have 1, so I used a built-in function to consume 2 charges, so all's left is 1 charge. But in-game, when I use this 1 charge item, the item resets to 3 instead of being consumed as it should.
So my question is what when wrong and how to fix it?
Do you need the three charges on the item at any point? Otherwise you can just set the charge count in the Data Editor to 1.
It sounds a bit like you're using the function "Remove Charge Used For Unit", where instead you should be using "Add Charge Used For Unit". Also, check that the Charge Regen Time is 0 or -1 in the Data Editor, whichever number indicates that the charges should not regenerate.
I found the fix. If the item's charge max count is equal to its start count, then it will reset to its start/max count if you use the trigger to consume the charges. So it's a matter of changing the max/start to different values to each other.
So the next question is, is this a bug? Can someone confirm this?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Can't find a thread on this so here it is. After using the trigger to consume a newly created inventory item, everytime the item is used, instead of using another charge, it resets to its original charge size.
Anyone any ideas? The function used is Add <number> use charge <charge link> on unit <Last created inventory item>
bump
@EarendilSphere: Go
I'm not even sure there is a question in those fine sentences you wrote. Can you be more descriptive? Use examples and such. :)
@Kafoso: Go
Okay.
I used a trigger to create an inventory item in a unit. Originally the item has 3 charge, I wanted it only to have 1, so I used a built-in function to consume 2 charges, so all's left is 1 charge. But in-game, when I use this 1 charge item, the item resets to 3 instead of being consumed as it should.
So my question is what when wrong and how to fix it?
@EarendilSphere: Go
Do you need the three charges on the item at any point? Otherwise you can just set the charge count in the Data Editor to 1.
It sounds a bit like you're using the function "Remove Charge Used For Unit", where instead you should be using "Add Charge Used For Unit". Also, check that the Charge Regen Time is 0 or -1 in the Data Editor, whichever number indicates that the charges should not regenerate.
@Kafoso: Go
No I was using 'Add Charge Used for Unit.' Yes the charge count of 3 is needed...
@EarendilSphere: Go
bump
I found the fix. If the item's charge max count is equal to its start count, then it will reset to its start/max count if you use the trigger to consume the charges. So it's a matter of changing the max/start to different values to each other.
So the next question is, is this a bug? Can someone confirm this?