Login

russian armor

Recoup Losses doesn't work if unit becomes casualty

17 Jan 2021, 21:55 PM
#1
avatar of Olekman
Modmaker Badge

Posts: 208

Player doesn't receive 20 mp when Recoup Losses is active if infantry model becomes a crawling casualty instead of dying.

Reason:
Short answer:
In Company of Heroes you don't always die when you are killed.

Long answer:
Theoretically, whenever an infantry entity dies, its death_actions should trigger. Recoup Losses adds "recoup_losses_active" to all infantry entities and all the affected entities have requirement action in their death_actions that checks for that upgrade. If it's present, the player gets +20 mp. Problem happens when instead of dying, the entity becomes a casualty. It seemingly doesn't trigger death_actions. Casualty dying (either by themselves or enemy) doesn't trigger them either. Or maybe casualties don't have death_actions at all or aren't even defined as entities? Honestly, I have no idea. Maybe some more experienced modders could chime in.

Gameplay-wise it has pretty considerable impact. "make_casualty" critical has weight of 25 and is applicable to all weapon types except flame. Simply put, roughly 25% of the time when an infantry model dies with Recoup Losses active, OKW gets no Manpower.

Solution: I tried adding modify_resources action in "make_casualty" critical, thinking that if you don't get +20 mp on death_actions then you could get it when "make_casualty" is triggered. For some unexplained reason, this causes the +20 mp to trigger twice when entity becomes a casualty. Removing the modify resources action from death_actions altogether and adding them to all involved criticals causes same problem. In my humble opinion, casualties are magical.

Instead, I modified "make_casualty" to check for "recoup_loses_active" upgrade on entity. If it isn't present, then make them a casualty as usual. If it is present, the make them dead instead.

It's a very simple fix that guarantees that player receives +20 mp every time an infantry entity dies when the ability is active. This of course comes with a side effect of OKW's infantry always dying instead of becoming casualties when Recoup Losses is active. I think it's a small price to pay for consistency, considering how no Allied ability directly interacts with casualties (like Wehrmacht's casualty interrogation).

Video evidence of bug:
Instead of receiving back 300 mp (20 mp times 15 Volksgrenadiers), I received only 160 mp (which shows just how bad my RNG can be). This test is easy to replicate and I encourage others to try it.


Mod with solution:
https://drive.google.com/file/d/1VcMdcyGTLtsmzGt3d8O70-d3PbIQmmeS/view?usp=sharing

17 Jan 2021, 22:10 PM
#2
avatar of Vipper

Posts: 13476 | Subs: 1

18 Jan 2021, 01:38 AM
#3
avatar of zerocoh

Posts: 930

wait, is this ability coming back?!
if not, who cares?
18 Jan 2021, 06:29 AM
#4
avatar of Olekman
Modmaker Badge

Posts: 208

My mistake, I posted this in Bugs instead of Modding forums. I'll ask a mod to move the thread.
MMX
18 Jan 2021, 06:43 AM
#5
avatar of MMX

Posts: 999 | Subs: 1

jump backJump back to quoted post18 Jan 2021, 01:38 AMzerocoh
wait, is this ability coming back?!
if not, who cares?


well, i do. as do a lot of modders i'd assume, so thanks Olekman not only for the discovery, but also for providing a solution for the problem!

IIRC a comeback of the ability isn't too unlikely, either, as quite a lot of people advocated for replacing rapid conscription and other similar abilities with some clone of recoup losses. probably not in this patch, but maybe in a future Commander revamp... time will tell.
18 Jan 2021, 06:50 AM
#6
avatar of Olekman
Modmaker Badge

Posts: 208

jump backJump back to quoted post18 Jan 2021, 06:43 AMMMX


well, i do. as do a lot of modders i'd assume, so thanks Olekman not only for the discovery, but also for providing a solution for the problem!

IIRC a comeback of the ability isn't too unlikely, either, as quite a lot of people advocated for replacing rapid conscription and other similar abilities with some clone of recoup losses. probably not in this patch, but maybe in a future Commander revamp... time will tell.


That's actually one of the reasons why I looked into it. Sander93 mentioned in his personal balance thread that he would like to replace Rapid Conscription and Relief Infantry with Recoup Losses mechanics. Plus, I was working on my own rework of Rapid Conscription and it shares some mechanics with Recoup Losses, so naturally this bug came up on my radar.
MMX
18 Jan 2021, 07:44 AM
#7
avatar of MMX

Posts: 999 | Subs: 1

Yeah, I've always preferred the RC mechanic over that of getting a free squad, especially during the later stages of the game where unvetted cons or osttruppen are more a bane than a boon to your unit composition. Really wouldn't mind to see it coming back eventually...
1 user is browsing this thread: 1 guest

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

331 users are online: 1 member and 330 guests
juancitox
17 posts in the last 24h
44 posts in the last week
100 posts in the last month
Registered members: 44647
Welcome our newest member, Vassarh9
Most online: 2043 users on 29 Oct 2023, 01:04 AM