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: Out of Bounds exceptions  (Read 3963 times)

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Out of Bounds exceptions
« on: May 21, 2015, 12:25:38 PM »

Help please! :D

21235 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_generic_market_02_hostile.ogg]
21237 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_pirate_encounter_01_neutral.ogg]
21237 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_generic_market_01_neutral.ogg]
21238 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_generic_market_01_neutral.ogg]
21238 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_pirate_market_01_neutral.ogg]
21239 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_pirate_encounter_02_hostile.ogg]
21240 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_generic_market_01_neutral.ogg]
21240 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_pirate_market_02_hostile.ogg]
21241 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [music-faction_pirate_encounter_03_friendly.ogg]
21242 [Thread-5] INFO  sound.O  - Creating streaming player for music with id [StianStark-Starfarer-Exploration_Alpha.ogg]
21380 [Thread-5] ERROR com.fs.starfarer.combat.D  - java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.rangeCheck(Unknown Source)
   at java.util.ArrayList.get(Unknown Source)
   at sound.float.<init>(Unknown Source)
   at sound.O.<init>(Unknown Source)
   at sound.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
   at sound.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
   at com.fs.starfarer.loading.L.Ø00000(Unknown Source)
   at com.fs.starfarer.loading.L.o00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.o00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.oO0000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.ö00000(Unknown Source)
   at com.fs.starfarer.loading.G.super(Unknown Source)
   at com.fs.oOOO.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.D.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #1 on: May 21, 2015, 12:32:22 PM »

nvm, fixed that one! Was an issue with the Sounds.JSON data XD
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #2 on: May 21, 2015, 12:37:47 PM »

New error though,

13433 [Thread-5] ERROR com.fs.starfarer.combat.D  - java.lang.RuntimeException: Error compiling [data.scripts.plugins.ArmorPiercePlugin]
java.lang.RuntimeException: Error compiling [data.scripts.plugins.ArmorPiercePlugin]
at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: File 'data/scripts/plugins/ArmorPiercePlugin.java', Line 21, Column 13: Non-abstract class "data.scripts.plugins.ArmorPiercePlugin" must implement method "public abstract void com.fs.starfarer.api.combat.EveryFrameCombatPlugin.renderInWorldCoords(com.fs.starfarer.api.combat.ViewportAPI)"
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/scripts/plugins/ArmorPiercePlugin.java', Line 21, Column 13: Non-abstract class "data.scripts.plugins.ArmorPiercePlugin" must implement method "public abstract void com.fs.starfarer.api.combat.EveryFrameCombatPlugin.renderInWorldCoords(com.fs.starfarer.api.combat.ViewportAPI)"
at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10174)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:419)
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


Line 21 is:

public class ArmorPiercePlugin implements EveryFrameCombatPlugin
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Out of Bounds exceptions
« Reply #3 on: May 21, 2015, 03:39:31 PM »

Change implements to extends.

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #4 on: May 22, 2015, 10:19:16 AM »

Change implements to extends.

Is it really that easy xD
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #5 on: May 22, 2015, 10:58:19 AM »

New Error:

133866 [Thread-5] ERROR com.fs.starfarer.combat.D  - java.lang.RuntimeException: Error compiling [data.scripts.plugins.ArmorPiercePlugin]
java.lang.RuntimeException: Error compiling [data.scripts.plugins.ArmorPiercePlugin]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: File 'data/scripts/plugins/ArmorPiercePlugin.java', Line 21, Column 13: "com.fs.starfarer.api.combat.EveryFrameCombatPlugin" is an interface; classes can only extend a class
   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/scripts/plugins/ArmorPiercePlugin.java', Line 21, Column 13: "com.fs.starfarer.api.combat.EveryFrameCombatPlugin" is an interface; classes can only extend a class
   at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10174)
   at org.codehaus.janino.UnitCompiler.access$17100(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$29.getSuperclass2(UnitCompiler.java:8156)
   at org.codehaus.janino.IClass.getSuperclass(IClass.java:406)
   at org.codehaus.janino.IClass.findMemberType(IClass.java:766)
   at org.codehaus.janino.IClass.findMemberType(IClass.java:733)
   at org.codehaus.janino.UnitCompiler.findMemberType(UnitCompiler.java:10116)
   at org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5300)
   at org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:5207)
   at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:5188)
   at org.codehaus.janino.UnitCompiler.access$12600(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$16.visitReferenceType(UnitCompiler.java:5119)
   at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2880)
   at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5159)
   at org.codehaus.janino.UnitCompiler.access$16700(UnitCompiler.java:185)
   at org.codehaus.janino.UnitCompiler$31.getParameterTypes2(UnitCompiler.java:8533)
   at org.codehaus.janino.IClass$IInvocable.getParameterTypes(IClass.java:835)
   at org.codehaus.janino.IClass$IMethod.getDescriptor2(IClass.java:1063)
   at org.codehaus.janino.IClass$IInvocable.getDescriptor(IClass.java:849)
   at org.codehaus.janino.IClass.getIMethods(IClass.java:211)
   at org.codehaus.janino.IClass.getIMethods(IClass.java:199)
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:409)
   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
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Out of Bounds exceptions
« Reply #6 on: May 22, 2015, 11:15:24 AM »

Quote
Caused by: java.lang.ClassNotFoundException: File 'data/scripts/plugins/ArmorPiercePlugin.java', Line 21, Column 13: "com.fs.starfarer.api.combat.EveryFrameCombatPlugin" is an interface; classes can only extend a class
Please read the error before asking for help; this is something where you need to read a bit of the Java documentation to understand where you went wrong :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #7 on: May 22, 2015, 11:38:28 AM »

The problem is, It's not my script, So i've no idea how to fix it haha
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Out of Bounds exceptions
« Reply #8 on: May 22, 2015, 12:38:35 PM »

It says that the error's on line 21, and it says what the error is: 
Quote
"com.fs.starfarer.api.combat.EveryFrameCombatPlugin" is an interface; classes can only extend a class
So you probably need to change your class definition to:
Code: java
public class ArmorPiercePlugin implements EveryFrameCombatPlugin
Which may cause other problems, depending on what you're doing.  Really time to learn some Java, though, if you're going to try and mess with code at all; you can't just throw in a few scripts to a mod willy-nilly and have it work, beyond very basic stuff.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #9 on: May 22, 2015, 12:40:22 PM »

Thing is, it USED to work perfectly. But since the game has updated, it doesn't work :/
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Out of Bounds exceptions
« Reply #10 on: May 22, 2015, 12:56:00 PM »

To be frank, with that error, it probably didn't work as written then, either; EveryFrameCombatPlugin has always been an Interface.  So I have no idea how it would now be broken, but you're really going to need to sit down with LazyWizard's tutorial on how to set up Java and check your code for errors :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #11 on: May 22, 2015, 12:56:44 PM »

Drat, thing is, it's lazy's script too haha
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Out of Bounds exceptions
« Reply #12 on: May 22, 2015, 12:59:27 PM »

Well, it may have been something he wrote but didn't test or whatnot, waaaay back in the day :)

Anyhow, here's the link to the guide.  NetBeans will show you the errors in the code and you will find debugging a lot easier if you use that from the start.  I used to not bother using an IDE, back in the day, because I have, like, 5 of them set up for things here and I didn't want to spend the time, but it's ended up saving a lot of time in the end, because of how Java works and how the error messages from SS work.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Out of Bounds exceptions
« Reply #13 on: May 22, 2015, 01:00:57 PM »

It was tested and working etc.

Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)