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)

Pages: 1 ... 564 565 [566] 567 568 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1700587 times)

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8475 on: February 03, 2022, 12:28:34 PM »

got a FleetAssignmentAI, activating an ability via fleet.getAbility().activate() only causes it to toggle for one or two frames, then deactivate it again.

It's irritating cause I want the fleet to use sustained burn to follow the player (Via FleetAssignment.ORBIT_PASSIVE, but any other results in the same...), and it just doesn't want to do it!

Any help is appreciated.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8476 on: February 03, 2022, 12:49:43 PM »

got a FleetAssignmentAI, activating an ability via fleet.getAbility().activate() only causes it to toggle for one or two frames, then deactivate it again.

It's irritating cause I want the fleet to use sustained burn to follow the player (Via FleetAssignment.ORBIT_PASSIVE, but any other results in the same...), and it just doesn't want to do it!

Any help is appreciated.

Hmm, if I had to make an offhand guess, I'd say there is probably a memory key that needs to be added to the FleetAPI that ensures that the ability stays active. There is probably a periodic check every couple of seconds and the engine is looking at the memory keys on the fleet for that FleetAssignment and going "oh sustained burn should be on for that fleet!" as a failsafe.

ORBIT_PASSIVE likely assumes that the fleet isn't going at the sustained burn speed and so will actively turn it off because the assumption is the fleet is orbiting a market or other SectorEntity, etc.

Assuming that's true, then the problem you might run into is that the keys related to sustained burn don't fall into a proper use case. I doubt it though because there is an AI state for fleet AI that has the fleet essentially do what you're describing - maintain contact with the player fleet without engaging with it or really doing anything else. However, come to think of it that might also cause the fleet to use the interdiction ability against the player fleet under certain circumstances since that state is technically a hostile one, so you might have to build something to prevent that.

I'd take a look, if possible, at the FleetAssignment for hostile fleets maintaining contact as a starting place for what you want to do.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8477 on: February 03, 2022, 12:53:01 PM »

...
Assignment does not have influence on this behaviour, it always aborts it regardless of assignment!
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8478 on: February 03, 2022, 04:35:51 PM »

Sounds like the Sustained Burn AI is turning it off.

A campaign plugin can assign a specific ability AI to a fleet, letting you override this behavior. Example from Nex:
Code: java
	@Override
public PluginPick<AbilityAIPlugin> pickAbilityAI(AbilityPlugin ability, ModularFleetAIAPI ai) {
if (ability == null) return null;
String id = ability.getId();
if (id == null) return null;
CampaignFleetAPI fleet = ai.getFleet();
if (fleet == null) return null;

if (id.equals(Abilities.TRANSPONDER) && fleet.getMemoryWithoutUpdate().getBoolean(AlwaysOnTransponderAI.MEMORY_KEY_ALWAYS_ON)) {
Global.getLogger(this.getClass()).info("Adding custom transponder AI to fleet " + fleet.getName());
AlwaysOnTransponderAI aai = new AlwaysOnTransponderAI();
aai.init(ability);
return new PluginPick<AbilityAIPlugin>(aai, PickPriority.MOD_SET);
}
return null;
}
Logged

theDragn

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8479 on: February 03, 2022, 10:30:01 PM »

I've double-checked this; the onhit gets called if I remove the proximity explosion, but does not get called when I add it back in. Presumably it has something to do with the projectile exploding without touching anything- the damage applied by the flak AoE returns null if you try to get its projectile ID or source weapon.

Ah, my bad - the onHitEffect needs to be inside behaviorSpec (but *not* inside explosionSpec).

This is a super delayed reply but I've just now noticed that doing this causes the onhit to get called at least a half-dozen times against any target caught in the AoE. I'm guessing there are a bunch of invisible projectiles that are checking collision or something? Is there any way to only get that script to be called once per target per explosion?

shoi

  • Admiral
  • *****
  • Posts: 650
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8480 on: February 04, 2022, 04:53:28 AM »

Is there a skill or something tied to Marine XP? Wondering if there's a way I can modify it (Like having the minimum XP  for marines always at Veteran, with a custom skill..or something)
Logged

default

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8481 on: February 04, 2022, 08:03:38 AM »

I am very new to modding and wanted to get into the coding part of it, but I have come across an issue. When following the guide found here: https://starsector.fandom.com/wiki/IntelliJ_IDEA_Setup, I got to the debugging section, modified the bat file, and then tried to run it. It looks like it tried to run, but encountered errors. Did I do something wrong? I don't really know a whole lot of coding, just slowly learning it, so I'm not familiar with too many errors. I apologize if I'm just being a newbie... Help would be appreciated.

Putting errors here to not make the post needlessly long.
Error 1:
Feb 04, 2022 10:53:57 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

