External Scripting |
OK all you programming gurus
out there - is it possible to create an external script that can be run from inside the game or from an external (small) DOS window?
What brought this to mind the VERY early stages of the game where you spend a *LOT* of time creating a few ships, exploring and hitting "End of Turn."
What I'd like to be able to do is put ships in a repeating construction queue, let the script select the next idle ship (if available) and then send it to the next unexplored sector - all automatically under scrip control.
Can it be done?

Re: External Scripting
Looked through the scripts some more and yes, all the above is already done by the AI, all you would have to do is set up the main empire script to execute your preset orders based on whatever ships are ready.
Each turn just have the main script execute a ship list fill with all the ship types just sitting around or still in the queue, check what type they are (design type and hull size etc..) and set orders according to the list of orders you want. I'm not sure yet if you can have a set of selectable orders (possibly from preferences) read in during each build/main script execute, it does have a file read capability. I just haven't used it yet...
Re: External Scripting
To answer your question, no, there is no known way to write an external program/script to give ship orders and such. You can use the internal AI scripting though, to do such things. Just turning on a few ministers, like ship design and exploration, will get you started.
Re: External Scripting
Would probably be longer to do, but you could also look into SCAR...




Re: External Scripting
I think so, I'm just getting into the scripting fun and within the empire specific Main script, you can set up some functions to do just that. One problem I see is whatever ship you design will have to generically tagged or the script will have to select whatever ship is in the queue (you can specify what type in the queue you desire) to assign it orders right off the assembly line.
There is an AI script #include that has ship orders, so this may already be part of some of the internal workings, just a little tweaking to get what you want.
Well, most likely some good coding on the selection process desired and type of orders you want will be needed.