Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 392 393 [394] 395 396 ... 710

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

Pqxl

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5895 on: January 02, 2020, 04:25:13 AM »

How do I stopp the factions from sending Expeditions my way? I fumbled around in the data\world\factions\persean_league.faction file of a portrait Mod I use, but they still send them my way. The end of the file looks like this:
Spoiler
         ...
         "graphics/portraits/d1/f99.png",
         "graphics/portraits/d1/f100.png"
      ],
   },
      "custom":{
      "offersCommissions":true,
      "engagesInHostilities":true,
      "buysAICores":true,
      "AICoreValueMult":1,
      "AICoreRepMult":1,
      "buysSurveyData":true,
      "hostilityImpactOnGrowth":true,
      "caresAboutAtrocities":true,
      "punitiveExpeditionData":{
         "vsCompetitors":false,
         "vsFreePort":false,
         "canBombard":false,
         "territorial":true,
      },
   },
},
[close]
I changed the line:
Code
punitiveExpeditionData":{"vsCompetitors":true,
to false.
I dont have any other mods that could interfere with that file. The portraits show up. Do I have to make my own Mod for that?
Thank you for your time.
Edit: After Alex's post, I looked over it again and found a Typo. This works now. :)
« Last Edit: January 02, 2020, 01:42:37 PM by Pqxl »
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5896 on: January 02, 2020, 08:02:10 AM »

Is it possible to let Mod Info.json be able to use Replace for data files in the .jar that usually have the file path for com.fs.starfarer.api...?

My inquiry is that Better Colonies is only able to replace vanilla Orbital Stations, but they're unable to replace the modded Orbital Stations from other factions because these stations still refer to com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.java, and a good solution would be able to have the Mod Info.json replace com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.java outright or tell it not to load in the core files so that my mod is able to seamlessly integrate with modded Orbital Station as well.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5897 on: January 02, 2020, 10:04:30 AM »

How do I stopp the factions from sending Expeditions my way? I fumbled around in the data\world\factions\persean_league.faction file of a portrait Mod I use, but they still send them my way. The end of the file looks like this:
Spoiler
         ...
         "graphics/portraits/d1/f99.png",
         "graphics/portraits/d1/f100.png"
      ],
   },
      "custom":{
      "offersCommissions":true,
      "engagesInHostilities":true,
      "buysAICores":true,
      "AICoreValueMult":1,
      "AICoreRepMult":1,
      "buysSurveyData":true,
      "hostilityImpactOnGrowth":true,
      "caresAboutAtrocities":true,
      "punitiveExpeditionData":{
         "vsCompetitors":false,
         "vsFreePort":false,
         "canBombard":false,
         "territorial":true,
      },
   },
},
[close]
I changed the line:
Code
punitiveExpeditionData":{"vsCompetitors":true,
to false.
I dont have any other mods that could interfere with that file. The portraits show up. Do I have to make my own Mod for that?
Thank you for your time.

Hmm - I'm not sure, actually; offhand what you're doing seems like it should work.

Is it possible to let Mod Info.json be able to use Replace for data files in the .jar that usually have the file path for com.fs.starfarer.api...?

My inquiry is that Better Colonies is only able to replace vanilla Orbital Stations, but they're unable to replace the modded Orbital Stations from other factions because these stations still refer to com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.java, and a good solution would be able to have the Mod Info.json replace com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.java outright or tell it not to load in the core files so that my mod is able to seamlessly integrate with modded Orbital Station as well.

It's not possible, no, and it's not something I could add with a reasonable amount of effort.

Even if it were possible, it'd really be asking for trouble, since generally speaking an extending class expects certain behavior from the base class, and if it doesn't get it, the bugs would be really weird and hard to pin down. I.E. say a station class from someone's mod appears broken, they get a bug report, and trying to sort out what's actually happened would be a nightmare.
Logged

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5898 on: January 02, 2020, 11:45:01 AM »

Gave it a closer look - you'll either need to wait a few seconds for it to work (until it's the turn of the star system to be updated, at which point its hyperspace anchor - i.e. star gravity well - coordinates will be updated to match the system's coordinates, or you can call this after setting the location:

sector.getHyperspace().updateAllOrbits();

And have it happen instantly.

