Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Log Error Assistance (Code included)  (Read 2001 times)

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Log Error Assistance (Code included)
« on: July 22, 2012, 12:02:29 AM »

Quick question, I am receiving this error message after adding a new spawn point for the Tri-Tachyons:

Code
8965 [Thread-6] ERROR com.fs.starfarer.combat.D  - java.lang.RuntimeException: Error compiling [data.scripts.world.ArcheusSectorGen]
java.lang.RuntimeException: Error compiling [data.scripts.world.ArcheusSectorGen]
at com.fs.starfarer.loading.scripts.ScriptStore$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: Compiling unit "data/scripts/world/ArcheusSectorGen.java"
at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:205)
at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:157)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 2 more
Caused by: org.codehaus.commons.compiler.CompileException: Source file "data/scripts/world/MilitaryTriTachyonSpawnPoint.java" does not declare class "data.scripts.world.MilitaryTriTachyonSpawnPoint"
at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:165)
at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:158)
at org.codehaus.janino.UnitCompiler.findClassByName(UnitCompiler.java:6054)
at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:4568)
at org.codehaus.janino.UnitCompiler.access$10300(UnitCompiler.java:104)
at org.codehaus.janino.UnitCompiler$17.visitReferenceType(UnitCompiler.java:4442)
at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2020)
at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:4476)
at org.codehaus.janino.UnitCompiler.getLocalVariable(UnitCompiler.java:1607)
at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java:2226)
at org.codehaus.janino.UnitCompiler.access$3700(UnitCompiler.java:104)
at org.codehaus.janino.UnitCompiler$7.visitLocalVariableDeclarationStatement(UnitCompiler.java:2141)
at org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.java:1771)
at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java:2144)
at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java:2105)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1946)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:789)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:770)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:464)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:357)
at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:312)
at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:770)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:319)
at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:288)
at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:203)
... 5 more

Now, I have tried making a new separate faction file for this particular department of the Tachyons and modifying the fleet compositions to be more militarized. Then in my generator file I add the spawn point at a new station close to Corvus (III?) where the corporate headquarters are. I have also made the specific spawn file that it references here:

Code
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;

import data.scripts.world.BaseSpawnPoint;

public class MilitaryTriTachyonSpawnPoint extends BaseSpawnPoint {

private final SectorEntityToken station;

public MilitaryTriTachyonSpawnPoint(SectorAPI sector, LocationAPI location,
float daysInterval, int maxFleets, SectorEntityToken anchor,
SectorEntityToken station) {
super(sector, location, daysInterval, maxFleets, anchor);
this.station = station;
}

@Override
protected CampaignFleetAPI spawnFleet() {
//if ((float) Math.random() < 0.5f) return null;

String type = null;
float r = (float) Math.random();
if (r > .8f) {
type = "scout";
} else if (r > 0.6f) {
type = "raiders";
} else if (r > 0.3f) {
type = "attackFleet";
} else {
type = "securityDetachment";
}

CampaignFleetAPI fleet = getSector().createFleet("militarytritachyon", type);
getLocation().spawnFleet(getAnchor(), 0, 0, fleet);

fleet.setPreferredResupplyLocation(getAnchor());

if (type.equals("scout") || type.equals("raiders") || type.equals("attackFleet")) {
fleet.addAssignment(FleetAssignment.RAID_SYSTEM, null, 30);
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN, getAnchor(), 1000);
} else {
if ((float) Math.random() > 0.3f) {
//fleet.addAssignment(FleetAssignment.RAID_SYSTEM, null, 30);
fleet.addAssignment(FleetAssignment.ATTACK_LOCATION, station, 50);
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN, getAnchor(), 1000);
} else {
fleet.addAssignment(FleetAssignment.DEFEND_LOCATION, getAnchor(), 20);
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN, getAnchor(), 1000);
}
}
return fleet;
}

}


So my question is... what in the heck does it mean by the generator file is not declaring a class for the spawn file???

Logged

DarkerThanBlack

  • Ensign
  • *
  • Posts: 19
  • void
    • View Profile
Re: Log Error Assistance (Code included)
« Reply #1 on: July 22, 2012, 03:01:23 AM »

if that's the entire class file then add this as the first line

package data.scripts.world;
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Log Error Assistance (Code included)
« Reply #2 on: July 22, 2012, 03:47:26 PM »

Its there it just did not fully paste  :-[

However your response still led me to see the error. The spawn file was copied from the original Tri-Tachyon spawn file.. which goes one further to indicate the corvus directory in starfarer-core\data. So the script read:

Code
package data.scripts.world.corvus;

instead of:

Code
package data.scripts.world;

So thanks!
Logged