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 | |||||
22 | |||||
17 | |||||
1 | |||||
8 | |||||
2 | |||||
1 | |||||
1 | |||||
1 | |||||
0 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.611220.735+5
- 3.34957.860+14
- 4.1110614.644+11
- 5.276108.719+27
- 6.306114.729+2
- 7.916405.693-2
- 8.262137.657+3
- 9.722440.621+4
- 10.1041674.607-2
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1235
Board Info
868 users are online:
868 guests
0 post in the last 24h
7 posts in the last week
34 posts in the last month
7 posts in the last week
34 posts in the last month
Registered members: 49117
Welcome our newest member, topcsnvncom
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, topcsnvncom
Most online: 2043 users on 29 Oct 2023, 01:04 AM