Jump to content

A question about Scenario editing


Recommended Posts

After looking through JSON and XML files of a Scenario, I finally managed to edit the time of day, season, weather and the beginning time. I also can now exchange the train formation (thanks to Pitoras' TrainsCreator馃憤) and the timetable. Also the time when at departure the signal has to change to green. And I managed to change the final station if this was already included in the original scenario.

But I have a question about how the JSON file of a scenario is executed. Are all these ID numbers e.g. "$id": "6" always executed one after the other or can there be jumps to different ID numbers? At the end of some code blocks is a "$ref": "##" command. Is this a jump to a different ID or a subroutine ?

I wondered because I want to insert a weather change e.g. between "$id": "66" and "$id": "67".
Can I give this weather change block the ID "67" and then rename all following IDs +1 ? If there are jumps in the code, this wouldn't work because a jump would end on the wrong ID then...

Thanks for enlightening me!

Link to comment
Share on other sites

You are aware that json bases scenario'sie an outdated way of programming scenario's? I thought lets mention it before you might waste a lot of time learning to understand json and then not being able to use your json work in the future.聽

  • I agree 1
Link to comment
Share on other sites

No one really can explain the JSON format, especially with setting a route. Like mentioned above, there is no support for JSON and it is not recommended to make new scenarios with it since it is also very buggy.

Lua is a lot easier, more structured and has more functions.

Link to comment
Share on other sites

  • SIMRAIL Team

IDs jusy need to be unique. They can be out of order, so you can add things with new id between existing ones.

Ref is a refference to other id (yes, something like a jump).聽

When I was making tutorials for EN57 and ET22, I put new id's in groups 1000+, 2000+ etc.

And LUA is more friendly 馃檪

Link to comment
Share on other sites

I can just quadruple that 馃槃聽All xml scenarios that we have created in 2023 were just great example of hacking existing scenarios.
Now with lua we have (almost) full platform to create whatever we want - and it is still being extended 馃檪

Link to comment
Share on other sites

Thanks for your LUA hint ! I wasn't aware of it because the scenario I edited was still with JSON files...

So I will look through a LUA programmed scenario and try to understand it's structure.聽 I already found the LUA Scenarios page in the SimRail wiki. Anything else that could help ?

And thanks for NOT wasting my time 馃榾馃憤

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy