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)
0 user is browsing this thread:
Livestreams
29 | |||||
22 | |||||
18 | |||||
1 | |||||
275 | |||||
196 | |||||
5 | |||||
4 | |||||
3 | |||||
2 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.34957.860+14
- 3.589215.733+4
- 4.1099614.642-1
- 5.280162.633+8
- 6.305114.728+1
- 7.916405.693-2
- 8.271108.715+22
- 9.721440.621+3
- 10.1041674.607-2
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1231
Board Info
565 users are online:
565 guests
1 post in the last 24h
7 posts in the last week
39 posts in the last month
7 posts in the last week
39 posts in the last month
Registered members: 49062
Welcome our newest member, Mclatc16
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, Mclatc16
Most online: 2043 users on 29 Oct 2023, 01:04 AM