Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 329 330 [331] 332 333 ... 459

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

Armithaig

  • Lieutenant
  • **
  • Posts: 53
    • View Profile
    • Amaranth
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4950 on: September 02, 2019, 12:52:12 PM »

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

Made a SHIP_WITH_MODULES, but the modules're "swaying" with passionate turns as if strapped on with space tape.
Any way to nail 'em down firmer?


Hmm. I don't actually know what the issue might be. If the modules have a INDEPENDENT_ROTATION hint set, that would prevent their facing from being locked; that's the only thing that comes to mind.
Captured me sliding 'round like Kubica at 50% speed.
See if it fires any synapses, can make a post in (modded?) bug section with JSON/CSV data if it helps. No extraordinary hints, just SHIP_WITH_MODULES, CARRIER, UNBOARDABLE, HIDE_IN_CODEX.
Logged

Alex

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

... weird.

Just to confirm, are those modules implemented as ships? Or are you using decorative weapons etc? The hints you'd want to look at would be for the module "ships", as far as INDEPENDENT_ROTATION.
Logged

Armithaig

  • Lieutenant
  • **
  • Posts: 53
    • View Profile
    • Amaranth
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4952 on: September 02, 2019, 01:24:13 PM »

They're ships, posted the basics here.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1073
  • For space is wide and good friends are too few.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4953 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
People need societies, but they don't necessarily need nations.

Alex

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

(Per that thread, fixed!)
Logged

Soñjer

  • Ensign
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4955 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: 2803
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4956 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: 11
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4957 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: 17090
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4958 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 #4959 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: 17090
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4960 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
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4961 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: 11
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4962 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 #4963 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: 1133
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4964 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
}
Pages: 1 ... 329 330 [331] 332 333 ... 459