I created an item with a "carry behaviour" - this behaviour (type Buff) grants a "vital max bonus" and a "vital regeneration bonus" for the shield. This works fine - with the item in your inventory your shield is buffed by the setted amount of shield.
But there is an issue: when your shield get damaged and you just flip the item from one inventory slot to another your shield is filled to max.
It is a bug with any buff that increases the max vital. Short of using a damage/modify unit effect equal to the amount added I cannot think of a way. Even Tosh had the issue.
What do you mean by a damage/modify unit effect? If I use an effect to modify the unit, wont it add the set amount every single time the item is taken?
I was having this same issue and came up with a rather simple trigger to bypass the issue. I use two item containers: inventory and equipment. Shields have their own item class "Shields". Inventory can hold any item, but has "equip" disabled for all slots. The equipment menu only has one space for item class "shields", so the trigger just detects if anything is going on there and sets shields to 0. Shields will instantly start regenerating from this point on, ignoring the shield recharge delay (which I preferred). If you wanted the delay you could probably use a damage effect action that deals like .01 damage or something unnoticeable.
In your case you may want to check for the item class instead, since there is no specific slot for the item. This gets a little more complex because you need to use catalog functions. Catalog functions simply pull values from the data editor. You have to jump through a few hoops to get the item class, because the game uses the items "unit" and not the item directly.
Adjust to what you require. There is no trading in my game, nor picking up items from the ground, so the events like "receives" or "picks up" may be also needed. Some shun triggers for things that can be accomplished in the data editor, but I preferred this method over attempting to apply damaging effects to units.
Edit: After reading more carefully this approach will probably not be good for you... I use a Halo/Borderlands type shield system (fast recharge with a delay), so this approach may not be ideal if you don't want to set the shields to 0 on swap. More could be done to get the items behavior and check the max vital of shields, subtracting from the units current shields, but its a complex approach that I won't get into unless you necessarily wanted to take that route.
hm yes as you pointed out in your edit, thats not the exact way I want this to work.
Best would be: when gaining the item the shield max-value is simply modified by the additional amount - passing the item to another slot shouldnt change anything.
I dont really get what you mean by the alternative approach you mention in your edit though. Dont thought that it would be such an complex theme. :-D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
I created an item with a "carry behaviour" - this behaviour (type Buff) grants a "vital max bonus" and a "vital regeneration bonus" for the shield. This works fine - with the item in your inventory your shield is buffed by the setted amount of shield.
But there is an issue: when your shield get damaged and you just flip the item from one inventory slot to another your shield is filled to max.
What can I do to stop this bug?
It is a bug with any buff that increases the max vital. Short of using a damage/modify unit effect equal to the amount added I cannot think of a way. Even Tosh had the issue.
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
What do you mean by a damage/modify unit effect? If I use an effect to modify the unit, wont it add the set amount every single time the item is taken?
It can remove the amount. The add max vit keeps the same vital delta value when adding but only removes the max when removed resulting in healing.
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
I was having this same issue and came up with a rather simple trigger to bypass the issue. I use two item containers: inventory and equipment. Shields have their own item class "Shields". Inventory can hold any item, but has "equip" disabled for all slots. The equipment menu only has one space for item class "shields", so the trigger just detects if anything is going on there and sets shields to 0. Shields will instantly start regenerating from this point on, ignoring the shield recharge delay (which I preferred). If you wanted the delay you could probably use a damage effect action that deals like .01 damage or something unnoticeable.
In your case you may want to check for the item class instead, since there is no specific slot for the item. This gets a little more complex because you need to use catalog functions. Catalog functions simply pull values from the data editor. You have to jump through a few hoops to get the item class, because the game uses the items "unit" and not the item directly.
Adjust to what you require. There is no trading in my game, nor picking up items from the ground, so the events like "receives" or "picks up" may be also needed. Some shun triggers for things that can be accomplished in the data editor, but I preferred this method over attempting to apply damaging effects to units.
Edit: After reading more carefully this approach will probably not be good for you... I use a Halo/Borderlands type shield system (fast recharge with a delay), so this approach may not be ideal if you don't want to set the shields to 0 on swap. More could be done to get the items behavior and check the max vital of shields, subtracting from the units current shields, but its a complex approach that I won't get into unless you necessarily wanted to take that route.
hm yes as you pointed out in your edit, thats not the exact way I want this to work.
Best would be: when gaining the item the shield max-value is simply modified by the additional amount - passing the item to another slot shouldnt change anything. I dont really get what you mean by the alternative approach you mention in your edit though. Dont thought that it would be such an complex theme. :-D