Aurora 4x

Other Games => Quasar4x => Modding => Topic started by: trabber Shir on September 23, 2021, 07:36:09 AM

Title: Mod to support overly thourogh use of geology teams.
Post by: trabber Shir on September 23, 2021, 07:36:09 AM
This thread is to ask if anything being described may be impossible with the modding tools available, or if there may be a better way to handle this than building a mod.

Goal:

Complete a Geological Team Survey on every body in a system.

Current manual methodology:

Have a few fleets set to "Pick up idle geosurvey team" and "drop off geosurvey team at unsurveyed colony".

Problem 1: Occasionally I need to intervene to split up the teams because after a while I always end up with one fleet carrying all the teams and all the teams on one colony.

Problem 2: If I have a colony on a body, then it is not available for the establishment of CMCs and the automatic commander assignments has a good chance of giving it a governor that would be more useful elsewhere. So, I do not want a lot of colonies created and waiting for the teams, the colonies should be created on bodies needing a survey, and then the colonies should be abandoned after the survey if not being otherwise interacted with.


Mod Ideas:

The pipe-dream ideal solution that is not happening any time soon:
An upgrade to those default orders such that they create colonies as needed, abandon colonies that they remove teams from (if not referenced by anything else), reserve colonies they are in route to, and not choose to drop off on colonies that are reserved or have a team already. If that is simpler than it sounds, let me know and I might come back to it.

Concept A: the first/prototype feature that I know should be possible because it is just reading the database and printing lists on the screen. Regrettably it only addresses Problem 2.

Concept A's stretch goals (AKA things that might be so easy after I learn the API that I do them to make dev and debug easier):

Concept B is a modification to the default orders to partly address Problem 1 and Concept C is some automation of button clicking on Concept A. But I have changed my mind about detailing those here now. I can edit the OP if concept A turns out to be less painful than I am anticipating.

I would especially like feedback for people who have actually dug into the API on whether the "stretch goals" are well supported.
Title: Re: Mod to support overly thourogh use of geology teams.
Post by: trabber Shir on September 23, 2021, 04:26:18 PM
It is looking like the UI is going to be the hard part of the basic idea. Gettign the data for the lists is just passing the SQL I already have 75% figured out to fetch().

The stretch goals are looking to be split half way down the middle but luckily in a good way.

Navigating the pops to the economic window is just calling zoom_to_pop, but actually handling the abandoning of the colony seems to need a very risky and unsafe execute() call.

Navigating somewhere useful when clickign a body would be a lot of fidgiting with the nodes directly but a button to create the colony would just need to invoke add_colony, so zoom_to_body_on_map should be good enough for the navigate behavior.

Running code at the end of a turn and rate limiting it to 30 days for performance seems to be trivial with connect_increment_end() but I cannot find any support for generating a custom event and in a first pass would likely resort to either a log_auto_fleet with a dummy fleet ID or popup_alert. It may be that as I get deeper into the UI node manipulation it will become obvious how to do the alerts, but I doubt it since they can manifest in multiple places.