Login

russian armor

How to check how many soldiers of a blueprint died

8 Jun 2019, 13:02 PM
#1
avatar of de111de

Posts: 17

I have a little question: what I want to do is to check how many soldiers (individual soldiers, not whole squads) of a certain type and player died. Basically I want to reverse the function Stats_UnitSoldierKills which checks how many soldiers have been killed by an sbp, but I want to check how many soldiers of an ebp have been killed. Can anyone tell me how to write such a function or tell where to find Stats_UnitSoldierKills in the data.sga archive so can have a look at it?
8 Jun 2019, 15:52 PM
#2
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

Unfortunately, I believe this to be impossible. The Stats_* functions are C functions exposed to Lua, so there's no way to "find" the function to look at it - and even if you could, you can't modify the C code, anyways.

There are a few undocumented functions, but they do not provide anything more than what the others already do. But, they might be useful in other ways:

Stats_BeginBalanceStatsDump(string filename)
Creates a .csv file in /LogFiles that looks like: gamestats-<filename>-01260.2019-06-08.10-20-01.csv; it starts out blank.

Stats_BalancePrint(string row)
If a balance stats dump has begun, prints a row to the current file.

Stats_EndBalanceStatsDump()
Closes the current file for a balance stats dump.

Stats_DumpFramesToDisk(string ?)
I haven't been able to figure this one out, yet. All I know is that it only takes a string. Maybe filename?

Stats_GetScenarioName()
Returns the current scenario name.

Stats_ReportGameStats(string filename, float realTime)
Creates a .lua file in /LogFiles that looks like: <filename>.lua; it prints all of the current stats for the game, and will set realTime to "minutes : seconds" of the passed in float (which I believe are seconds). I'm not 100% sure what that's for.

The closest you could get to what you're looking for is to handle the GE_EntityKilled event and maybe do a Stats_BalancePrint or something to log the entity's blueprint at time of death. However, I don't think there's a way to figure out who killed that entity.
8 Jun 2019, 18:33 PM
#3
avatar of de111de

Posts: 17

Alright thanks for the help!
8 Jun 2019, 20:50 PM
#4
avatar of Lugie
Senior Modmaker Badge

Posts: 327

If you really needed too, you could check for slot items. Give each member of the squad a dummy slot item, and check how many of said items the squad has in its possession. You might need a proper mod for that.
1 user is browsing this thread: 1 guest

Livestreams

unknown 12
Ireland 2
Egypt 1
Russian Federation 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

384 users are online: 384 guests
1 post in the last 24h
13 posts in the last week
27 posts in the last month
Registered members: 49987
Welcome our newest member, Manahads
Most online: 2043 users on 29 Oct 2023, 01:04 AM