Stellaris

Stellaris

Transport Ships Reimplemented [3.10 - 3.12]
主​​​Miͥภgͣcͫℝ♚  [开发者] 2023 年 12 月 22 日 下午 3:51
How to use this in your mods
To add this functionality, you need the following two events, triggered by on_actions:

One event must be hooked up to "on_ship_built" (or, for event-generated ships, it must be called right after spawning) and unlocks functionality for any ship size you explicitely want to use this feature:

ship_event = { is_triggered_only = yes hide_window = yes trigger = { is_ship_size = put_your_ship_size_here } immediate = { // if you want this ship class to come with a custom leader, like I've seen in some Grey or Bubbles mod, create that here and use "save_global_event_target_as = mcr_custom_transport_ships_events_assign_leader" // if that event target exists upon the following call, the integration will be handled automatically // then you can call fire_on_action = { on_action = mcr_custom_transport_ships_singular_assign_ids } // that ^^ one kicks off integration for ship sizes that do not belong into a fleet - either because they come with a custom leader or they conceptually are similar to a colossus or juggernaut // if you want the "usual" multiple-ships-per-fleet functionality, use fire_on_action = { on_action = mcr_custom_transport_ships_regular_assign_ids } // instead. } }

One event must be hooked up to the on_action "mcr_custom_transport_ship_land_armies" and requires you to generate one army of your custom type on the planet in "from".
The syncing must then be handed back off to the framework.

ship_event = { is_triggered_only = yes hide_window = yes trigger = { is_ship_size = put_your_ship_size_here } immediate = { from = { create_army = { ... } last_created_army = { root = { fire_on_action = { on_action = mcr_custom_transport_ships_reverse_sync scopes = { from = prev } } } } } } }

The armies should generally be unembarkable (= defensive) and I suggest making them unbuildable with this active:
time = 99999 pop_limited = no defensive = yes is_pop_spawned = no occupation = no potential = { always = no } rebel = no
If you still want the specific armies to be available without this mod enabled, make a copy of your army and put
NOT = { has_global_flag = mcr_custom_transport_ships_enabled }
into the potential block.
I highly recommend looking at the Apocrita mod for reference.

I have also added the scripted value
value:mcr_custom_transport_ships_army_effectiveness
to allow for automated selection of the potential "best" (or at least, not worst) species for an army source if you don't wanna use fixed species. Examples of this can be found in the TSR Vanilla mod I uploaded.
最后由 主​​​Miͥภgͣcͫℝ♚ 编辑于; 2023 年 12 月 30 日 上午 8:32