Error 2:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
[close]
Logged
"There's nothing like a trail of blood to find your way back home."

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8482 on: February 04, 2022, 08:16:04 AM »

This is a super delayed reply but I've just now noticed that doing this causes the onhit to get called at least a half-dozen times against any target caught in the AoE. I'm guessing there are a bunch of invisible projectiles that are checking collision or something? Is there any way to only get that script to be called once per target per explosion?

It's getting called every frame of the explosion's existence. Generally speaking you'd want to keep track of what the on-hit effect applied to already and bail out for repeats. IIRC you have have data members in the OnHitEffect class - it's instantiated per projectile/explosion/etc.


Is there a skill or something tied to Marine XP? Wondering if there's a way I can modify it (Like having the minimum XP  for marines always at Veteran, with a custom skill..or something)

This is handled in PlayerFleetPersonnelTracker, but modding that is going to be fairly involved; the specific levers you want are not exposed (and don't really exist in the first place), so you'd have to replace it with your own version.

I am very new to modding and wanted to get into the coding part of it, but I have come across an issue. When following the guide found here:
...
Did I do something wrong? I don't really know a whole lot of coding, just slowly learning it, so I'm not familiar with too many errors. I apologize if I'm just being a newbie... Help would be appreciated.

Hi! I actually have no idea about this, sorry - I don't use IDEA, and this error message doesn't ring any bells for me. This isn't very helpful, but, didn't want you to think I was responding to others and just ignoring you :)
Logged

default

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8483 on: February 04, 2022, 09:08:13 AM »

I am very new to modding and wanted to get into the coding part of it, but I have come across an issue. When following the guide found here:
...
Did I do something wrong? I don't really know a whole lot of coding, just slowly learning it, so I'm not familiar with too many errors. I apologize if I'm just being a newbie... Help would be appreciated.

Hi! I actually have no idea about this, sorry - I don't use IDEA, and this error message doesn't ring any bells for me. This isn't very helpful, but, didn't want you to think I was responding to others and just ignoring you :)
It's all good. I'll just try to mess around with it and hopefully figure something out. Or maybe somebody has a solution. Either way, thanks for the reply!
Logged
"There's nothing like a trail of blood to find your way back home."

float

  • Commander
  • ***
  • Posts: 245
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8484 on: February 04, 2022, 09:32:07 AM »

It's all good. I'll just try to mess around with it and hopefully figure something out. Or maybe somebody has a solution. Either way, thanks for the reply!

The error code in your original post is an “access denied” error, meaning you don’t have sufficient permissions. When this mind of error pops up on a Windows machine, I can think of two possible causes/solutions:

- Try running the bat file as an administrator (right click, run as administrator or ctrl+shift+enter in the start menu bar).

- Where is your Starsector installation located? If it’s in Program Files or Program Files (x86), try moving it out to, say, Documents. Windows really doesn’t like its users modifying the program files for some reason.

Edit: upon further inspection, this seems like a java issue and not a Starsector issue, so the second suggestion is unlikely to work. If running as administrator fails you may need to go into regedit and create the java preferences key yourself.
« Last Edit: February 04, 2022, 09:44:14 AM by this_is_a_username »
Logged

default

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8485 on: February 04, 2022, 09:50:19 AM »

It's all good. I'll just try to mess around with it and hopefully figure something out. Or maybe somebody has a solution. Either way, thanks for the reply!

The error code in your original post is an “access denied” error, meaning you don’t have sufficient permissions. When this mind of error pops up on a Windows machine, I can think of two possible causes/solutions:

- Try running the bat file as an administrator (right click, run as administrator or ctrl+shift+enter in the start menu bar).

- Where is your Starsector installation located? If it’s in Program Files or Program Files (x86), try moving it out to, say, Documents. Windows really doesn’t like its users modifying the program files for some reason.

Edit: upon further inspection, this seems like a java issue and not a Starsector issue, so the second suggestion is unlikely to work. If running as administrator fails you may need to go into regedit and create java preferences key yourself.
When I just run the bat file as admin, it just brings up the command prompt like bat files do, and it closes out after anything is pressed. I ran IDEA as admin and went to debug it again, and it did clear up the first error, which is awesome. However, the second error still shows up.

Edit: I realize it would likely be more helpful to post the entire output I got when running the debugger on IDEA as it does say Error in there even though it was not highlighted in red...
Spoiler
cmd.exe /c "C:/Program Files (x86)/Fractal Softworks/Starsector/starsector-core/debug-starsector.bat"

