Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: Uniquifying the Factions, Part 2 (04/30/22)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Frezeh

Pages: [1]
1
Hey, I'm a fairly new to modding (and programming in general), and in the process of making a PD Integration mod for a few PD focused ships I'm having some trouble.  I keep getting the following error when trying to launch.

Fatal: Error loading [data.hullmods.KiloPD]
Cause: File 'data/hullmods/KiloPD.java', Line 15 Column 34: Unknown variable or type "Stats.SMALL_PD_MOD"


Log file had this to say

Spoiler
Caused by: java.lang.ClassNotFoundException: File 'data/hullmods/KiloPD.java', Line 14, Column 34: Unknown variable or type "Stats.SMALL_PD_MOD"
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:226)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:178)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
Caused by: org.codehaus.commons.compiler.CompileException: File 'data/hullmods/KiloPD.java', Line 14, Column 34: Unknown variable or type "Stats.SMALL_PD_MOD"
   at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10174)
   at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5424)
   at org.codehaus.janino.UnitCompiler.access$12300(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$16.visitPackage(UnitCompiler.java:5115)
   at org.codehaus.janino.Java$Package.accept(Java.java:3164)
   at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5159)
   at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5419)
   at org.codehaus.janino.UnitCompiler.access$15400(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$16.visitAmbiguousName(UnitCompiler.java:5149)
   at org.codehaus.janino.Java$AmbiguousName.accept(Java.java:3135)
   at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5159)
   at org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable(UnitCompiler.java:7533)
   at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:7429)
   at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:7333)
   at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5663)
   at org.codehaus.janino.UnitCompiler.access$13800(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:5132)
   at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:3971)
   at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5159)
   at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:7333)
   at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:3873)
   at org.codehaus.janino.UnitCompiler.access$6900(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$10.visitMethodInvocation(UnitCompiler.java:3263)
   at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:3974)
   at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3290)
   at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:4368)
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2662)
   at org.codehaus.janino.UnitCompiler.access$4400(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$7.visitMethodInvocation(UnitCompiler.java:2627)
   at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:3974)
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2654)
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:1643)
   at org.codehaus.janino.UnitCompiler.access$1100(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$4.visitExpressionStatement(UnitCompiler.java:936)
   at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java:2097)
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:958)
   at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1007)
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2293)
   at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:822)
   at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:794)
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:507)
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:393)
   at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:347)
   at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1139)
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:354)
   at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:322)
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:224)
   ... 5 more
[close]

With some testing I found that the variables, "MEDIUM_PD_MOD" and "LARGE_PD_MOD" also got me the same results. The current hullmod code found bellow.
Code
package data.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;

public class KiloPD extends BaseHullMod {

private static final int PD_S_OP = 2;
private static final int PD_M_OP = 4;
private static final int PD_L_OP = 8;

public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getDynamic().getMod(Stats.SMALL_PD_MOD).modifyFlat(id, -PD_S_OP);
stats.getDynamic().getMod(Stats.MEDIUM_PD_MOD).modifyFlat(id, -PD_M_OP);
stats.getDynamic().getMod(Stats.LARGE_PD_MOD).modifyFlat(id, -PD_L_OP);
}

@Override
public boolean affectsOPCosts() {
return true;
}


}

2
Hey, there seems to be a problem with the current HMI version. Trying to launch with it enabled leads to the following error in the log.

6620 [Thread-3] ERROR com.fs.starfarer.loading.SpecStore  - Ship system [hmi_recalldevice] not found in ship_systems.csv

I checked the ship_systems.csv file and the error is correct, It's not there.

Pages: [1]