Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Adding an Industry  (Read 2757 times)

SomeDegenerate

  • Ensign
  • *
  • Posts: 15
  • Credit to TerminalMontage on YouTube for the PfP
    • View Profile
Adding an Industry
« on: October 21, 2019, 07:29:17 AM »

I didn't see this topic anywhere else on the boards, so I decided to make my own thread. As the title suggests, I'm trying to add an industry to Starsector, specifically a structure. Currently in my mod folder I have a data\industries.csv file with my industry in it, which points to my "[MODFOLDERNAME].data.scripts.[INDUSTRYSCRIPT].java and my graphics\[INDUSTRYNAME].png file, but when I load an existing save where I have a colony established it doesn't show up in the menu. My question is what I'm missing, what elements do I need to make an industry in Starsector?

I can post screenshots of my filepath and the script that adds and removes my industry if necessary. I've tried to model my industry after the structures in the game, so the [INDUSTRYSCRIPT].java extends BaseIndustry.

Thanks in advance!
Logged
Roses are red, violets are blue. I'm complete garbage, how about you?

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Adding an Industry
« Reply #1 on: October 21, 2019, 07:37:59 AM »

Now I don't think I need to ask this, but have you checked that you enabled the mod?

SomeDegenerate

  • Ensign
  • *
  • Posts: 15
  • Credit to TerminalMontage on YouTube for the PfP
    • View Profile
Re: Adding an Industry
« Reply #2 on: October 21, 2019, 07:50:10 AM »

Indeed I have, though I can see where the question comes from, lol. Honestly I'm absent-minded enough to forget something like that - especially seeing as I've only just set up the mod plugin properly to read the csv...maybe.

So maybe that was the problem, let me see here...
Logged
Roses are red, violets are blue. I'm complete garbage, how about you?

SomeDegenerate

  • Ensign
  • *
  • Posts: 15
  • Credit to TerminalMontage on YouTube for the PfP
    • View Profile
Re: Adding an Industry
« Reply #3 on: October 21, 2019, 07:54:38 AM »

Aaaaaand we have several exceptions and...no mention of my mod plugin despite the fact that the error message says that the crash was due to my mod. Lovely.

I'm gonna do some detective work, but if anyone knows how industries work and what they need I would appreciate it!
Logged
Roses are red, violets are blue. I'm complete garbage, how about you?

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Adding an Industry
« Reply #4 on: October 21, 2019, 05:32:24 PM »

When you're making your mod, have you been using a compiler to make a .jar file? You kind of need to compile the modPlugin and extensions to baseIndustry in order for the game to use it. You'll also need to add in the path to the modPlugin in the mod_info.json.

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: Adding an Industry
« Reply #5 on: October 21, 2019, 08:09:47 PM »

Read this for a how-to regarding setting up your system for debugging mods. 
https://fractalsoftworks.com/forum/index.php?topic=10057.0
« Last Edit: October 28, 2019, 06:33:53 PM by Nick XR »
Logged

SomeDegenerate

  • Ensign
  • *
  • Posts: 15
  • Credit to TerminalMontage on YouTube for the PfP
    • View Profile
Re: Adding an Industry
« Reply #6 on: October 28, 2019, 06:33:44 AM »

When you're making your mod, have you been using a compiler to make a .jar file? You kind of need to compile the modPlugin and extensions to baseIndustry in order for the game to use it. You'll also need to add in the path to the modPlugin in the mod_info.json.

How do you mean, compile to baseIndustry? Do you just mean compile my industry class, which extends BaseIndustry? If so, then yes, I have been doing that - I compile all of my classes (of which there are two - ColonyRelays.ColonyRelay, which is the actual industry file that extends BaseIndustry, and data.campaign.ids.ColonyRelays_Industry, which is a java file simply containing the public static final String COLONYRELAY = "colonyrelays" (the id of my industry in the industries.csv file)) into a .jar, which I then feed into the mod_info.json file.

I also have no Mod Plugin, because as far as I can tell from looking at other mods that implement new industries (Blackrock Driveyards and Shadowyards, to name two) nothing in the plugin serves to initialize industry. Unless I just need an empty plugin file for...some reason?

Read this for a how-to regarding setting up your system for debugging mods. 

Sorry, I don't see a link - could you send that again?

In other news, I have actually done a bit of digging and as it turns out, my industry isn't recognized at all - praise for LazyWizard and his console. Now it's just a matter of figuring out why it's not being recognized...
Logged
Roses are red, violets are blue. I'm complete garbage, how about you?