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: Vector2f not recognized  (Read 1345 times)

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Vector2f not recognized
« on: December 23, 2020, 09:18:59 AM »

I have a mod I made about 4 years ago and I wanted to update it but I'm getting a "Cannot determine simple type of 'Vector2f'"

I believe I have the right import for the Vector2f class.

[Edit]. Now the error message is different.

Here is my class
http://s000.tinyupload.com/index.php?file_id=08048878206568048916

Here is the log
http://s000.tinyupload.com/index.php?file_id=28263378194853936554

The error message says :
Error compiling [data.scripts.weapons.SFB_PlasmaOnHitEffect]
java.lang.RuntimeException: Error compiling [data.scripts.weapons.SFB_PlasmaOnHitEffect]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: 1 error(s) while compiling unit "data/scripts/weapons/SFB_PlasmaOnHitEffect.java"
   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)


« Last Edit: January 04, 2021, 03:06:12 PM by rogerbacon »
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Re: Vector2f not recognized
« Reply #1 on: January 04, 2021, 09:52:32 AM »

I can't believe no one knows how to fix this issue. The script worked before and the method signature hasn't changed so what's up?
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Vector2f not recognized
« Reply #2 on: January 04, 2021, 10:17:08 AM »

you have not provided sufficient information to diagnose your issue.
provide the entire script and a crash log, including stack trace of the exact problem.
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Re: Vector2f not recognized
« Reply #3 on: January 04, 2021, 03:07:09 PM »

you have not provided sufficient information to diagnose your issue.
provide the entire script and a crash log, including stack trace of the exact problem.

OK. I've edited the first post to include the java class and the error log.
Logged

theDragn

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: Vector2f not recognized
« Reply #4 on: January 05, 2021, 12:01:17 AM »

You seem to have an excessive amount of imports. Most of those are unused. Try replacing all of them with the following:

package data.scripts.weapons;

import org.lwjgl.util.vector.Vector2f;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.DamagingProjectileAPI;
import com.fs.starfarer.api.combat.OnHitEffectPlugin;


If I had to guess (and I am guessing, because I did not have the same issue on my end when compiling it), the issue was import org.lwjgl.util.vector.ReadableVector2f
I would also suggest compiling your code into a jar using an IDE instead of compiling it at runtime.

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Vector2f not recognized
« Reply #5 on: January 05, 2021, 04:53:38 PM »

One of the imports was from the Templars mod (data.scripts.util.TEM_Twig); I don't know if Janino actually handles nonexistent imports.
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Re: Vector2f not recognized
« Reply #6 on: January 06, 2021, 11:50:32 AM »

OK, Thanks guys. It seems that the order of the import statements matter and if there is a problem with one maybe the others are skipped? I finally got it working with the suggestions above.
Logged