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: Hyperspace Topography (10/12/22)

Pages: 1 ... 565 566 [567] 568 569 ... 626

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

default

  • Lieutenant
  • **
  • Posts: 79
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8490 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.
Logged
"There's nothing like a trail of blood to find your way back home."

this_is_a_username

  • Commander
  • ***
  • Posts: 133
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8491 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: 79
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8492 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."

briansd9

  • Ensign
  • *
  • Posts: 45
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8493 on: February 04, 2022, 06:09:25 PM »

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.

This can be safely ignored, but if you want to get rid of the warning there are steps here
Logged

shoi

  • Admiral
  • *****
  • Posts: 543
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8494 on: February 05, 2022, 04:26:24 AM »

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.

augh, okay. Thanks :)
Logged

AccuracyThruVolume

  • Lieutenant
  • **
  • Posts: 97
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8495 on: February 05, 2022, 03:44:34 PM »

I'm looking to create two hullmods:
#1:

Keeps the replenishment for fighters at 100% during combat, and sets the refit time for any fighter it has to 1 second.

#2:

Gives a range boost to a specific classname or classnames of weapons.   If that is not possible, then boost one type of weapon, energy, for example.

Are these doable?   My java knowledge is poor at best.

Thanks in advance.
Logged

Üstad

  • Commander
  • ***
  • Posts: 116
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8496 on: February 06, 2022, 05:30:18 AM »

I want to make certain hullmods, ships, weapons, fighters player only. Is there a way to make this? If this is pretty big deal for this thread, I can make a seperate thread about it.
Logged

SirHartley

  • Admiral
  • *****
  • Posts: 634
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8497 on: February 06, 2022, 07:24:53 AM »

I'm looking to create two hullmods:
#1:Keeps the replenishment for fighters at 100% during combat, and sets the refit time for any fighter it has to 1 second.
#2:Gives a range boost to a specific classname or classnames of weapons.   If that is not possible, then boost one type of weapon, energy, for example.
Are these doable?   My java knowledge is poor at best.

Thanks in advance.
Both of these are feasible.

I want to make certain hullmods, ships, weapons, fighters player only. Is there a way to make this? If this is pretty big deal for this thread, I can make a seperate thread about it.
If you do not add a ship or weapon to the faction files of other factions, they will not show up with them. It's a simple thing. Best examples to be found in mods like Tahlan.
Logged

SirHartley

  • Admiral
  • *****
  • Posts: 634
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8498 on: February 06, 2022, 07:25:41 AM »

I also got a question - I want to make a fleet perma-visible to the player, both on the campaign layer as well as the Map.
Any way to get this done?

Thanks in advance,
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 403
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8499 on: February 06, 2022, 08:14:11 AM »

Seems that member.getStats().getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MOD) doesn't work while used in BuffManagerAPI...
In campaign layer, the deployment points seem to be reduced, but while in combat layer, the deployment points revert to normal
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 20990
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8500 on: February 06, 2022, 08:40:23 AM »

I also got a question - I want to make a fleet perma-visible to the player, both on the campaign layer as well as the Map.
Any way to get this done?

Thanks in advance,

Hmm, I don't think so. Depending on what you want, though, it might be worth looking at how the OrbitalStation industry handles this sort of thing - with a custom entity with a fleet somehow attached to it, iirc. Not 100% sure whether there's anything "special" there that makes it only work for that narrow use case, though.


Seems that member.getStats().getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MOD) doesn't work while used in BuffManagerAPI...
In campaign layer, the deployment points seem to be reduced, but while in combat layer, the deployment points revert to normal

Oh, wow, that's a bit of a mess - it was applying, but only sometimes. Fixed this up, thank you.
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 403
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8501 on: February 06, 2022, 08:43:23 AM »

Oh, wow, that's a bit of a mess - it was applying, but only sometimes. Fixed this up, thank you.
FINE... I will try to directly apply it in the combat layer, looks like the CoordinatedManeuversScript is related to the dp change.
Logged
My mods


Obsidian Actual

  • Lieutenant
  • **
  • Posts: 92
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8502 on: February 06, 2022, 02:28:47 PM »

[ Re-enabling auto pause on F9 ]

Greetings,

Is there some sort of API method -- or better yet, a hidden boolean that can be set within settings.json -- that can force the game to always start a reloaded game in a paused state?

I understand that this is already the default behavior with vanilla 0.95.1a StarSector, but I suspect one of my (125+) installed mods is overriding this.
Logged

Ruddygreat

  • Captain
  • ****
  • Posts: 266
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8503 on: February 07, 2022, 04:00:45 AM »

I've been making a personal little mod to change ship paintjobs through a hullmod and i've run up against a few problems (one small and one big, though both are kinda minor)

First off the small one - can we get something like isShowDamageWhenDecorative() for weaponSpecAPI, it'd be a nice shorthand for seeing if something is a deco that actually needs to be replaced (and is kinda wierd that isRenderAboveAllWeapons() is a thing but this isn't, I guess no one's asked for it beore?)

And the big one - clearing decorative slots and replacing the weapon in them seems to completely break / ignore render order.

deco weapon replacement code
Code
        for (WeaponAPI weapon : ship.getAllWeapons()) {

            String weapslot = weapon.getSlot().getId();
            String weapid = weapon.getId();
            ShipVariantAPI variant = ship.getMutableStats().getVariant();

            boolean hasSwapped = weapid.contains(prefix); //prefix for weapon graphics & names

            boolean isBlinker = weapid.contains("blinker"); //checks for "not armour deco" stuff start
            boolean isGlow = weapid.contains("glow") || weapid.contains("light");
            boolean isEmpCore = weapid.contains("empcore");
            boolean isShadow = weapid.contains("shadow");//checks end

            if (weapon.getSlot().isDecorative() && !hasSwapped && !isBlinker && !isEmpCore && !isGlow && !isShadow) {
                variant.clearSlot(weapslot);
                variant.addWeapon(weapslot, prefix + weapid);
            }
        }
[close]

This swaps all non-painted deco weaps that have replacements to their painted equivalents, but somewhere along the way it also seems to completely break the render order of the replaced weaps, despite not touching it at all.
It's also got the wierd side effect of keeping the broken render order between removing the hullmod and fully stripping the ship, though I'm assuming that's because I never readd the unpainted decos (?)

no hullmod, shadow & covers are over guns
[close]
with paintjob, shadows are over gun but covers are below
[close]
after removing paintjob, before stripping the ship, same as image 2
[close]

Safarijohn suggested saving the variant then stripping it & putting it all back in code, but that seems too complicated for me (and this feels like a bug so I thought I'd ask here as well), honestly I'm hoping I just overlooked something obvious 

Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8504 on: February 07, 2022, 06:54:03 AM »

Is there a way to manually spawn custom objectives during a battle?
I want to make a station battle with gimmick of taking over objectives to make station weaker.
Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.
Pages: 1 ... 565 566 [567] 568 569 ... 626