Author Topic: Python Fire Control Assigner for Big Ships  (Read 1482 times)

0 Members and 1 Guest are viewing this topic.

Offline Vandermeer (OP)

  • Rear Admiral
  • **********
  • Posts: 961
  • Thanked: 128 times
Python Fire Control Assigner for Big Ships
« on: August 30, 2022, 09:12:18 AM »
Currently it seems that the fire control auto-assignment feature for C# is not functional anymore, or at least it is for me, while no one had any solutions in the question thread. Even the most simple cases (one beam-fc + one beam-weapon, or one-missile-fc and some 20 launchers) don't appear to work. I have once manually assigned 200 launchers+missiles and don't want to do it again, so now that I had 1200 on the table and no auto-assign sorting these into the 6 available fire controls, I decided to rather automate it with a python script, since that is clearly faster in the long run.

Voila:


You can use that script yourself if this plagues you too. It must go directly in the Aurora folder, and you will have to open it in a notepad in order to assign the 4 information points needed: ShipName, FCName, WeaponName, and potentially MissileName if required.
The script will then automatically distribute an equal share of weapons to all available FCs of the specified name, and ignore the remainder of weapons if they can't be distributed evenly. Since this only works on the database, you will have to restart Aurora to see the effect, so the complete procedure is:
1. Save Aurora
2. Lookup the names in Aurora and put them into the beginning of the script and save it
3. Run Script (It will say if it worked)
4. Restart Aurora

I worked in error checking so I don't have to fear typos just in case (although copying the names out of the game is recommended anyway), but just to be sure you should also make a database copy before running the script and then check if everything went alright in the game.


Of course all this would be much more comfortable if it spawned a menu with dropdowns perhaps, or asked for input directly in cmd every time, so one doesn't have to write details into the code itself. However, this is an interim solution anyways, that is just for those desperate and rarer moments where you really really have too many weapons on a ship. So given that this is a rather niche problem market, I don't think investing too much time on polish is warranted. (also, hopefully auto-assign will be fixed, making the script obsolete anyway)

Also, if you can't run it directly, you might need to install the sqlite3 package that can be installed by just typing "pip install pysqlite3" into any terminal or cmd.
playing Aurora as swarm fleet: Zen Nomadic Hive Fantasy
 
The following users thanked this post: Andrew, Droll, StarshipCactus, skoormit, Sebmono