Skip to content

Add option to export grf file to JSON#46

Open
Sowgro wants to merge 3 commits intoLCERD:mainfrom
Sowgro:json-export
Open

Add option to export grf file to JSON#46
Sowgro wants to merge 3 commits intoLCERD:mainfrom
Sowgro:json-export

Conversation

@Sowgro
Copy link

@Sowgro Sowgro commented May 18, 2025

I added an option to export the data from a game rule file to a json file for use in other applications / tools.
This is a feature I really needed for one of my projects, and I figured it could be useful to other people also.

In the grf editor I added File > Export to JSON to the menubar
image

Here is a sample of the generated JSON

[
  {
    "Name": "MapOptions",
    "Parameters": {
      "seed": "-5069382193672799790",
      "spawnX": "-62",
      "spawnY": "212",
      "spawnZ": "208",
      "flatworld": "false",
      "worldName": "IDS_ICARUS_WORLD_NAME",
      "worldDescription": "IDS_ICARUS_DESCRIPTION",
      "worldPreviewImage": "WorldSave/Icarus.png",
      "baseSaveName": "Icarus_MG03.mcs",
      "mapSize": "0",
      "themeId": "14",
      "texturePackId": "1031"
    },
    "ChildRules": []
  },
  {
    "Name": "LevelRules",
    "Parameters": {
      "ruleType": "3"
    },
    "ChildRules": [
      {
        "Name": "ActiveChunkArea",
        "Parameters": {
          "name": "Box - 1",
          "x0": "-3",
          "z0": "-23",
          "x1": "-1",
          "z1": "-18"
        },
        "ChildRules": []
      },
(4014 more lines...)

See the sister pull request in -OMI-Filetype-Library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant