Im trying to make a shield via items. The shield has a finite set of charges. You can buy more at the shop.
The shield will activate when you are taking deadly amounts of damage.
I have tried to make a dummy effect and an ability and reduce number of charges via an effect, but the item still stands untouched in my inventory.
I have tried to use the behaviour charges, but it seems it has no effect on the item.
How would you go about doing such a item?
Anything i might be doing wrong?
The Behavior has a field called "Damage Response". There you can tell the behavior to activate and effect (activating your shield behavior) whenever life gets a point.
Ive put all charges located to the player, and the item itself as in your example.
First item i pick up (or buy) begins a new shield item. The next one just dissapears?...
If i put the items on the ground again, only one remain and as i pick it up again, theres only one charge of the item left.
If i instead put 3 charges to start with, you can take fatal damage three times, but any new shield will not increase the amount of charges...?
Not picking any new up either.
Furthermore, shields in the inventory does not stack, instead they start new shields all the time. If i have max 5 shields, and start and use 1, every new shield i buy starts a new shield.
My conclusion:
It seems they dont "stack" appropriately, and that all charges, no matter how many you get "is taken" from the same place, and is unrenewable.
Any idea what might be wrong? Im sorry to bother the forum with these questions, very thankfull for all your help FunkyUserName!
Have the items use an autocast behaviour in response to a buff applied by the damage response that removes the buff using a charge. The item breaks when all charges are removed. Then have the damage response use a Unit Inventory Contains Item validator.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Im trying to make a shield via items. The shield has a finite set of charges. You can buy more at the shop. The shield will activate when you are taking deadly amounts of damage.
I have tried to make a dummy effect and an ability and reduce number of charges via an effect, but the item still stands untouched in my inventory. I have tried to use the behaviour charges, but it seems it has no effect on the item.
How would you go about doing such a item? Anything i might be doing wrong?
The Behavior has a field called "Damage Response". There you can tell the behavior to activate and effect (activating your shield behavior) whenever life gets a point.
@TheSC2Maniac: Go
Yeah. I have crossed in fatal and all that :) Its not the problem.
The problem seems to be to match the amount of damage responses to the amount of charges in the item.
So if i buy three shields, i want it to activate no less or more than three times.
The damage response itself is done, but usually i either
1) Have to activate the ability myself (not what i want)
2) Its unlimited, cause the modify unit (to take away charges) does not seem to work on the item itself.
3) Behaviour charges leaves the item untouched, giving me unlimited amounts of damage responses.
@Sendlirn: Go
No idea then, sorry. I thought that was the problem.
Try asking DrSuperEvil
@Sendlirn: Go
i don't do this for free. i expect at least a "like"
@FunkyUserName: Go
Nice system! The problem seems to be that once the charges are used, they do not seem to refresh when buying new shields.
But otherwise it works as intended. As said, will give you credit :)
@Sendlirn: Go
Is there any other sollution? A work around with a dummy ability?
@Sendlirn: Go
aslong as there are charges you can buy some and it adds to the charges but once it is empty it doesn't?
@FunkyUserName: Go
Ive put all charges located to the player, and the item itself as in your example.
First item i pick up (or buy) begins a new shield item. The next one just dissapears?...
If i put the items on the ground again, only one remain and as i pick it up again, theres only one charge of the item left.
If i instead put 3 charges to start with, you can take fatal damage three times, but any new shield will not increase the amount of charges...?
Not picking any new up either.
Furthermore, shields in the inventory does not stack, instead they start new shields all the time. If i have max 5 shields, and start and use 1, every new shield i buy starts a new shield.
My conclusion: It seems they dont "stack" appropriately, and that all charges, no matter how many you get "is taken" from the same place, and is unrenewable.
Any idea what might be wrong? Im sorry to bother the forum with these questions, very thankfull for all your help FunkyUserName!
Have the items use an autocast behaviour in response to a buff applied by the damage response that removes the buff using a charge. The item breaks when all charges are removed. Then have the damage response use a Unit Inventory Contains Item validator.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg