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: Planet Search Overhaul (07/13/24)

Pages: 1 ... 716 717 [718] 719 720 ... 733

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

banano of doom

  • Captain
  • ****
  • Posts: 255
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10755 on: June 01, 2024, 06:12:45 PM »

Bit of an odd question, but if I wanted to delete/disable certain ships in a mod pack, is it enough to just delete them from the hulls folder? I assume not.
no, that will just make the game die horribly
best you can do is delete them from data/world/factions/defaultShipRoles.json
this will make ships not spawn on npc fleets and stores
you can also add restricted tag to them in ship_data.csv, to make them not appear in codex
if I added 5 minute long lasting songs into a mod (as replacement for standard faction songs) would they significantly affect the performance of the game?
not particularly
so long as they are registered as specifically "music" and not "sounds"
music is streamed directly from disk, not preloaded, so it shouldn't affect much of anything beyond the archive download size
« Last Edit: June 01, 2024, 06:14:58 PM by banano of doom »
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24670
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10756 on: June 02, 2024, 12:15:30 PM »

A couple of people had this NPE when colonizing a planet, after confirming the planet name. Not the same planet between the two games; other planets in the respective save games work fine.

Is this from the player faction being set to null somehow?
[Thread-2] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException: Cannot invoke "com.fs.starfarer.campaign.Faction.getBrightUIColor()" because the return value of "com.fs.starfarer.rpg.Person.getFaction()" is null
java.lang.NullPointerException: Cannot invoke "com.fs.starfarer.campaign.Faction.getBrightUIColor()" because the return value of "com.fs.starfarer.rpg.Person.getFaction()" is null
   at com.fs.starfarer.coreui.OOoo.sizeChanged(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.ui.L.set(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.ui.m.o00000(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.ui.o0O0.advanceImpl(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.ui.thissuper.advance(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.ui.o000.advanceImpl(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.campaign.ui.marketinfo.OO00.advanceImpl(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.ui.thissuper.advance(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.ui.o000.advanceImpl(Unknown Source) ~[port_obf.jar:?]
   at com.fs.starfarer.campaign.ui.marketinfo.intsuper.advanceImpl(Unknown Source) ~[port_obf.jar:?]


This looks like it's from an officer having their faction be set to null. Not sure what this might have to do with colonizing a planet, but as this looks to be from running with Java 23, I'm guessing mods may be involved, so maybe something gets kicked off by this that messes with officers? Or, perhaps more likely, this could have to do with a colony admin.


does the AIFlag.NEEDS_HELP trigger even when no friendlies are nearby or on the map??

Yes, though I wouldn't expect the flag to be comprehensive as far as covering all possible scenarios etc.


Is it possible to disable receiving/consuming inputs while in refit screen?

Was able to successfully open a custom UI in refit screen but inputs on custom UI trigger inputs below custom UI.

If you .consume() the events that you act on, it shouldn't happen. But this sounds like doing more than the modding API directly supports, so I can't really speak to how that all works/doesn't work :)


(@banano of doom: right on! thank you for chiming in.)
Logged

Duzzit

  • Ensign
  • *
  • Posts: 13
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10757 on: June 02, 2024, 03:11:25 PM »

Hello minor question from me. If I wanted to change the requirements for stuff like the soil nanites and the other colony items (so that the requirements are lessened or more strict) how would I go about doing that?
(needs knowledge of Java code and the Starsector API)
ItemEffectsRepo.ITEM_EFFECTS in the API is a map of special item IDs to their BoostIndustryInstallableItemEffects. You can define your own effect and put it in ITEM_EFFECTS with the corresponding item ID as the map key.
Look at the ItemEffectsRepo class for how the vanilla requirements are defined.
Thank you. :) bit beyond me at present but I'll look into figuring it out when I've got some spare time.

Bit of an odd question, but if I wanted to delete/disable certain ships in a mod pack, is it enough to just delete them from the hulls folder? I assume not.
no, that will just make the game die horribly
best you can do is delete them from data/world/factions/defaultShipRoles.json
this will make ships not spawn on npc fleets and stores
you can also add restricted tag to them in ship_data.csv, to make them not appear in codex

Thanks a lot, will do that. Dont mind them in codex just don't want them flying in campaign really.
Logged

banano of doom

  • Captain
  • ****
  • Posts: 255
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10758 on: June 02, 2024, 06:45:13 PM »

If you .consume() the events that you act on, it shouldn't happen. But this sounds like doing more than the modding API directly supports, so I can't really speak to how that all works/doesn't work :)
that actually worked, thank you
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

banano of doom

  • Captain
  • ****
  • Posts: 255
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10759 on: June 03, 2024, 02:52:50 AM »

question
is there a reliable way to prevent a TooltipMakerAPI tooltip from ever changing size ever?
cause every time i add anything to a tooltip that isn't just straigth-up top-down order, it changes size and shape in weird ways that are seemingly impossible to predict
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24670
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10760 on: June 03, 2024, 08:53:47 AM »

question
is there a reliable way to prevent a TooltipMakerAPI tooltip from ever changing size ever?
cause every time i add anything to a tooltip that isn't just straigth-up top-down order, it changes size and shape in weird ways that are seemingly impossible to predict

You could set its size using getPosition().setSize().

Also using .addCustomDoNotSetPosition() to add stuff should not change its size.
Logged

Killer of Fate

  • Admiral
  • *****
  • Posts: 1338
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10761 on: June 03, 2024, 10:15:50 AM »

how do non-vanilla missiles work with the Missile Autoloader? Is the amount of missiles reloaded calculated based on their op cost or something?
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 561
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10762 on: June 05, 2024, 03:33:09 AM »

how do non-vanilla missiles work with the Missile Autoloader? Is the amount of missiles reloaded calculated based on their op cost or something?
you can just look inside the hullmod's script
but yeah, it has an automatic system for determining the cost + the ability to override that cost by just setting a tag on the weapon

Ruddygreat

  • Admiral
  • *****
  • Posts: 561
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10763 on: June 05, 2024, 06:21:34 AM »

and a question of my own - how do travel drives get called / initiated / triggered when a ship spawns in & do their CSV stats actually matter?
I've made a custom one that's just a copy of the base one's csv line & logged the states but they don't seem to add up to the CSV values - it has a much lower IN duration (about .2s vs 2s), a much longer ACTIVE duration (about 5s vs 0) & the same OUT duration (2s vs 2s)

edit - is there a non-obvious way to get the sprite that's being used as the background for the current combat instance?
asking for the non-obvious way specifically because there doesn't seem to be a method for it in CombatEngineAPI

edit 2 - does ShipAPI.setLayer() work properly? it doesn't seem like it can properly move a ship "up" from its current layer (say, from BELOW_SHIPS to FRIGATES_LAYER) but it can move a ship "down" (that in reverse just fine)

edit 3 with an example & text describing the situation -
I'm wanting to make a custom travel drive that has the ship fly in though a portal, but the ship seems to get stuck on whatever layer it's on after a few seconds in the fight, either below the white block if it comes in through the system or above it if the ship is spawned by default (though this is just a sim issue)
(and the black text is the layer that the ship is rendering on)
example image
[close]
« Last Edit: June 05, 2024, 10:39:13 AM by Ruddygreat »
Logged

Zxvcklh

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10764 on: June 05, 2024, 06:53:23 AM »

im newb ,so i want to edit IndustrialPlanning skills  but get an error, when i try to edit not IndustrialPlanning it doesn't error

81247 [Thread-2] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [data.scripts.TweaksMod]
java.lang.RuntimeException: Error loading [data.scripts.TweaksMod]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source) ~[port_obf.jar:?]
   at java.base/java.lang.Thread.run(Thread.java:1575) [?:?]
Caused by: java.lang.ClassNotFoundException: Compilation unit 'IndustrialPlanning' does not declare a class with the same name
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:231) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:182) ~[janino-3.0.12.jar:?]
   at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
   at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
   ... 2 more
Caused by: org.codehaus.commons.compiler.CompileException: Compilation unit 'IndustrialPlanning' does not declare a class with the same name
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:191) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:312) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.findTypeByName(UnitCompiler.java:8491) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java:8734) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java:8403) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java:8406) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.reclassify(UnitCompiler.java:8266) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.getConstantValue2(UnitCompiler.java:5669) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.access$10400(UnitCompiler.java:218) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$18$1.visitAmbiguousName(UnitCompiler.java:5623) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$AmbiguousName.accept(Java.java:4279) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$18.visitLvalue(UnitCompiler.java:5620) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$Lvalue.accept(Java.java:4203) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.getConstantValue(UnitCompiler.java:5616) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.getConstantValue2(UnitCompiler.java:5916) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.access$11100(UnitCompiler.java:218) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$18.visitCast(UnitCompiler.java:5638) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$Cast.accept(Java.java:4953) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.getConstantValue(UnitCompiler.java:5616) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5581) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5106) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.access$9100(UnitCompiler.java:218) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4452) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4425) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5128) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4425) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5589) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3810) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.access$5900(UnitCompiler.java:218) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$13.visitMethodInvocation(UnitCompiler.java:3788) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$13.visitMethodInvocation(UnitCompiler.java:3760) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5128) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3760) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2363) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.access$1800(UnitCompiler.java:218) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1497) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1490) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java:2929) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1490) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1570) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3398) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1360) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1333) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:825) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:984) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.access$700(UnitCompiler.java:218) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$2.visitMemberClassDeclaration(UnitCompiler.java:417) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$2.visitMemberClassDeclaration(UnitCompiler.java:409) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$MemberClassDeclaration.accept(Java.java:1298) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:409) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileDeclaredMemberTypes(UnitCompiler.java:1309) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:851) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:435) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:218) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:414) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:409) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1417) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:409) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:381) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:229) ~[janino-3.0.12.jar:?]
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:182) ~[janino-3.0.12.jar:?]
   at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
   at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
   ... 2 more
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24670
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10765 on: June 05, 2024, 10:05:03 AM »

and a question of my own - how do travel drives get called / initiated / triggered when a ship spawns in & do their CSV stats actually matter?
I've made a custom one that's just a copy of the base one's csv line & logged the states but they don't seem to add up to the CSV values - it has a much lower IN duration (about .2s vs 2s), a much longer ACTIVE duration (about 5s vs 0) & the same OUT duration (2s vs 2s)

edit - is there a non-obvious way to get the sprite that's being used as the background for the current combat instance?
asking for the non-obvious way specifically because there doesn't seem to be a method for it in CombatEngineAPI

IIRC those values get overridden because of the assumption that the drive is fully "on" by the time the ships spawn, and the actual duration of the burn varies depending on whether they're coming from off-map or not.

I don't think so, added:
CombatEngineAPI.getBackgroundSpriteName();

im newb ,so i want to edit IndustrialPlanning skills  but get an error, when i try to edit not IndustrialPlanning it doesn't error

Caused by: java.lang.ClassNotFoundException: Compilation unit 'IndustrialPlanning' does not declare a class with the same name

If you look for "caused by" in the stack trace, it'll point you to what the error is. In this case it looks like the class name does not match the filename. If that doesn't make sense, then I'd recommend looking through some basic Java tutorials; if you're planning to mess with code that'd be time well spent.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 561
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10766 on: June 05, 2024, 12:18:22 PM »

IIRC those values get overridden because of the assumption that the drive is fully "on" by the time the ships spawn, and the actual duration of the burn varies depending on whether they're coming from off-map or not.

I don't think so, added:
CombatEngineAPI.getBackgroundSpriteName();

ah yeah, that makes sense
and ty!

(also just gonna mention that I edited my previous post w/ an extra question about some wierd behaviour with ShipAPI.setLayer())

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24670
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10767 on: June 05, 2024, 01:58:38 PM »

I'm not sure, not seeing any reason why .setLayer() wouldn't work.

I'm not sure why you'd need to move the ship through layers here, though. Wouldn't you want to render the portal on above/below ship layers while the ship remains on whatever layer it's on?
Logged

Zxvcklh

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10768 on: June 05, 2024, 03:30:02 PM »

im newb ,so i want to edit IndustrialPlanning skills  but get an error, when i try to edit not IndustrialPlanning it doesn't error

Caused by: java.lang.ClassNotFoundException: Compilation unit 'IndustrialPlanning' does not declare a class with the same name

If you look for "caused by" in the stack trace, it'll point you to what the error is. In this case it looks like the class name does not match the filename. If that doesn't make sense, then I'd recommend looking through some basic Java tutorials; if you're planning to mess with code that'd be time well spent.
[/quote]


thankyou for replying  ;D, i tried disabling all mod except mine and it worked there is some mod that override class names
Logged

SaltedFish

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10769 on: June 06, 2024, 04:38:05 AM »

The order in which commands are processed in the same frame:
1. receive commands from the player
2. receive commands from AIPlugin
3. the player's ship processes commands from step 1 in advance()
4. all entities process commands from step 2 and step 5 in their respective advance()
5. receive commands from subclasses of BaseEveryFrameCombatPlugin
In step 3 / step 4, when the game detects a pause (isPause() returns true), isn't it just receiving commands but not executing them (discarding commands received per frame) until isPause() returns false.
Logged
Pages: 1 ... 716 717 [718] 719 720 ... 733