Jump to content

Recommended Posts

Posted

Hey fellas, I'm trying to make a dynamic stats system / killboard to use in multiplayer campaigns but the first I need to figure out is if there exists any parser that improves the info that shows the Debrief.log file

 

What I want to do is: After every mission, load the debrief.log into this kind of parser and "convert it" to an more readable text, and then use it as a database for the killboard.

 

Have you guys know if there is something like that?

Posted
Hey fellas, I'm trying to make a dynamic stats system / killboard to use in multiplayer campaigns but the first I need to figure out is if there exists any parser that improves the info that shows the Debrief.log file

 

What I want to do is: After every mission, load the debrief.log into this kind of parser and "convert it" to an more readable text, and then use it as a database for the killboard.

 

Have you guys know if there is something like that?

 

There's different approaches to do what you're trying to do.

 

1. You can hook into the dcs game events via lua script and write code to track the data you want to capture.

 

-- catch all forms of shooting events from a player
GameEventHandler = {}
function GameEventHandler:onEvent(event)
     if (event.id == world.event.S_EVENT_SHOT or
       event.id == world.event.S_EVENT_SHOOTING_START or
       event.id == world.event.S_EVENT_SHOOTING_END) and
       playerName then
       env.info("SHOT / SHOOTING START / SHOOTING END")
       -- catch all hit events that were initiated by a player
     elseif event.id == world.event.S_EVENT_HIT and playerName then
       env.info("PLAYER HIT SOMEONE")
     end

end

world.addEventHandler(GameEventHandler)

 

^ Some limitations with the above is that kill events are not tracked here. You would need to create a lua server mod and have an event handler track kills there. You can see a sample of that here: https://github.com/KaukausInsurgency/ki-dcs-mod/blob/master/DCSMod/Hooks/KI_ServerGameGUI.lua (line 1544)

 

2. You can parse the debriefing.log file you save with something like python and then do whatever you want with it from there. Here is a repo of small python code that parses the debriefing log into a python dictionary.

 

https://github.com/Igneous01/dcs_miz_parser/blob/master/dcs_miz_parser.py

 

Specifically lines 49, 53 - using this library for python to parse lua: https://github.com/SirAnthony/slpp

Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha)

 

http://kaukasusinsurgency.com/

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...