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
12 | |||||
2 | |||||
1 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.655231.739+15
- 2.842223.791+5
- 3.35258.859+1
- 4.599234.719+7
- 5.936410.695+2
- 6.278108.720+29
- 7.307114.729+3
- 8.645.928+5
- 9.10629.785+7
- 10.527.881+18
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
11
Download
1263
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
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
Welcome our newest member, Manahads
Most online: 2043 users on 29 Oct 2023, 01:04 AM