How prevent buffs stacking?
4 Jul 2017, 14:46 PM
#1
Posts: 1
Hello. I'm trying to add a possibility to change posture of infantry and let squad additional bonuses depend on it, such as better accuracy, recieve accuracy etc. At the moment i have two toggle abilities to responsible for position of squad based on the "hit the dirt" conscript ability.[1] It's my understanding why these abilities is active the entities gets buffs from both abilities.[2] I would like how disable a buffs from abilities when another abilities was toggle like a change posture crouch for posture prone. Would be ostruppen's accuracy modifier stacks with the same modifier from my abbility if my modifier's value is 1,5?[3] Maybe exist the way which allow to display some info about that at game directly? And someways the posture_crouch_modifier apply not to all model of squad. Sometimes only one grenadier sit down like at the picture, sometimes more or all, whilst every model of conscript squad do it every times only.[4] Is it possible to change this? Thanks.
10 Jul 2017, 11:49 AM
#2
Posts: 2636 | Subs: 17
The way to prevent buffs stacking is to use the "exclusive" flag on the apply_modifier_action AND (this is very important) set a unique modifier_id for your accuracy modifier*.
Say, you have 2 auras that give accuracy modifiers. Aura A is supposed to give +20% accuracy, whereas Aura B is supposed to give +50% accuracy
What you want is:
- If the unit is not under either aura, it shouldn't receive extra accuracy
- If the unit is under Aura A but not Aura B, it should get +20% accuracy
- If the unit is under Aura B but not Aura A, it should get +50% accuracy
- If the unit us under both auras at the same time, it should get +50% accuracy (i.e., the auras shouldn't stack).
The way to implement this is...
For Aura A:
- Set accuracy multiplier to 1.2
- Set modifier_id to "my_mod_aura_a_modifier" (the name just has to be unique)
- Set exclusive to True
For Aura B:
We break the modifier into two parts; one that gives "Aura A" stuff (i.e., 1.2 accuracy), and one that gives the "remainder" (i.e., 1.5/1.2 = 1.25)
Therefore:
- Set accuracy modifier to 1.2 with id "my_mod_aura_a_modifier" and exclusive to True
- Set an additional accuracy modifier to 1.25 with id "my_mod_aura_b_modifier" and exclusive also set to True
Live version has a similar way of applying modifiers like this, e.g., for heavy engine damage when the vehicle gets abandoned (look for the critical). Before we fixed the bug, heavy engine damage would not always apply the correct speed debuff.
* If you set exclusive to "True" but do not set a modifier_id, then the accuracy modifier will overwrite all other modifiers (e.g.., veterancy values); this is not what you want.
PS: I've no experience with posture crouch modifier; maybe you need to change_target_action -> entities?
Say, you have 2 auras that give accuracy modifiers. Aura A is supposed to give +20% accuracy, whereas Aura B is supposed to give +50% accuracy
What you want is:
- If the unit is not under either aura, it shouldn't receive extra accuracy
- If the unit is under Aura A but not Aura B, it should get +20% accuracy
- If the unit is under Aura B but not Aura A, it should get +50% accuracy
- If the unit us under both auras at the same time, it should get +50% accuracy (i.e., the auras shouldn't stack).
The way to implement this is...
For Aura A:
- Set accuracy multiplier to 1.2
- Set modifier_id to "my_mod_aura_a_modifier" (the name just has to be unique)
- Set exclusive to True
For Aura B:
We break the modifier into two parts; one that gives "Aura A" stuff (i.e., 1.2 accuracy), and one that gives the "remainder" (i.e., 1.5/1.2 = 1.25)
Therefore:
- Set accuracy modifier to 1.2 with id "my_mod_aura_a_modifier" and exclusive to True
- Set an additional accuracy modifier to 1.25 with id "my_mod_aura_b_modifier" and exclusive also set to True
Live version has a similar way of applying modifiers like this, e.g., for heavy engine damage when the vehicle gets abandoned (look for the critical). Before we fixed the bug, heavy engine damage would not always apply the correct speed debuff.
* If you set exclusive to "True" but do not set a modifier_id, then the accuracy modifier will overwrite all other modifiers (e.g.., veterancy values); this is not what you want.
PS: I've no experience with posture crouch modifier; maybe you need to change_target_action -> entities?
PAGES (1)
1 user is browsing this thread:
1 guest
Livestreams
19 | |||||
6 | |||||
2 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.600215.736+15
- 3.34957.860+14
- 4.1107614.643+8
- 5.305114.728+1
- 6.916405.693-2
- 7.273108.717+24
- 8.722440.621+4
- 9.1041674.607-2
- 10.17146.788+1
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1234
Board Info
745 users are online:
745 guests
0 post in the last 24h
8 posts in the last week
37 posts in the last month
8 posts in the last week
37 posts in the last month
Registered members: 49100
Welcome our newest member, Modarov
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, Modarov
Most online: 2043 users on 29 Oct 2023, 01:04 AM