Giter Club home page Giter Club logo

Comments (6)

mrSkortch avatar mrSkortch commented on July 17, 2024

csv might be a bit tricky simply due to how the stats are organized. Would it be the whole stats file as one big csv, a file per player, or even just a file for a player's specific aircraft?

The way I see it, it'd have to be built similar to how the in game stats display works by getting a list of all aircraft, weapons, kills, etc and then having to populate the csv in that format. So you'd have something like a list of general stats across the horizontal part of the spreadsheet and the vast majority would list a stat of 0 or just be missing. There would be a ton of entries though, especially if more detailed stats are enabled that keeps track of individual object types killed by weapons. Not to mention the formatting would likely change between exports.

from dcs-slmod.

leha-sys avatar leha-sys commented on July 17, 2024

I might be wrong but in my opinion the whole stats file would be easy to export and use.

from dcs-slmod.

mrSkortch avatar mrSkortch commented on July 17, 2024

The export would have to be the same basic code regardless, its just bigger in scale depending on the number of stats. Its not impossible by any means, just requires the time to sit down and code that, and honestly the json export has priority, which is much simpler.

The older stats format wouldn't be that bad, its the newer and more detailed stats that would be annoying. Just a sample of what I mean. These are the "middle ground" level of detail for the stats for two aircraft for the same player as saved in the stats file.

            ["A-10C"] = 
            {
                ["total"] = 32625.262,
                ["weapons"] = 
                {
                    ["CBU-97/CBU-105 SFW"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 9,
                        ["shot"] = 15,
                        ["numHits"] = 10,
                    }, -- end of ["CBU-97/CBU-105 SFW"]
                    ["GBU-38"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 3,
                        ["shot"] = 4,
                        ["numHits"] = 3,
                    }, -- end of ["GBU-38"]
                    ["AGM-65D"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 4,
                        ["shot"] = 8,
                        ["numHits"] = 4,
                    }, -- end of ["AGM-65D"]
                    ["HYDRA-70 M151"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 0,
                        ["shot"] = 7,
                        ["numHits"] = 0,
                    }, -- end of ["HYDRA-70 M151"]
                    ["kamikaze"] = 
                    {
                        ["numHits"] = 1,
                        ["kills"] = 0,
                        ["shot"] = 0,
                        ["hit"] = 0,
                    }, -- end of ["kamikaze"]
                }, -- end of ["weapons"]
                ["inAir"] = 17573.761,
                ["actions"] = 
                {
                    ["losses"] = 
                    {
                        ["pilotDeath"] = 1,
                        ["crash"] = 1,
                        ["eject"] = 0,
                    }, -- end of ["losses"]
                }, -- end of ["actions"]
                ["kills"] = 
                {
                    ["Ground Units"] = 
                    {
                        ["APCs"] = 14,
                        ["total"] = 39,
                        ["Unarmored"] = 25,
                    }, -- end of ["Ground Units"]
                }, -- end of ["kills"]
            }, -- end of ["A-10C"]
            ["JF-17"] = 
            {
                ["total"] = 55277.605,
                ["kills"] = 
                {
                    ["Ships"] = 
                    {
                        ["Unarmed"] = 7,
                        ["total"] = 7,
                    }, -- end of ["Ships"]
                    ["Ground Units"] = 
                    {
                        ["AAA"] = 3,
                        ["SAM"] = 1,
                        ["Unarmored"] = 12,
                        ["APCs"] = 23,
                        ["Tanks"] = 2,
                        ["total"] = 41,
                    }, -- end of ["Ground Units"]
                    ["Planes"] = 
                    {
                        ["Attack"] = 2,
                        ["total"] = 2,
                    }, -- end of ["Planes"]
                }, -- end of ["kills"]
                ["inAir"] = 36076.493,
                ["actions"] = 
                {
                    ["losses"] = 
                    {
                        ["pilotDeath"] = 2,
                        ["crash"] = 2,
                        ["eject"] = 1,
                    }, -- end of ["losses"]
                }, -- end of ["actions"]
                ["weapons"] = 
                {
                    ["C-802AK"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 2,
                        ["shot"] = 6,
                        ["numHits"] = 2,
                    }, -- end of ["C-802AK"]
                    ["C-701IR"] = 
                    {
                        ["numHits"] = 4,
                        ["kills"] = 3,
                        ["shot"] = 7,
                        ["hit"] = 0,
                    }, -- end of ["C-701IR"]
                    ["BRM-1 90MM"] = 
                    {
                        ["numHits"] = 18,
                        ["kills"] = 14,
                        ["shot"] = 55,
                        ["hit"] = 0,
                    }, -- end of ["BRM-1 90MM"]
                    ["SD-10"] = 
                    {
                        ["numHits"] = 0,
                        ["kills"] = 0,
                        ["shot"] = 1,
                        ["hit"] = 0,
                    }, -- end of ["SD-10"]
                    ["CM-802AKG"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 4,
                        ["shot"] = 10,
                        ["numHits"] = 4,
                    }, -- end of ["CM-802AKG"]
                    ["kamikaze"] = 
                    {
                        ["numHits"] = 1,
                        ["kills"] = 0,
                        ["shot"] = 0,
                        ["hit"] = 0,
                    }, -- end of ["kamikaze"]
                    ["BRM-1_90MM"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 2,
                        ["shot"] = 5,
                        ["numHits"] = 2,
                    }, -- end of ["BRM-1_90MM"]
                    ["GSh-2-23"] = 
                    {
                        ["kills"] = 2,
                        ["shot"] = 214,
                        ["hit"] = 0,
                        ["gun"] = true,
                        ["numHits"] = 97,
                    }, -- end of ["GSh-2-23"]
                    ["GBU-16"] = 
                    {
                        ["numHits"] = 2,
                        ["kills"] = 1,
                        ["shot"] = 3,
                        ["hit"] = 0,
                    }, -- end of ["GBU-16"]
                    ["LD-10"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 1,
                        ["shot"] = 9,
                        ["numHits"] = 1,
                    }, -- end of ["LD-10"]
                    ["GB-6-SFW"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 10,
                        ["shot"] = 8,
                        ["numHits"] = 13,
                    }, -- end of ["GB-6-SFW"]
                    ["LS-6-500"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 9,
                        ["shot"] = 3,
                        ["numHits"] = 9,
                    }, -- end of ["LS-6-500"]
                    ["PL-5EII"] = 
                    {
                        ["hit"] = 0,
                        ["kills"] = 2,
                        ["shot"] = 2,
                        ["numHits"] = 4,
                    }, -- end of ["PL-5EII"]
                }, -- end of ["weapons"]
            }, -- end of ["JF-17"]

