Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 329 330 [331] 332 333 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1700516 times)

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4950 on: September 02, 2019, 03:39:44 PM »

I've also noticed modules on some of my faster ships swaying slightly with violent maneuvers; I'd also be interested in a fix.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4951 on: September 02, 2019, 03:50:31 PM »

(Per that thread, fixed!)
Logged

Soñjer

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4952 on: September 03, 2019, 03:47:22 AM »

Do I need something else ?
Variants in /data/variants. Set the variant quality too high, won't appear on your regular backwater rimworld either.

Checked it, previously it was set to 0. Made it 1 and then removed the tag altogether, still doesn't show up.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4953 on: September 03, 2019, 04:17:08 AM »

If you haven't already done it, you also need to specify the variants in data/world/factions/default_ship_roles.json.
Logged

Soñjer

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4954 on: September 03, 2019, 07:15:58 AM »

If you haven't already done it, you also need to specify the variants in data/world/factions/default_ship_roles.json.

It doesn't seem to be that either. Here's a dummy mod that has the same structure, if that can help.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4955 on: September 03, 2019, 08:47:10 AM »

Ah! In your default_ship_roles, you've got:

"test_paragon":5,

The key needs to be the various variants, not the hull id.
Logged

NoFoodAfterMidnight

  • Ensign
  • *
  • Posts: 39
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4956 on: September 03, 2019, 08:54:58 AM »

Is the recovery of lost player ships after combat handled in CoreScript and ShipRecoverySpecial? Trying to get player ships to be recovered with more Dmods.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4957 on: September 03, 2019, 09:00:23 AM »

Using playerFleet().getStats().getDynamic().getMod(Stats.SHIP_DMOD_REDUCTION) I think might work if you set this to a negative value.

Otherwise, yeah, it's handled in ShipRecoverySpecial (for derelicts) and FleetEncounterContext (post-combat). For derelicts, you could directly modify the variant of the derelict; IIRC Vayra was asking about this specifically a few pages back in this thread...
Logged

vagrant

  • Ensign
  • *
  • Posts: 29
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4958 on: September 03, 2019, 10:13:20 AM »

Does anyone have experience with using hullmods to modify aspects of ship systems?

-I'm looking to create a single, modular shipsystem that can have additional effects and bonuses based on equipped hullmods. I'm comfortable enough doing the actual modifications to the system that I want, but I have no idea how to implement them so that they are applied only when an applicable hullmod is equipped.

I know Interstellar Imperium does this, you should check it out.

This was super informative, thanks Alex and Vayra.

for anyone interested, got it working by adding:

if (ship.getVariant().hasHullMod(hullmod id))

to the apply function inside a Ship System stats script, with a bunch of cases for relevant hullmods. Really easy!
« Last Edit: September 03, 2019, 11:04:56 AM by vagrant »
Logged

Soñjer

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4959 on: September 03, 2019, 10:19:01 AM »

Ah! In your default_ship_roles, you've got:

"test_paragon":5,

The key needs to be the various variants, not the hull id.

This one's my bad, just forgot when copy pasting. Here's the mod updated (still not working)
« Last Edit: September 03, 2019, 10:21:57 AM by Soñjer »
Logged

NoFoodAfterMidnight

  • Ensign
  • *
  • Posts: 39
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4960 on: September 03, 2019, 12:29:10 PM »

The way the DMod reduction is implemented with a random.nextint() I think it can cause errors if it's negative.

But the FleetEncounterContext is exactly what I was looking for, thanks! I'd been assuming that ShipRecoverySpecial handled post-combat recovery, but it's only post combat derelicts and ships contained in debris fields.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4961 on: September 03, 2019, 01:14:50 PM »

But the FleetEncounterContext is exactly what I was looking for, thanks!
Just keep in mind that any time you override FleetEncounterContext it will create a conflict with any other mod that does the same, because there can be only one for any given encounter. These are the mods (that I'm aware of) that override vanilla's FleetInteractionDialogPluginImpl in order to assign their own FleetEncounterContext :
  • Nexerelin
  • Ship and Weapon Pack
  • Tiandong Heavy Industries
  • Ruthless Sector
For ruthless sector, I bypassed this limitation by overriding the FleetInteractionDialogPlugins of other mods with a plugin of my own that extends any overriden plugin, thus preserving their functionality.
Code
public class CampaignPlugin extends BaseCampaignPlugin {
    @Override
    public PluginPick<InteractionDialogPlugin> pickInteractionDialogPlugin(SectorEntityToken interactionTarget) {
        try {
            if (interactionTarget instanceof CampaignFleetAPI) {
                InteractionDialogPlugin plugin;
                PickPriority priority = PickPriority.MOD_GENERAL;
                ModManagerAPI mm = Global.getSettings().getModManager();

                try {
                    if (mm.isModEnabled("swp") && interactionTarget.getFaction().getId().contentEquals("famous_bounty")) {
                        plugin = new SwpCompatibleFleetInteractionDialogPlugin();
                        priority = PickPriority.HIGHEST; // No other way to ensure compatibility, unfortunately
                    } else if (mm.isModEnabled("nexerelin")) {
                        plugin = new NexCompatibleFleetInteractionDialogPlugin();
                    } else if (mm.isModEnabled("THI") && TiandongModPlugin.useCustomFleetPlugin && anIdleMercFleetIsNearby()) {
                        plugin = new ThiCompatibleFleetInteractionDialogPlugin();
                        priority = PickPriority.MOD_SPECIFIC;
                    } else {
                        plugin = new FleetInteractionDialogPlugin();
                    }
                } catch (Exception e) {
                    plugin = new FleetInteractionDialogPlugin();
                    ModPlugin.reportCrash(e);
                }

                return new PluginPick<>(plugin, priority);
            }
        } catch (Exception e) { ModPlugin.reportCrash(e); }

        return null;
    }

    // Code removed for the sake of brevity
}

XDms

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4962 on: September 04, 2019, 03:39:33 AM »

Thank you Salv and Alex for your replies :) I have a few more questions:
- Let's say I create a mod that add some new solar systems and planets; i guess the player need to start a new game to see/visit them, or he can also "load" them via console?
- Same question for a mod that adds new dialogs and options when the player visit the bar, for example a mod that implements new types of missions. Do he need to start a new game?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4963 on: September 04, 2019, 08:55:22 AM »

- Let's say I create a mod that add some new solar systems and planets; i guess the player need to start a new game to see/visit them, or he can also "load" them via console?

Depends on how you do it - generally, it'd require starting a new game, but it could be coded so that it can be added to an existing game, as well.

- Same question for a mod that adds new dialogs and options when the player visit the bar, for example a mod that implements new types of missions. Do he need to start a new game?

Generally those will not require starting a new game, unless the bar missions depend on something new being added to SectorGen, for example.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4964 on: September 04, 2019, 12:45:50 PM »

Could a crash such as this one possibly be caused by an autofit goal variant that includes perma mods?
Pages: 1 ... 329 330 [331] 332 333 ... 706