1
Modding / Re: Misc modding questions that are too minor to warrant their own thread
« on: January 06, 2024, 06:55:35 AM »
Crikey!
Dunno how I missed that. Thanks.
Dunno how I missed that. Thanks.
Starsector 0.97a is out! (02/02/24); New blog post: Save/Load UI, Autosave, Intel Map Markers, and More (04/10/24)
37963 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain - java.lang.RuntimeException: Error loading [data.hullmods.MediumBallisticsIntegration]
java.lang.RuntimeException: Error loading [data.hullmods.MediumBallisticsIntegration]
at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Inconsistent constant value type in class file data/hullmods/MediumBallisticsIntegration
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.codehaus.janino.JavaSourceClassLoader.defineBytecode(JavaSourceClassLoader.java:244)
at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:194)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
package data.hullmods;
import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import com.fs.starfarer.api.impl.campaign.ids.Stats;
public class MediumBallisticsIntegration extends BaseHullMod {
public static final float COST_REDUCTION = 3;
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getDynamic().getMod(Stats.MEDIUM_BALLISTIC_MOD).modifyFlat(id, -COST_REDUCTION);
}
public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "" + (int) COST_REDUCTION + "";
return null;
}
@Override
public boolean affectsOPCosts() {
return true;
}
}
Question - there are some older mods that I still like to use so I modify them myself. One of the thing I did was alter the hullmods for the new S-mod thing.
I edited both the java files of hullmods to the add the if (sMod) branch and the hullmods.cvs to add the SModDesc descriptions, but in-game no S-mod description show up, nor even the S-mod ui category. Am I missing something?
Hmm, nothing else comes to mind. Make sure the hullmod class is extending BaseHullMod - though if it wasn't, I think you'd have noticed due to other problems, so that's probably not it.
... are you testing this in the main menu? S-mod stuff only shows up in the campaign.
What's the mod called and link?"Take No Prisoners" and it's discord exclusive.
How to get:Using these collections you should be able to fill a WeightedRandomPicker or other collection with systems or markets that meet your criteria:
a) a valid random system with an asteroid field/ring
b) a valid random marketCode: javaGlobal.getSector().getEconomy().getMarketsCopy();
Global.getSector().getStarSystems();