I must still be missing something... do I have the wrong system id? Am I overriding the wrong method? Here's the entirety of my mod for a sanity check (sans imports):
Code
package data.scripts;
...
public class MyModPlugin extends BaseModPlugin {
  @Override
  public void onNewGameAfterProcGen() {
    SectorAPI sector = Global.getSector();
    StarSystemAPI system = sector.getStarSystem("Hybrasil");
    system.getLocation().set(0, -20000);
    sector.getHyperspace().updateAllOrbits();
  }
}

Please tell me there's something simple and obvious I'm missing. I'll keep experimenting with trial-and-error in the meantime. I've modified vanilla systems using onNewGame() before so I don't think I should even need to use onNewGameAfterProcGen(), but anyway neither one works. I tried waiting too so unless it's more a matter of minutes than seconds, that wasn't it either. And just to repeat again: the methods related to hyperspace position don't appear to be accessible, but correct me if I'm wrong.

Anyway, thanks for your help so far.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5899 on: January 02, 2020, 12:23:56 PM »

Aha - put it in onNewGameAfterEconomyLoad(); as it turns out, loading the economy also reloads the starmap and sets the systems to the positions specified therein. This is a bug; fixed on my end just now.
Logged

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5900 on: January 02, 2020, 01:45:55 PM »

Aha - put it in onNewGameAfterEconomyLoad(); as it turns out, loading the economy also reloads the starmap and sets the systems to the positions specified therein. This is a bug; fixed on my end just now.

Ok, I'll try
Code
onNewGameAfterEconomyLoad()
for now and make a note that it will be updated in a future version.
Thanks again!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5901 on: January 02, 2020, 01:48:01 PM »

Yep!
Logged

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5902 on: January 02, 2020, 02:18:04 PM »

Here's a new question about the "knownShips" tag in the .faction files.

This is what's on the wiki page:
Quote
"knownShips" is the list of blueprints/ships the faction will produce from when they do have a Heavy Industry industry on the producing market. Including ship hulls in the 'hulls' list will allow the faction to produce those ships even when they fall outside of blueprints listed in the 'tags' list.

This is what the Hegemony have:
Code
  "knownShips":{
    "tags":["base_bp", "heg_aux_bp", "lowtech_bp", "midline_bp", "XIV_bp", "hegemony"],
    "hulls":[
      "atlas",
      "monitor",
      "prometheus",
      "legion",
      "onslaught",
      "gryphon",
      "eagle",
      "valkyrie",
    ],
  },

However, since the eagle and the legion are both part of "lowtech_bp" and "midline_bp" what is the nuance I'm missing? I know for a fact the Hegemony also spawn Falcons (part of the midline bp). So what is achieved by also listing hulls explicitly? Or is listing "eagle", "monitor", "legion", etc. purely redundant?

By contrast I know that if a ship isn't in a blue print package listed in the tags (eg "rare_bp") then you must list its hull explicitly. I'm just saying that's not the case here. So what gives?

Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5903 on: January 02, 2020, 03:19:55 PM »

However, since the eagle and the legion are both part of "lowtech_bp" and "midline_bp"

They're not, those are both rare_bp, as is the Onslaught.

I know for a fact the Hegemony also spawn Falcons (part of the midline bp).

By contrast I know that if a ship isn't in a blue print package listed in the tags (eg "rare_bp") then you must list its hull explicitly.

Correct.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5904 on: January 03, 2020, 11:14:08 AM »

I've been trying to duplicate a Lion's Guard HQ for a modded faction's guard, but this bug always seems to appear. The industries.csv seems to work. The PNG of the Industry seems to work, but the java, however, doesn't seem to work.
Code
301986 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.api.impl.campaign.econ.impl.ShipQuality.getShipQuality(ShipQuality.java:143)
at com.fs.starfarer.api.util.Misc.getShipQuality(Misc.java:3471)
at com.fs.starfarer.api.impl.campaign.fleets.FleetParamsV3.updateQualityAndProducerFromSourceMarket(FleetParamsV3.java:144)
at com.fs.starfarer.api.impl.campaign.fleets.FleetParamsV3.init(FleetParamsV3.java:122)
at com.fs.starfarer.api.impl.campaign.fleets.FleetParamsV3.<init>(FleetParamsV3.java:83)
at com.fs.starfarer.api.impl.campaign.econ.impl.MayasuranGuardHQ.spawnFleet(MayasuranGuardHQ.java:297)
at com.fs.starfarer.api.impl.campaign.fleets.RouteManager.spawnAndDespawn(RouteManager.java:614)
at com.fs.starfarer.api.impl.campaign.fleets.RouteManager.advance(RouteManager.java:572)
at com.fs.starfarer.api.impl.campaign.CoreScript.advance(CoreScript.java:126)
Line 143
Code
quality += Global.getSector().getFaction(factionId).getDoctrine().getShipQualityContribution();
Line 3471
Code
		return ShipQuality.getShipQuality(market, factionId);
