How to check how many soldiers of a blueprint died
8 Jun 2019, 13:02 PM
#1

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


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.
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

Posts: 17
Alright thanks for the help!
8 Jun 2019, 20:50 PM
#4


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.
PAGES (1)

1 user is browsing this thread:
1 guest
Livestreams
![]() |
![]() |
![]() |
39 | ||
![]() |
![]() |
![]() |
30 | ||
![]() |
![]() |
![]() |
17 | ||
![]() |
![]() |
![]() |
17 | ||
![]() |
![]() |
![]() |
1 | ||
![]() |
![]() |
![]() |
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.42463.871+2
- 2.659233.739+2
- 3.300162.649+1
- 4.12543.744+3
- 5.286110.722-2
- 6.312114.732+8
- 7.193100.659+3
- 8.10829.788+9
- 9.1171650.643+2
- 10.725443.621-2
Replay highlight
VS
-
cblanco ★
-
보드카 중대
-
VonManteuffel
-
Heartless Jäger

Einhoven Country

Honor it
13

Download
1323
Board Info
1037 users are online:
1037 guests
0 post in the last 24h
2 posts in the last week
42 posts in the last month
2 posts in the last week
42 posts in the last month
Registered members: 51882
Welcome our newest member, Ducce659
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, Ducce659
Most online: 2043 users on 29 Oct 2023, 01:04 AM