Stellaris

Stellaris

FTL Redefined
 This topic has been pinned, so it's probably important
Jaysus273  [developer] 21 Mar @ 8:02am
Integrating hyperdrives from your mod into mine
This discussion outlines how a mod dev can add support for my mod functions. By support, I mean that your drives will be affected by user windup and interstellar speed settings in my mod, as well as any future features I implement involving hyperdrives and jump drives. There is no need to edit your component templates for this, it's a simple 2 step process.

Anywhere you see <DRIVE_NAME> written in this guide, replace this string with the unlocalised component name key from the component templates file - e.g the vanilla tier 1 hyperdrive would be HYPER_DRIVE_1.

The first step is to create 2 scripted variables for each hyperdrive, and 2 for each jump drive, you're integrating with my mod
If your component has both hyperdrive and jump drive capabilities, define all 4 variables for it. Otherwise, only the relevant variables are needed.
If you have multiple components with the same stats, i.e bioship variants, you can consolidate these into a single variable set.

Hyperdrive variables:
@<DRIVE_NAME>_windup_mult = x
Where x is the component's ship_windup_mult, enter 0 if one is not defined in the component template.
@<DRIVE_NAME>_hyperdrive_days = x
Where x is the average days it should take this drive to travel a hyperlane with default speeds. My values for reference:
Hyperdrive 1 = 50 days, Hyperdrive 2 = 25 days, Hyperdrive 3 = 15 days, Hyperdrive 4 = 7 days, Hyperdrive 5 = 0.01 (instant), Jump Drive = 5 days, Psi Jump Drive = 0.01

Jump drive variables:
@<DRIVE_NAME>_jumpdrive_cooldown_mult = x
Where x is the component's ship_jumpdrive_cooldown_mult. If none is defined then enter 0 for a default value.
@<DRIVE_NAME>_jumpdrive_range_mult = x
Where x is the component's ship_jumpdrive_cooldown_mult. If none is defined then enter 0 for a default value.

If creating these in a new scripted var file, remember to end the file with a blank/commented line.


The second and last step is to use my on_action "on_ftlr_checked_ship" to integrate your drives into my functions via an event.

On_action code:
# FTL Redefined support - This = ship on_ftlr_checked_ship = { events = { my_mod_ship_value_event.1 } }

Event code:
namespace = my_mod_ship_value_event ship_event = { id = my_mod_ship_value_event.1 is_triggered_only = yes hide_window = yes immediate = { switch = { trigger = has_component <DRIVE_NAME> = { ftlr_set_drive_values = { name = <DRIVE_NAME> hyperdrive = yes/no jumpdrive = yes/no } } <DRIVE_NAME> = { ftlr_set_drive_values = { name = <DRIVE_NAME> hyperdrive = yes/no jumpdrive = yes/no } } } } }

Create a new component block for each drive you're replacing inside the trigger = has_component field, and as stated previously use the non-localised component name key. If you consolidated variables while creating them, instead use the drive name of the one you defined variables for in "name = <DRIVE_NAME>". Replace yes/no with yes if the drive has those specific capabilities, and no if it doesn't.
Last edited by Jaysus273; 25 May @ 9:39am
< >
Showing 1-3 of 3 comments
Jaysus273  [developer] 21 Mar @ 8:04am 
Placeholder comment.
Last edited by Jaysus273; 6 Apr @ 8:40am
Jaysus273  [developer] 21 Mar @ 8:15am 
If you want my custom tooltips, you will need to edit your component templates and do a little manual work. When implemented, they look like this: https://i.imgur.com/AqZ40Cc.png
These values are dynamically calculated based on the base speed and windup, and the current user multiplier applied.

If you want them: Add
custom_tooltip = mymod_drivename_tooltip
Inside the ship_modifier field (not a triggered modifier field, just normal). Ignore the CWTools warnings, it needs to specifically be here. Drives with equivalent stats can use the same tooltip key.
You'll then need to manually create a localisation using that key which matches the vanilla applied one, which I will then overwrite on my end.
mymod_drivename_tooltip: "Disengagement Opportunities:§G +(x)§!\nHyper Jump Charge Time:§G -(y)%§!"
Where (x) is your number of disengagement opportunities (with no brackets) and (y) is your drive charge time - if your ship_windup_speed = -0.25, then replace (y) with 25.
Then, simply comment the custom tooltip localisation keys and the 3 variables associated with each drive and I'll implement the scripted localisation on my end! All this is necessary to avoid missing localisations for your drives if my mod isn't active.
Last edited by Jaysus273; 25 May @ 9:40am
Jaysus273  [developer] 21 Mar @ 8:15am 
If you need further help with this, feel free to post here or add me and DM!
< >
Showing 1-3 of 3 comments
Per page: 1530 50