Login

russian armor

How prevent buffs stacking?

4 Jul 2017, 14:46 PM
#1
avatar of Mekidon

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
avatar of Mr.Smith

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?
1 user is browsing this thread: 1 guest

Livestreams

Germany 49
unknown 35
United States 1

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

795 users are online: 795 guests
0 post in the last 24h
5 posts in the last week
33 posts in the last month
Registered members: 49141
Welcome our newest member, igryskoj24
Most online: 2043 users on 29 Oct 2023, 01:04 AM