Glendathu Posted August 14 Share Posted August 14 聽 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 More sharing options...
jeroezie Posted August 14 Share Posted August 14 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.聽 1 Link to comment Share on other sites More sharing options...
Moooritz Posted August 15 Share Posted August 15 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 More sharing options...
SIMRAIL Team Kr贸lik Uszasty Posted August 16 SIMRAIL Team Share Posted August 16 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 More sharing options...
Eridor Posted August 16 Share Posted August 16 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 More sharing options...
Glendathu Posted August 17 Author Share Posted August 17 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 More sharing options...
Friedjof Posted August 17 Share Posted August 17 @Glendathu聽 You could look here for other user created scenarios:聽https://forum.simrail.eu/forum/112-scenarios/ and here for tips, tricks and questions about LUA-mission editing:聽https://forum.simrail.eu/forum/120-lua-scripting/ Link to comment Share on other sites More sharing options...
Recommended Posts