Trying to load a GameScript for a Dedicated Server
Posted: 03 Feb 2021 09:03
I'm working on some code to run a tournament of AIs, and as part of that I'd like to have a gamescript that does some logging. I'm trying to run the gamescript against a dedicated server.
I've got AIs working, and that's fine. But I've got a dead-simple Gamescript, and it's failing silently and I can't figure out why.
Here's the info.nut:
And here's the main.nut:
And here's how I'm invoking it in openttd.cfg:
And nothing. I've got debug logs turned up to 9 across the board, and I know that OpenTTD finds the tar file and the .nut files, but then it's just silent failure.
Any hints? I'm tearing my hair out. Thanks!
I've got AIs working, and that's fine. But I've got a dead-simple Gamescript, and it's failing silently and I can't figure out why.
Here's the info.nut:
Code: Select all
class Arbiter extends GSInfo {
function GetAuthor() { return "gregdek"; }
function GetName() { return "Arbiter"; }
function GetDescription() { return "An arbiter of AI-only games"; }
function GetVersion() { return 1; }
function GetDate() { return "2021-02-02"; }
function CreateInstance() { return "Arbiter"; }
function GetShortName() { return "ARBX"; }
function GetAPIVersion() { return "1.9"; }
function GetSettings();
}
/* Tell the core we are a GS */
RegisterGS(Arbiter());
Code: Select all
class Arbiter extends GSController
{
constructor()
}
function Arbiter::Start()
{
GSLog.Info("[arbi] I am here!");
GSController.Sleep(1);
while (true) {
// we just wait every 10 ticks and ping
GSLog.Info("[arbi] I am still here!");
GSController.Sleep(10);
}
}
Code: Select all
[game_scripts]
arbiter = foo=1
Any hints? I'm tearing my hair out. Thanks!