FANDOM


The data exchange format is basically JSON, but due to the application logic and project requirements, there are some strict rules that the JSON data file must follow in order to be properly read by both web application and the scriptwriter's helper gui.

The rules for the file.Edit

The generic format of an exchange data file is as follows:

{
    "locations" : { // the locations dict is always present in the file as the root element of the dict
        "0" : { // id of the location is the index of the location dict
            "name" : { "lang" : "Some name" }, // (1) the name of the location
            "description" : "Some description", // (2) the decription
            "image" : "filename.png", // image for the location (optional)
            "modulename" : "some_module", // (3) module used for the game logic
            "moduledata" : { // (4) data for the module to work with
            },
            "inworld_id" : "id" // (5) ID in the game world (optional)
        }
    }
}

(1) All text data should be placed in a dict with language codeword keys for multilanguage support in the game.

(2) The location description is going to be always shown on the location page. This is important, because the content which is (possibly) dependant on the user input is handled exclusively by module.

(3) The module codename as it is documented.

(4) The module data needed by the module to work.

(5) This is added only if the location already exists on the server (must have been imported to editor), and represents the location's ID in the database on the server.

Example data exchange file:Edit

{
    locations : {
        "0" : {
            "name" : { "en" : "Town's main square" },
            "description" : { "en" : "You are standing next to a big monument in the center of the Yeah town main square. There are three things to do here." },
            "image" : "mainsquare.jpg",
            "modulename" : "simple_exit",
            "moduledata" : {
                "exits" : [
                    { "name" : { "en" : "Go to the shopping mall" }, "destination" : "1" },
                    { "name" : { "en" : "Run in circles" }, "destination" : "0" }
                ] 
            }
        },
        "1" : {
            "name" : { "en" : "Shopping mall" },
            "description" : { "en" : "\"Welcome to YASM - Yet Another Shopping Mall\" - you hear the voice from the speakers. Where would you like to go?" }
            "modulename" : "simple_exit",
            "moduledata" : {
                "exits" : [
                    { "name" : { "en" : "Go to the main square" }, "destination" : "0" }
                ]
            },
            "inworld_id" : "012345676788"
        }
    }
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.