Is there any chance to load game scripts in loaded game?
Situation: I've started game in dedicated server with citybuilder script, but after server's crashing the saved game starts without citybuilder script.
Maybe there is some way to manage game scripts like AI scripts (startai/stopai)?
UPD: Hmm. It works only when i save game as admin (via rcon command). But if i save game via simple client - it doesn't save game scripts into ".sav" file.
I have no correct save-file, so my question is still actual.
Game scripts in loaded game.
Moderator: OpenTTD Developers
Re: Game scripts in loaded game.
Can't do, while AI are start as new company, no company exist for the GS.
A proposed fix that will comes out is that even crashed, the GS name (or its md5) in use will be record in the savegame. So it will try to load the GS everytime you load the game.
That's for case when user save game after the GS has crashed.
Didn't knew you could also loose it by saving with client, even it looks logic as the GS run on the server.
A proposed fix that will comes out is that even crashed, the GS name (or its md5) in use will be record in the savegame. So it will try to load the GS everytime you load the game.
That's for case when user save game after the GS has crashed.
Didn't knew you could also loose it by saving with client, even it looks logic as the GS run on the server.
Re: Game scripts in loaded game.
The Game Script run only on the server. Thus the clients do not have access to the internal data of the Game Script (and does not even know which GS if any that is running) and can therefore not save the data needed to load the game with the GS. Thus you must save the game on the server and not from a client.zlavick wrote:UPD: Hmm. It works only when i save game as admin (via rcon command). But if i save game via simple client - it doesn't save game scripts into ".sav" file.
I have no correct save-file, so my question is still actual.
If you only have a client save, then you already have lost this data.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Game scripts in loaded game.
Thank you, Zuu.
Didn't know that and didn't saw this info in manuals.
Now saving games the way you have said.
And one more question. Will it be possible in future to manage GS data remotely, for example download\reload scripts via rcon commands right in a game?
Didn't know that and didn't saw this info in manuals.
Now saving games the way you have said.
And one more question. Will it be possible in future to manage GS data remotely, for example download\reload scripts via rcon commands right in a game?
Re: Game scripts in loaded game.
You can already via rcon download GS from bananas if that is what you were asking for: http://wiki.openttd.org/Dedicated_serve ... ne_content
Reloading of GS scripts is currently not supported neither in single player nor multiplayer. Personally I don't have any plans on working on code changes to change that. It might not be very hard to to implement as for AIs. However Game Scripts get a quite large portion of computation power after world generation, but before the game starts. This will probably be harder to add so that scripts get this also when reloaded. The size of this "bonus" is quite large and allows most scripts to initialize all towns etc. with custom rules before the game starts.
Reloading of GS scripts is currently not supported neither in single player nor multiplayer. Personally I don't have any plans on working on code changes to change that. It might not be very hard to to implement as for AIs. However Game Scripts get a quite large portion of computation power after world generation, but before the game starts. This will probably be harder to add so that scripts get this also when reloaded. The size of this "bonus" is quite large and allows most scripts to initialize all towns etc. with custom rules before the game starts.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Game scripts in loaded game.
Everything is clear now.
Thank you for so detailed answer.
Thank you for so detailed answer.
Re: Game scripts in loaded game.
My latest tests lead me to this conclusions, using a rcon save and a rcon load, dedicated server side:
- Server will ignore what GameScript was being used on the used .cfg file;
- Server will ignore what was the settings on [game_scripts], the same .cfg file;
- Server will load ALL stuff on "main.nut", but doesn't care of .cfg file - what works is what's on "info.nut";
As known, when loading a game, in "main.nut" Gamescript referenced files/settings, are taken the first ones, ignoring any conditions there, and "openttd.cfg" [game_scripts] isn't loaded at all, getting the default ones, defined on the file "info.nut"!
Most people won't notice this, and haven't said a word!
- Server will ignore what GameScript was being used on the used .cfg file;
- Server will ignore what was the settings on [game_scripts], the same .cfg file;
- Server will load ALL stuff on "main.nut", but doesn't care of .cfg file - what works is what's on "info.nut";
As known, when loading a game, in "main.nut" Gamescript referenced files/settings, are taken the first ones, ignoring any conditions there, and "openttd.cfg" [game_scripts] isn't loaded at all, getting the default ones, defined on the file "info.nut"!
Most people won't notice this, and haven't said a word!
Who is online
Users browsing this forum: No registered users and 19 guests