Line 144
Code
this.quality = Misc.getShipQuality(source, factionId);
Line 122
Code
updateQualityAndProducerFromSourceMarket()
Line 83
Code
init(source, fleetType, factionId, combatPts, freighterPts, tankerPts, transportPts, linerPts, utilityPts, qualityMod);
Line 293-306
Code
		FleetParamsV3 params = new FleetParamsV3(
market,
null, // loc in hyper; don't need if have market
"mayasuran_guard",
route.getQualityOverride(), // quality override
fleetType,
combat, // combatPts
freighter, // freighterPts
tanker, // tankerPts
0f, // transportPts
0f, // linerPts
0f, // utilityPts
0f // qualityMod - since the Lion's Guard is in a different-faction market, counter that penalty
);
Line 614
Code
data.activeFleet = data.spawner.spawnFleet(data);
Line 572
Code
spawnAndDespawn();
Line 126
Code
RouteManager.getInstance().advance(amount);
I'm guessing it is the ship's quality? But I haven't had a clue to explain a fix. I've attached a .zip to see the code in question.

[attachment deleted by admin]
« Last Edit: January 03, 2020, 11:23:18 AM by Techpriest »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5905 on: January 03, 2020, 11:24:44 AM »

Does this faction exist?

"mayasuran_guard"

And does it have a doctrine defined in the .faction file?

An NPE on this line:
quality += Global.getSector().getFaction(factionId).getDoctrine().getShipQualityContribution();

Means that either:
Global.getSector()
Returned null (very unlikely, other things would be super broken if this was the case)

