Jump to content

Parsing persistent.sfs into database or application


Waynieoaks

Recommended Posts

Hi

So this may be a daft question or idea but has anybody ever tried to take the data from persistent.sfs into a database or something to see the data outside of the game?

I am thinking something like a database application that will show you crew rostas, career logs, flight logs, missions, etc.

It looks like JSON, but not quite so I am not sure how to work something to read the tree and show the data.

With the languages I know I was thinking a simple web application using PHP would be possible if I could work out a way to parse the information into some kind of queryable way so the website can show different things on different pages.

For example turning the information below into a nice crew information record:

ROSTER
    {
        KERBAL
        {
            name = Jebediah Kerman
            gender = Male
            type = Crew
            trait = Pilot
            brave = 0.5
            dumb = 0.5
            badS = True
            veteran = True
            tour = False
            state = Assigned
            inactive = False
            inactiveTimeEnd = 0
            gExperienced = 0
            outDueToG = False
            ToD = 0
            idx = 0
            extraXP = 0
            hero = True
            CAREER_LOG
            {
                flight = 0
            }
            FLIGHT_LOG
            {
                flight = 0
                0 = Flight,Kerbin
                0 = Suborbit,Kerbin
                0 = Orbit,Kerbin
                0 = Escape,Kerbin
                0 = Flyby,Sun
                0 = Orbit,Sun
            }
        }

 

Link to comment
Share on other sites

22 minutes ago, Rocket In My Pocket said:

Can't remember the name off the top of my head but there is a save file editing/parsing program already.

Maybe KML - Persistence file editor:

I'm not sure if it does what you need - this is listed in the OP:
 

Quote

deletion of kerbals and vessels will fix crew assignment

support renaming kerbals when assigned

send kerbal home to astronaut complex

 

Link to comment
Share on other sites

I don't think it's JSON... it's probably something custom built, with similar logic to JSON, XML, csv, <yul brynner!siam accent> etc. etc. etc. </yul brynner!siam accent>

But since is at its core raw text,  you can use the basic text reading  and parsing functions within language of preference [don't start the language holy-flame wars... again -ed.]. I know they ain't  the newest shiniest code library out there. But dang [language -ed.] it, they work, work well, and ain't got no deep hidden bugs... well none of real note.

As for has anybody built anything.

There is an app/website... that would strip a launched craft out of a persistence file, and put it into a .craft file.

I managed to teach Excel how to read .craft file so I could do some heavy bulk edits. <anthony daniels!c-3po>.craft files are similar in most respects to the persistence files<anthony daniels!c-3po>

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...