RoboPhred / oni-save-parser

Parses save files for the game "Oxygen Not Included".
MIT License
47 stars 23 forks source link

Support "Geyser" editing (WorldSpawner / Prefab) #1

Closed RoboPhred closed 6 years ago

RoboPhred commented 6 years ago

Core request is to tweak the element and temperature on new saves (presumably, ahead of discovery).

These exist in 2 forms through the game. Before they are discovered, they are a WorldSpawner. After, they are a "Geyser" Prefab.

WorldSpawner

These are simple. I found one before, and it stores the element ID, temperature, and a few other values. I need to look this up again; I do not have access to ONI at the moment.

Prefab

"Geyser"

Geyser prefab behavior chunk example: first entry in THE LOST CITY challenge geyser prefabs.

[
              {
                "name": "KPrefabID",
                "hasParseData": true,
                "parsedData": {
                  "InstanceID": 2002
                },
                "extraData": null
              },
              {
                "name": "SavedObject",
                "hasParseData": true,
                "parsedData": {
                  "inStorage": false
                },
                "extraData": null
              },
              {
                "name": "StateMachineController",
                "hasParseData": true,
                "parsedData": {},
                "extraData": {}
              },
              {
                "name": "PrimaryElement",
                "hasParseData": true,
                "parsedData": {
                  "ElementID": -355957251,
                  "_Temperature": 374.4565124511719,
                  "diseaseID": {
                    "hash": 0
                  },
                  "diseaseCount": 0,
                  "Units": 1
                },
                "extraData": null
              },
              {
                "name": "Klei.AI.Modifiers",
                "hasParseData": true,
                "parsedData": {},
                "extraData": {}
              },
              {
                "name": "Geyser",
                "hasParseData": true,
                "parsedData": {},
                "extraData": null
              },
              {
                "name": "ElementEmitter",
                "hasParseData": true,
                "parsedData": {},
                "extraData": null
              }
            ]
TheLoneWolfling commented 6 years ago

Ugh, State machines completely ignore the template type system for their internal data. This is going to be annoying.

RoboPhred commented 6 years ago

I added editing of the Geyser behavior, which only functions when the geyser has been revealed. The editables are pretty restricted; only the random factor can be changed, and only existing geyser types can be selected. No custom elements or never-idle geysers.

Templates and helper functions have been added.