OR
Global.getSector().getFaction(factionId)
Returned null (i.e. if the faction doesn't exist)

OR
Global.getSector().getFaction(factionId).getDoctrine()
Returned null (i.e. possibly if the doctrine wasn't defined)

For this exception, these are the only possibilities. E.G. if something went wrong *inside* any of the methods in that line, the stack trace would be different.

Thank you for the detailed post, btw. Makes it a lot easier to see what's going on!
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5906 on: January 03, 2020, 01:01:09 PM »

Does this faction exist?

"mayasuran_guard"

And does it have a doctrine defined in the .faction file?

An NPE on this line:
quality += Global.getSector().getFaction(factionId).getDoctrine().getShipQualityContribution();

Means that either:
Global.getSector()
Returned null (very unlikely, other things would be super broken if this was the case)

OR
Global.getSector().getFaction(factionId)
Returned null (i.e. if the faction doesn't exist)

OR
Global.getSector().getFaction(factionId).getDoctrine()
Returned null (i.e. possibly if the doctrine wasn't defined)

For this exception, these are the only possibilities. E.G. if something went wrong *inside* any of the methods in that line, the stack trace would be different.

Thank you for the detailed post, btw. Makes it a lot easier to see what's going on!
Code
{
id:"mayasuran_guard",
"color":[0,41,120,255],
"displayName":"Elite Mayasurian Guard",
"displayNameWithArticle":"the Elite Mayasurian Guard",
"logo":"graphics/factions/mayasura.png",
"showInIntelTab":false,
"shipNamePrefix":"EMGS",
"shipNameSources":{
"MERCANTILE":1,
"SPACE":1,
#"GENERAL":1,
},
"names":{
"modern":3,
"future":2,
"slammers":1,
},

# variantOverrides restricts hulls to listed variants and adjusts their probability
    "variantOverrides":{
    },

    # multiplier for how often hulls show up in the faction's fleets
    "hullFrequency":{
        "tags":{"mayasura_e_bp": 10, "mayasura_bp":9, "midline_bp":4},
        "hulls":{
            "MSS_Mokarran":10,
            "MSS_Javanicus_B":10,
"MSS_Arjuna":10,
"conquest":10,
"MSS_Pelican":10,

"falcon":10,
"heron":10,
            "MSS_Sarissa":10,
"eagle":10,
            "MSS_Winghead":10,
"gryphon":10,
            "MSS_Pilgrim":10,
"MSS_Patriot":10,
"MSS_Nebulosa":10,
"MSS_Moa":10,
"MSS_Excalibur":10,

            "MSS_Hammerhead":10,
"hammerhead":10,
            "MSS_Argentavis":10,
            "MSS_Sunder":10,
"sunder":10,
            "MSS_Stingray":10,
"drover":10,

"MSS_Tiburo":10,
            "MSS_Perryi_F":10,
"brawler":10,
"centurion":10,
            "MSS_Mako":10,
            "MSS_Nailer":10,
"vigilance":10,
"MSS_vigilance_m":10,
"MSS_vigilance_carrier":10,
        },
    },

    # ships the faction gets access to when importing S&W out-of-faction
    "shipsWhenImporting":{
        "tags":["base_bp", "midline_bp", "hightech_bp", "mayasura_bp"],
        "hulls":[
            "MSS_Mokarran",
            "MSS_Javanicus_B",
"MSS_Arjuna",
"MSS_Pelican",
"conquest",
"atlas",
"prometheus",

            "MSS_Sarissa",
            "MSS_Winghead",
            "MSS_Pilgrim",
"MSS_Patriot",
"MSS_Moa",
"MSS_Excalibur",
"MSS_Nebulosa",
"eagle",
"gryphon",
"heron",


            "MSS_Hammerhead",
            "MSS_Argentavis",
            "MSS_Sunder",
            "MSS_Stingray",
"MSS_Manta",
"valkyrie",


"MSS_Tiburo",
            "MSS_Perryi_F",
            "MSS_Mako",
            "MSS_Nailer",
"MSS_vigilance_m",
"MSS_vigilance_carrier",
        ],
    },

    "knownShips":{
        "tags":["mayasura_e_bp"],
        "hulls":[
        ],
    },

    # listing ships here will make the faction mostly use them even if other hulls become available
    "priorityShips":{
        "tags":["mayasura_e_bp"],
        "hulls":[
        ],
    },

    "knownFighters":{
        "tags":["base_bp", "mayasura_bp"],
        "fighters":[
"MSS_Crow",
"MSS_Tachi",
"MSS_Sipahi",
"MSS_Ferox",
"MSS_Crossbow",
"MSS_Stormbreaker",
"xyphos_wing",
"thunder_wing",
"claw_wing",
"hoplon_wing",
"trident_wing",
"longbow_wing",
        ],
    },

    "priorityFighters":{
        "tags":["midline_bp"],
        "fighters":[
"MSS_Crow",
"MSS_Tachi",
"MSS_Sipahi",
"MSS_Ferox",
"MSS_Crossbow",
        ],
    },


"knownWeapons":{
"tags":["base_bp", "lowtech_bp", "midline_bp", "missile_bp", "hightech_bp", "persean"],
"weapons":[
"MSS_Orchard",
"MSS_onocrotalus",
"MSS_rocketlauncher",
"MSS_ionlance",
"railgun",
"dualflak",
"heavymauler",
"hveldriver",
"gauss",
"mjolnir",
"sabotpod",
"phasecl",
"cyclone",
"hurricane",
"squall",
"locust",
"pdburst",
"amblaster",
"phasebeam",
"heavyblaster",
"heavyburst",
"ionpulser",
"ionbeam",
"plasma",
"guardian",
],
},
"priorityWeapons":{
"tags":[],
"weapons":[
"MSS_Orchard",
"MSS_onocrotalus",
"MSS_rocketlauncher",
"MSS_ionlance",
],
},
"knownHullMods":{
"tags":["base_bp", "persean"],
"hullMods":[
"advancedshieldemitter", # accelerated
"turretgyros",
"armoredweapons",
"augmentedengines",
"autorepair",
"converted_hangar",
"eccm",
"ecm",
"expanded_deck_crew",
"magazines",
"missleracks",
"extendedshieldemitter",
"frontemitter",
"frontshield",  # makeshift
"hardenedshieldemitter",
"heavyarmor",
"insulatedengine",
"targetingunit",
"nav_relay",
"adaptiveshields", # omni
"operations_center",
"recovery_shuttles",
"fluxbreakers",
"stabilizedshieldemitter",
"surveying_equipment",
"hiressensors",
"efficiency_overhaul",
],
},
"factionDoctrine":{
"warships":3,
"carriers":3,
"phaseShips":1,

"officerQuality":5,
"shipQuality":5,
"numShips":3,

"shipSize":3,

"aggression":2,

"combatFreighterProbability":0.5,      # instead of some portion of the freighters in a fleet
"combatFreighterCombatUseFraction":0.5, # as part of the normal combat lineup
"combatFreighterCombatUseFractionWhenPriority":1,   # as part of normal combat lineup, when marked as priority ship
"autofitRandomizeProbability":0.25,

"commanderSkillsShuffleProbability":0,
"commanderSkills":[
"officer_management",
],
},
"illegalCommodities":[
"drugs",
"organs",
"ai_cores",
],
"portraits":{
"standard_male":[
"graphics/portraits/portrait_league01.png",
"graphics/portraits/portrait_league02.png",
"graphics/portraits/portrait_league03.png",
"graphics/portraits/portrait_league06.png",
"graphics/portraits/portrait12.png",
"graphics/portraits/portrait13.png",
"graphics/portraits/portrait15.png",
"graphics/portraits/portrait17.png",
"graphics/portraits/portrait18.png",
"graphics/portraits/portrait20.png",
"graphics/portraits/portrait25.png",
"graphics/portraits/portrait26.png",
"graphics/portraits/portrait30.png",
"graphics/portraits/portrait31.png",
"graphics/portraits/portrait33.png",
"graphics/portraits/portrait35.png",
],
"standard_female":[
"graphics/portraits/portrait_league00.png",
"graphics/portraits/portrait_league04.png",
"graphics/portraits/portrait_league05.png",
"graphics/portraits/portrait_mercenary02.png",
"graphics/portraits/portrait_mercenary05.png",
"graphics/portraits/portrait14.png",
"graphics/portraits/portrait16.png",
"graphics/portraits/portrait21.png",
"graphics/portraits/portrait22.png",
"graphics/portraits/portrait27.png",
"graphics/portraits/portrait28.png",
"graphics/portraits/portrait29.png",
"graphics/portraits/portrait32.png",
"graphics/portraits/portrait34.png",
"graphics/portraits/portrait37.png",
"graphics/portraits/portrait39.png",
],
},
"fleetTypeNames":{
"patrolSmall":"Elite Mayasuran Company",
"patrolMedium":"Elite Mayasuran Battalion",
"patrolLarge":"Elite Mayasuran Division",
},
},
They should? The .faction file uses this. I'm not sure if the starsector.log should spit out some error if there were typos in the .faction file, but I'll check.

Edit: Okay the faction doesn't exist via console command that explains a lot now. I'll need to make an edit in .factions csv!
« Last Edit: January 03, 2020, 01:30:30 PM by Techpriest »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5907 on: January 03, 2020, 01:30:09 PM »

Did you add it to factions.csv?
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5908 on: January 03, 2020, 03:04:14 PM »

Did you add it to factions.csv?
Yup that fixed everything!

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5909 on: January 03, 2020, 03:44:51 PM »

Is it possible to let Mod Info.json be able to use Replace for data files in the .jar that usually have the file path for com.fs.starfarer.api...?

My inquiry is that Better Colonies is only able to replace vanilla Orbital Stations, but they're unable to replace the modded Orbital Stations from other factions because these stations still refer to com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.java, and a good solution would be able to have the Mod Info.json replace com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.java outright or tell it not to load in the core files so that my mod is able to seamlessly integrate with modded Orbital Station as well.

Just a thought that occurred:

For each modded station type you wanted to merge with Better Colonies, could you add your own csv entries for each station industry copy from the mod in question and give it a unique industry id so it would merge with other mods industries.csv? That way, in that entry you can call your custom implementation of com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.java

Then you can use a procedural script under onNewGameAfterEconomyLoad() to check for the original industry id from each station in the campaign and replace it with the industry id that will call your mod's OrbitalStation.java replacement.

However some friendly advice:

That kind of implementation requires you to copy other modders industries which to some modders could be considered intrusively changing their mod since other values in the industry entry might change in later updates of their mod that would have to be reflected into the copies of your industry entries with the unique id (each time it changes on their end).

So if wanting to do this, please get permission from the mod author for each mod you want to do this with and make sure they understand the full consequences of what that entails. It will create a soft dependency to maintain compatibility and prevent unintended inconsistency when the two mods are both present on a mod list.

That being said, you have my permission to do this with Archean Order stations and I'll try to remember to update you with any changes I make in the future to the industries.csv entries for my stations.  :)
« Last Edit: January 03, 2020, 03:46:48 PM by Morrokain »
Logged
Pages: 1 ... 392 393 [394] 395 396 ... 710