Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 480 481 [482] 483 484 ... 711

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7215 on: April 07, 2021, 09:43:40 AM »

Thoughts?

Hard to say - what you're doing seems like it should work conceptually. I'd suggest adding some debugging print statements or connecting with a debugger.

@Reviire:  Unfortunately, you can only replace that class via CoreCampaignPluginImpl... which you can replace via SectorGen.  In short, it will work, but it will basically break compatibility with anything else that depends on either thing being <some special way>.

(Ah, that's incorrect - you can add your own campaign plugin and return a BattleCreationPlugin version with a higher priority than the default campaign one.)


Where does getAllowZeroFluxAtAnyLevel get checked for zero flux boost? I'm trying to understand and tinker with the helmsmanship elite bonus.

In core code that's not directly accessible.

How do you make fighters spawn from defined launch bays instead of just in the middle of the ship?

I defined two launchbays, yet the fighter wings just spawn at the center of the ship and ignore them completely

Hmm - I don't think you can. It's somewhere in the "modding requests" pile...
Logged

Twogs

  • Lieutenant
  • **
  • Posts: 76
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7216 on: April 07, 2021, 12:21:14 PM »

How do you make fighters spawn from defined launch bays instead of just in the middle of the ship?

I defined two launchbays, yet the fighter wings just spawn at the center of the ship and ignore them completely

Hmm - I don't think you can. It's somewhere in the "modding requests" pile...

Ok thanks for the answer : )
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7217 on: April 07, 2021, 12:44:52 PM »

Okay, I've got a bit of a weird issue with my custom industries and I'm not sure how to fix it. Basically I'm not able to install the special items that I've got set up; the basic setup for the industry is very similar to the default Heavy Industry setup, with some specific stuff to account for the industry in question (Modular Fabricators) being able to be changed to a number of specialized sub-variants, for which I've got a number of yet to be tested special items which should hopefully be usable to start the process of upgrading the facility.

However, the Fabricators lack the option to install special items, being limited to story point linked output improvement, adding AI Cores, and shutting it down; it's not very clear why this should be the case, since the game is definitely finding the special item data (and indeed, I had to set up localized versions of GenericSpecialItemPlugin and ItemEffectsRepo in order to avoid getting Null Errors) so I figured I might as well ask here and see if anyone had any ideas. It's a little hard to be specific when it comes down to it though, since the game isn't giving me a lot to go on.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7218 on: April 07, 2021, 12:58:35 PM »

Looks like the relevant code for that is in BaseIndustry.java:
Code
	public boolean wantsToUseSpecialItem(SpecialItemData data) {
if (special != null) return false;
SpecialItemSpecAPI spec = Global.getSettings().getSpecialItemSpec(data.getId());
String [] industries = spec.getParams().split(",");
Set<String> all = new HashSet<String>();
for (String ind: industries) all.add(ind.trim());
return all.contains(getId());
}
Which suggests that you need the industry ID in the plugin params field of special_items.csv - assuming that your industry doesn't override that particular method?

If that doesn't work, for a first cut at making this do anything, I might try overriding that method in your industry with a simple "return true;" and see if that does the expected thing of letting you install any item.
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7219 on: April 07, 2021, 01:04:39 PM »

Right! You need the id (or ids, comma-separated) in the plugin params column.

The BaseIndustry.getInstallableItems() method is the relevant here, btw - wantsToUseSpecialItem() actually determines whether the industry will slot this item in if it's sold to the colony by the player.
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7220 on: April 07, 2021, 01:22:26 PM »

I do have the plugin params set up correctly, so my best guess given what you've said is that my implementation is somehow bypassing that. Time to go through and do a comparison I guess.

E: Okay, the only one of the BaseIndustry methods I was using that looks for plugin params was wantsToUseSpecialItem, but even commenting that out didn't actually resolve the issue; I may have to just abandon trying to use the vanilla implementation entirely =/
« Last Edit: April 07, 2021, 01:39:30 PM by MShadowy »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7221 on: April 07, 2021, 01:39:00 PM »

Ah, taking another look - your item effect needs to be added to ItemEffectsRepo.ITEM_EFFECTS.

See: GenericInstallableItemPlugin.isInstallableItem()
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7222 on: April 07, 2021, 01:50:41 PM »

... so, just like extend ItemEffectsRepo and change the existend item effects map I have to ITEM_EFFECTS or something?
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7223 on: April 07, 2021, 01:53:55 PM »

Ah, interesting - I missed that stuff too. (Been taking a look at what I'd need to do to mod the required resources for the shunt tap or the orbital furnace down to a more reasonable 8. Don't have it working yet, though.)
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7224 on: April 07, 2021, 02:10:57 PM »

... so, just like extend ItemEffectsRepo and change the existend item effects map I have to ITEM_EFFECTS or something?

No, just add your item effect to ITEM_EFFECTS - it's a public static data member, so you don't need to extend the class to access it.
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7225 on: April 07, 2021, 03:32:20 PM »

Ah, Alex, out of curiosity it seems like this is the sort of thing that can be merged into the existing class with a static {}, but that delivers nulls on starting a new game; is that a bug or did you have a different approach in mind?

E: Specifically a null at super.apply(), to be clear.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7226 on: April 07, 2021, 03:35:06 PM »

That should indeed work in a static block. I'd need to see the exception to say more; based on what you're saying I don't think the error is related to the static block where you add the effect.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7227 on: April 07, 2021, 04:02:25 PM »

Quote
(Ah, that's incorrect - you can add your own campaign plugin and return a BattleCreationPlugin version with a higher priority than the default campaign one.)
Oh, OK!

So, Reviire, sorry to provide incorrect info there. You can create a CampaignPlugin (and turn it on via settings.json) and then use:

Code
	public PluginPick<BattleCreationPlugin> pickBattleCreationPlugin(SectorEntityToken opponent) {

return new PluginPick<BattleCreationPlugin>(new BattleCreationPlugin_YOU_WROTE_HERE(), PickPriority.MOD_SPECIFIC);
}

Just use BattleCreationPluginImpl as a base (I presume you already have) and you're good.

That's nice and simple :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7228 on: April 07, 2021, 04:14:36 PM »

Weird; it works inside the onNewGame() method though, which seems a little strange. Also probably not the ideal method to apply it.

Checking the log more closely gives an error starting at line 22 of BoostIndustryInstallableItemEffect, which indicates it's somehow not getting the supply bonus, which is causing the super to fail in the very next step. I'm not sure why that would be the case though, since the variables are all pretty clearly set up.

E: It may be a result of the industry having its supply outputs all be variables effected by a bunch of if statements, not supplyBonuses, derp.
« Last Edit: April 07, 2021, 04:51:32 PM by MShadowy »
Logged

superjosh250

  • Lieutenant
  • **
  • Posts: 85
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7229 on: April 07, 2021, 05:48:21 PM »

I have a stupid question. I'm aware of creating planets and adding market conditions and industries. I was wondering if it was possible to add special_items to the planet market. Say for instance, I have farming as industry for the planet in the json. Is it possible to also have soil_nanites installed in the market, the same as the farming industry?
Logged
Pages: 1 ... 480 481 [482] 483 484 ... 711