C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core>..\jre\bin\java.exe -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Xms1536m -Xmx1536m -Xss2048k -Dcom.fs.starfarer.settings.paths.logs=. -Dcom.fs.starfarer.settings.paths.saves=../saves -Dcom.fs.starfarer.settings.paths.screenshots=../screenshots -Dcom.fs.starfarer.settings.paths.mods=../mods -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.res.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;lwjgl_util_applet.jar;jinput.jar;lwjgl_test.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar com.fs.starfarer.StarfarerLauncher
Listening for transport dt_socket at address: 5005
0    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Starting Starsector 0.95.1a-RC6 launcher
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Running in C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - OS: Windows 8.1 6.3
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Java version: 1.7.0_79 (64-bit)
12   [main] INFO  com.fs.starfarer.launcher.ModManager  - Found mod:  [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\Magellan Protectorate(modified)]
13   [main] INFO  com.fs.starfarer.settings.StarfarerSettings  - Loading settings
13   [main] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data/config/settings.json)]
53   [main] ERROR com.fs.starfarer.StarfarerLauncher  - java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:72)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:87)
   at org.lwjgl.Sys.<clinit>(Sys.java:117)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
   at com.fs.graphics.DisplayManager.Ò00000(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.detectResolutions(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.<init>(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.createUI(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
Press any key to continue . . .
[close]
« Last Edit: February 04, 2022, 09:58:25 AM by default »
Logged
"There's nothing like a trail of blood to find your way back home."

float

  • Commander
  • ***
  • Posts: 245
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8486 on: February 04, 2022, 10:18:56 AM »

When I just run the bat file as admin, it just brings up the command prompt like bat files do, and it closes out after anything is pressed. I ran IDEA as admin and went to debug it again, and it did clear up the first error, which is awesome. However, the second error still shows up.

Edit: I realize it would likely be more helpful to post the entire output I got when running the debugger on IDEA as it does say Error in there even though it was not highlighted in red...
Spoiler
cmd.exe /c "C:/Program Files (x86)/Fractal Softworks/Starsector/starsector-core/debug-starsector.bat"

C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core>..\jre\bin\java.exe -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Xms1536m -Xmx1536m -Xss2048k -Dcom.fs.starfarer.settings.paths.logs=. -Dcom.fs.starfarer.settings.paths.saves=../saves -Dcom.fs.starfarer.settings.paths.screenshots=../screenshots -Dcom.fs.starfarer.settings.paths.mods=../mods -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.res.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;lwjgl_util_applet.jar;jinput.jar;lwjgl_test.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar com.fs.starfarer.StarfarerLauncher
Listening for transport dt_socket at address: 5005
0    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Starting Starsector 0.95.1a-RC6 launcher
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Running in C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - OS: Windows 8.1 6.3
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Java version: 1.7.0_79 (64-bit)
12   [main] INFO  com.fs.starfarer.launcher.ModManager  - Found mod:  [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\Magellan Protectorate(modified)]
13   [main] INFO  com.fs.starfarer.settings.StarfarerSettings  - Loading settings
13   [main] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data/config/settings.json)]
53   [main] ERROR com.fs.starfarer.StarfarerLauncher  - java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:72)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:87)
   at org.lwjgl.Sys.<clinit>(Sys.java:117)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
   at com.fs.graphics.DisplayManager.Ò00000(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.detectResolutions(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.<init>(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.createUI(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
Press any key to continue . . .
[close]

Sorry, I was only looking at the first error. The second error does seem like it could be caused by putting Starsector in your program files. Try moving Starsector out of program files and/or running IntelliJ as an admin. If that fails, could you post screenshots of your run configuration?
Logged

default

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8487 on: February 04, 2022, 10:58:23 AM »

When I just run the bat file as admin, it just brings up the command prompt like bat files do, and it closes out after anything is pressed. I ran IDEA as admin and went to debug it again, and it did clear up the first error, which is awesome. However, the second error still shows up.

Edit: I realize it would likely be more helpful to post the entire output I got when running the debugger on IDEA as it does say Error in there even though it was not highlighted in red...
Spoiler
cmd.exe /c "C:/Program Files (x86)/Fractal Softworks/Starsector/starsector-core/debug-starsector.bat"

C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core>..\jre\bin\java.exe -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Xms1536m -Xmx1536m -Xss2048k -Dcom.fs.starfarer.settings.paths.logs=. -Dcom.fs.starfarer.settings.paths.saves=../saves -Dcom.fs.starfarer.settings.paths.screenshots=../screenshots -Dcom.fs.starfarer.settings.paths.mods=../mods -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.res.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;lwjgl_util_applet.jar;jinput.jar;lwjgl_test.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar com.fs.starfarer.StarfarerLauncher
Listening for transport dt_socket at address: 5005
0    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Starting Starsector 0.95.1a-RC6 launcher
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Running in C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - OS: Windows 8.1 6.3
1    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Java version: 1.7.0_79 (64-bit)
12   [main] INFO  com.fs.starfarer.launcher.ModManager  - Found mod:  [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\Magellan Protectorate(modified)]
13   [main] INFO  com.fs.starfarer.settings.StarfarerSettings  - Loading settings
13   [main] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data/config/settings.json)]
53   [main] ERROR com.fs.starfarer.StarfarerLauncher  - java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:72)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:87)
   at org.lwjgl.Sys.<clinit>(Sys.java:117)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
   at com.fs.graphics.DisplayManager.Ò00000(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.detectResolutions(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.<init>(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.createUI(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
Press any key to continue . . .
[close]

Sorry, I was only looking at the first error. The second error does seem like it could be caused by putting Starsector in your program files. Try moving Starsector out of program files and/or running IntelliJ as an admin. If that fails, could you post screenshots of your run configuration?
I tried moving Starsector to my desktop and running the debug, then again as admin, to no avail. Though the error log did look slightly different. Also by run configuration I assume you mean the config I have on IDEA for running the bat file? I'm still very new to all this. Regardless, I will post a screenshot of that. If anything else is needed, let me know. It helps to be specific.

[attachment deleted by admin]
Logged
"There's nothing like a trail of blood to find your way back home."

float

  • Commander
  • ***
  • Posts: 245
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8488 on: February 04, 2022, 11:34:58 AM »

I tried moving Starsector to my desktop and running the debug, then again as admin, to no avail. Though the error log did look slightly different. Also by run configuration I assume you mean the config I have on IDEA for running the bat file? I'm still very new to all this. Regardless, I will post a screenshot of that. If anything else is needed, let me know. It helps to be specific.

Your debug-starsector.bat is not specifying java.library.path. It should look like this (since you are on Windows, you can just copy/paste the entire thing):

Code
start ..\jre\bin\java.exe -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Djava.library.path=native\windows -Xms1536m -Xmx1536m -Xss2048k -Dcom.fs.starfarer.settings.paths.logs=. -Dcom.fs.starfarer.settings.paths.saves=../saves -Dcom.fs.starfarer.settings.paths.screenshots=../screenshots -Dcom.fs.starfarer.settings.paths.mods=../mods -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.res.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;lwjgl_util_applet.jar;jinput.jar;lwjgl_test.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar com.fs.starfarer.StarfarerLauncher

The following option is of particular relevance:
Code
-Djava.library.path=native\windows

You should also set up a run configuration for attaching a debugger to Starsector. To do this, click + on the top-left of "Run/Debug Configurations" and select "Remote JVM Debug". Use the following settings:

Debugger mode: Attach to remote JVM
Transport: Socket
Host: localhost
Port: 5005
Command line arguments for remote JVM: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
Use module classpath: <your mod>
Before launch: Run another configuration -> run the debug-starsector batch script.
« Last Edit: February 04, 2022, 11:48:25 AM by this_is_a_username »
Logged

default

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8489 on: February 04, 2022, 12:16:49 PM »

I tried moving Starsector to my desktop and running the debug, then again as admin, to no avail. Though the error log did look slightly different. Also by run configuration I assume you mean the config I have on IDEA for running the bat file? I'm still very new to all this. Regardless, I will post a screenshot of that. If anything else is needed, let me know. It helps to be specific.

Your debug-starsector.bat is not specifying java.library.path. It should look like this (since you are on Windows, you can just copy/paste the entire thing):

Code
start ..\jre\bin\java.exe -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Djava.library.path=native\windows -Xms1536m -Xmx1536m -Xss2048k -Dcom.fs.starfarer.settings.paths.logs=. -Dcom.fs.starfarer.settings.paths.saves=../saves -Dcom.fs.starfarer.settings.paths.screenshots=../screenshots -Dcom.fs.starfarer.settings.paths.mods=../mods -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.res.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;lwjgl_util_applet.jar;jinput.jar;lwjgl_test.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar com.fs.starfarer.StarfarerLauncher

The following option is of particular relevance:
Code
-Djava.library.path=native\windows

You should also set up a run configuration for attaching a debugger to Starsector. To do this, click + on the top-left of "Run/Debug Configurations" and select "Remote JVM Debug". Use the following settings:

Debugger mode: Attach to remote JVM
Transport: Socket
Host: localhost
Port: 5005
Command line arguments for remote JVM: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
Use module classpath: <your mod>
Before launch: Run another configuration -> run the debug-starsector batch script.

Oooohh, okay. This worked. I was getting confused on the wording in the tutorial. It says "Replace the beginning of the one line in the file as follows:" Key word is replace. I replaced this: "-Djava.library.path=native\windows" with this: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" because I thought something needed to be replaced. Due to the wording of it, but now it makes sense.

Thanks for being patient with my lack of experience with any bat files at all, and also the tip for attaching a debugger.
Logged
"There's nothing like a trail of blood to find your way back home."
Pages: 1 ... 564 565 [566] 567 568 ... 706