So the csv would have to be something like below where "x" is some value stored in the stats and 0 would be anything missing. Including more of the specific stats would just add more and more entries. With hundreds of objects in the game and hundreds of weapons to use it should be evident how large the stats would become. Again, if it was something limited to the in game display then by all means it wouldn't be that bad to created, but all the details it becomes a bit crazy.

ACName, total, inAir, kills Ground Units, Kills Planes, Kills, Ships, Weapons GBU-38, Weapons ... and on and on
A-10C, x, x, x, 0, 0, x, x, x, x, 0, 0
JF-17, x, x, x, x, x, 0, 0, 0, 0, x, x 

from dcs-slmod.

leha-sys avatar leha-sys commented on July 17, 2024

Yes, I see it becomes a bit more than simple.
Maybe we can start with short stats?
After looking at the code for a while I thought about using
local function createSimpleStats(ucid, mode) for the first step to export to csv or json.
I figured that would be an easy start instead of dealing with full stats.

I haven't had a good knowledge of the lua to not to break anything,
but I could take part in testing.

from dcs-slmod.

mrSkortch avatar mrSkortch commented on July 17, 2024

Piggy backing onto the in game display functions was pretty much my line of thinking for getting it to work anyway. I've been focused on mission editor scripting stuff lately, so I've been spending my time on that. If I get some time to add stuff to slmod I might do some tests for this, but no promises though.

from dcs-slmod.

leha-sys avatar leha-sys commented on July 17, 2024

No problem. We'll wait for any update.

from dcs-slmod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.