Please help a scripting beginner |
I tried to alter the Ship Order script a bit so that space yard ships automatically build fighters till their cargo is half full. (I know, that would make mure sense on carriers but I do not know if it causes problems when a carrier has no space yard). When I know that it works I will move those lines to the carrier ships and add a check for ship space yard components.
I compiled it with the default AI but in my current game this script doesn't seem to be working as my space yard ships are rahter inactive (not moving and not building). Now I don't know if my script is not working or if I have forgotten a step to activate them.
1. Do I have to compile it to the default AI or to a racial AI to match my race?
2. DO I have to restart the game?
3. Do I have to delete a original file somewhere to make my script work?
The important line of my script change is:
set design_id := Sys_Get_Latest_Vehicle_Design_Of_AI_Type(sys_long_Player_ID,
AI_DESIGN_TYPE_FIGHTER)
set orders_given := Sys_Add_Vehicle_Design_To_Construction_Queue(ship_id, design_id, 1)




Re: Please help a scripting beginner
Hey Ixal,
Compile it to the default race if you want user created races to have this added ability. Make sure all the ministers are on. If you wanted it for one of the stock races (such as the xiati, etc) then you would need to compile those races also. Make sure that you move the file from the scripts folder to the appropriate folder under in the empires folder. THen I suggest using the cheat 'runtuns x' (x being the number of turns you want the computer to play) and see if it does anything. If not then you can use the debug feature and look at what the scripts are actually doing.
Offhand, there may be a difference between the ship_id that you are using and that same ship's queue_id. Not sure, just a possibility.
-unnamed