Here is a patch to enable scripted AI players. The patch is against r7582.
There is also an example AI in sqai.zip. You have to put this in the program directory (or under addons/)
Enjoy! any feedback appreciated.
Attached files:
-- sqai.zip - the test AI
-- scripted-ai.zip - the patch
-- Windows GDI executable can be downloaded here: http://simutrans-germany.com/files/upload/sim-wingdi.zip
To start an AI player: open player list window, select 'Scripted AIs', activate player, click 'Load Scripted AI', then select the AI to play.
This is work in progress. No load & save support.
Someone needs to teach your AI the concept of 'net wealth'. Of course doesn't matter much since they just keep on playing when bankrupt. ;D
The title of the AI Selector dialog is strangely corrupted - first two characters... They keep changing, and sometimes only those first two are shown.
Yeah, great addition! Thank you so much, that will be really useful. Let's put it into the nightlies.
Here is an update. Please test.
This file contains windows executable and sample scripted AI player:
http://simutrans-germany.com/files/upload/scripted-ai-wingdi.zip
Patch (apply with -p3) and source of scripted AI player attached.
I did it. Committed all my work on AI players. Please try r7847, when it is compiled by the nightly build site.
Attached is a sample AI player that concentrates on truck transport. Unzip the archive in your simutrans program or user directory.
That attachment is not there anymore. Is this the file ai_base.nut in the simutrans/script folder?
Here is the file again. There is also a repository at github:
https://github.com/Dwachs/simutrans-scenarios
When I try to activate the AI it say load AI in an empty filelist. I unzipped the files into the program directory scrpts/ai/sqai
Upon quitting it crashed.
It must be put into program-directory/ai or addon-directory/ai.
How did you manage to crash the program?
Activate the AI but do not loading anything. When trying to save it will crash.
Ok, put it into main directory and it works. Thanks.
EDIT: Sollte evt. horses-AI heißen, zumindest im pak64 ...
Here is a new version of my AI players. They will now build combined road and water connections. Please test
Unzip the attached file in the program directory.
Got an error occured today by your scripted AI, but dont have any clue how to fix it...
Thanks for reporting. Some debug routine failed :/
You can comment out this line (line 325 in roadconnector.nut, starts with label_x.create..)
For those interested, here is an extension of the Script AI to find the railroad used.
It is still under development.
Script AI for Rail (https://github.com/Andarix/simutrans-scenarios/tree/master/ai/sqai) for Simutrans r9112+