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 2 3 [4] 5 6 ... 11

Author Topic: [0.95.1a] Progressive S-Mods (0.8.7) — gain XP for ships, spend it on S-mods  (Read 51553 times)

Anexgohan

  • Ensign
  • *
  • Posts: 47
    • View Profile
    • Email

Hello, I have a request can you add some Console Commands so I can Add/Substract XP to currently selected ship in the refit screen for testing purposes so I can prototype a ship before committing to a long process of gaining actual battle Xp.
Logged

this_is_a_username

  • Commander
  • ***
  • Posts: 133
    • View Profile
    • Email

It was my understanding that ships with the civilian-grade hull modifier are supposed to gain suppport XP regardless of weapons (i.e. if you put weapons in the small mounts of an Atlas, it should still get XP as long as you don't also give it militarized subsystems - right?).  Are fighter bays just different than normal weapon mounts for these purposes?
Yeah, that was my intent as well, but I ended up just using isCivilian() while not really knowing how exactly it works. I now believe isCivilian doesn't even check for civ-grade hull mod, it simply returns true if and only if the ship has no fighters or weapons equipped. So I just manually added the case for civ-grade but no militarized subsystems.

I wasn't suggesting that you should maintain the list (at most put any vanilla edge cases in, but certainly nothing more than that), it would just be nice to be able to add ships to the list myself.  That's the point of suggesting it be in a config file - something that the user can edit to meet their needs.
I'm still not convinced by this, but for your role-playing wishes, now every ship in your fleet gains an even smaller (half that of civilian ships) token XP after each battle. If you wish to manually make certain ships civilian, you will have to do so yourself and recompile the source code -- see line 223 of EngagementListener.java for where the civilian ship check happens.

Hello, I have a request can you add some Console Commands so I can Add/Substract XP to currently selected ship in the refit screen for testing purposes so I can prototype a ship before committing to a long process of gaining actual battle Xp.
This is a great suggestion that I should have done much, much earlier to streamline my own testing, but was too lazy to read up on console commands. It's done now. (You can subtract XP by using addShipXP with a negative number.)
Logged

Exasperation

  • Ensign
  • *
  • Posts: 25
    • View Profile

It was my understanding that ships with the civilian-grade hull modifier are supposed to gain suppport XP regardless of weapons (i.e. if you put weapons in the small mounts of an Atlas, it should still get XP as long as you don't also give it militarized subsystems - right?).  Are fighter bays just different than normal weapon mounts for these purposes?
Yeah, that was my intent as well, but I ended up just using isCivilian() while not really knowing how exactly it works. I now believe isCivilian doesn't even check for civ-grade hull mod, it simply returns true if and only if the ship has no fighters or weapons equipped. So I just manually added the case for civ-grade but no militarized subsystems.
It turns out that whatever it's doing is more complicated than that; I've just noticed I had a ship without civilian-grade hull that I forgot to remove the point defense weapon from its only weapon mount - and it was still getting the support XP (and also the +2 burn from bulk transport).  So whatever triggers isCivilian() is considering something outside of those factors.  Looking in the ship_data file for that mod, that ship has "CIVILIAN, FREIGHTER" for its hints entry - and looking in the base ship_data, the Shepherd doesn't have the CIVILIAN hint.  I guess maybe isCivilian() checks for that hint first, and there's no need for an override since anyone (i.e. me) could just add that hint to any ship that they feel it fits, no recompiling needed.
Logged

amimai

  • Ensign
  • *
  • Posts: 17
    • View Profile

I got an error with v8.5, 8.3 works fine so this is recent

Spoiler
HullVariantSpec;Ljava/lang/String;Ljava/lang/String;ZZLcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/campaign/fleet/FleetMember;)Lcom/fs/starfarer/combat/entities/Ship;
java.lang.NoSuchMethodError: com.fs.starfarer.loading.specs._.o00000(Lcom/fs/starfarer/loading/specs/HullVariantSpec;Ljava/lang/String;Ljava/lang/String;ZZLcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/campaign/fleet/FleetMember;)Lcom/fs/starfarer/combat/entities/Ship;
   at progsmod.data.campaign.rulecmd.util.TempShipMaker.makeShip(TempShipMaker.java:16)
   at progsmod.data.campaign.rulecmd.ui.plugins.BuildInSelector.disableUnapplicable(BuildInSelector.java:115)
   at progsmod.data.campaign.rulecmd.ui.plugins.BuildInSelector.updateItems(BuildInSelector.java:68)
   at progsmod.data.campaign.rulecmd.ui.plugins.BuildInSelector.init(BuildInSelector.java:58)
   at progsmod.data.campaign.rulecmd.PSM_BuildInHullMod$1.createCustomDialog(PSM_BuildInHullMod.java:84)
   at com.fs.starfarer.ui.newui.A.<init>(Unknown Source)
   at com.fs.starfarer.ui.newui.W.showCustomDialog(Unknown Source)
   at progsmod.data.campaign.rulecmd.PSM_BuildInHullMod.execute(PSM_BuildInHullMod.java:72)
   at com.fs.starfarer.campaign.rules.oOOO.execute(Unknown Source)
   at com.fs.starfarer.campaign.rules.ooOO.runScript(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.applyRule(FireBest.java:106)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.execute(FireBest.java:51)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.fire(FireBest.java:57)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.fireBes t(RuleBasedInteractionDialogPluginImpl.java:177)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.optionS elected(RuleBasedInteractionDialogPluginImpl.java:210)
   at com.fs.starfarer.ui.newui.W$1.o00000(Unknown Source)
   at com.fs.starfarer.ui.newui.OoOO.actionPerformed(Unknown Source)
   at com.fs.starfarer.ui.newnew.buttonPressed(Unknown Source)
   at com.fs.starfarer.ui.oooO.Ò00000(Unknown Source)
   at com.fs.starfarer.ui.oooO.processInput(Unknown Source)
   at com.fs.starfarer.ui.V.o00000(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]
Logged

this_is_a_username

  • Commander
  • ***
  • Posts: 133
    • View Profile
    • Email

I got an error with v8.5, 8.3 works fine so this is recent

Spoiler
HullVariantSpec;Ljava/lang/String;Ljava/lang/String;ZZLcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/campaign/fleet/FleetMember;)Lcom/fs/starfarer/combat/entities/Ship;
java.lang.NoSuchMethodError: com.fs.starfarer.loading.specs._.o00000(Lcom/fs/starfarer/loading/specs/HullVariantSpec;Ljava/lang/String;Ljava/lang/String;ZZLcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/rpg/Person;Lcom/fs/starfarer/campaign/fleet/FleetMember;)Lcom/fs/starfarer/combat/entities/Ship;
   at progsmod.data.campaign.rulecmd.util.TempShipMaker.makeShip(TempShipMaker.java:16)
   at progsmod.data.campaign.rulecmd.ui.plugins.BuildInSelector.disableUnapplicable(BuildInSelector.java:115)
   at progsmod.data.campaign.rulecmd.ui.plugins.BuildInSelector.updateItems(BuildInSelector.java:68)
   at progsmod.data.campaign.rulecmd.ui.plugins.BuildInSelector.init(BuildInSelector.java:58)
   at progsmod.data.campaign.rulecmd.PSM_BuildInHullMod$1.createCustomDialog(PSM_BuildInHullMod.java:84)
   at com.fs.starfarer.ui.newui.A.<init>(Unknown Source)
   at com.fs.starfarer.ui.newui.W.showCustomDialog(Unknown Source)
   at progsmod.data.campaign.rulecmd.PSM_BuildInHullMod.execute(PSM_BuildInHullMod.java:72)
   at com.fs.starfarer.campaign.rules.oOOO.execute(Unknown Source)
   at com.fs.starfarer.campaign.rules.ooOO.runScript(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.applyRule(FireBest.java:106)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.execute(FireBest.java:51)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.fire(FireBest.java:57)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.fireBes t(RuleBasedInteractionDialogPluginImpl.java:177)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.optionS elected(RuleBasedInteractionDialogPluginImpl.java:210)
   at com.fs.starfarer.ui.newui.W$1.o00000(Unknown Source)
   at com.fs.starfarer.ui.newui.OoOO.actionPerformed(Unknown Source)
   at com.fs.starfarer.ui.newnew.buttonPressed(Unknown Source)
   at com.fs.starfarer.ui.oooO.Ò00000(Unknown Source)
   at com.fs.starfarer.ui.oooO.processInput(Unknown Source)
   at com.fs.starfarer.ui.V.o00000(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

What version of Starsector are you running? It should work with 0.95.1a RC6.

Technical details: the method being used is obfuscated and I guess it’s possible the obfuscation is getting re-seeded with each release. If that’s the case then I’m going to need to find a better way to  spawn ships in order to use the hull mod effect methods that require a ship instance…
Logged

amimai

  • Ensign
  • *
  • Posts: 17
    • View Profile

0.95.1a-rc6 on linux

I've even tried it with all mods disabled except the necessary lib mods
« Last Edit: January 21, 2022, 06:34:47 PM by amimai »
Logged

this_is_a_username

  • Commander
  • ***
  • Posts: 133
    • View Profile
    • Email

0.95.1a-rc6 on linux

I've even tried it with all mods disabled except the necessary lib mods

Ahh that explains it, I just checked and for some reason the obfuscation seed is different only on Linux. This is going to require some more work for a long-term fix, but for now I can make a quick hotfix to check for OS.

Edit: I don't actually have a Linux machine (or VM) handy for testing right now, so if for some reason System.getProperty("os.name").startsWith("Linux") doesn't work to detect Linux systems then please let me know so I can make it work.
« Last Edit: January 21, 2022, 07:50:04 PM by this_is_a_username »
Logged

amimai

  • Ensign
  • *
  • Posts: 17
    • View Profile

8.6 works so far
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1559
    • View Profile

I'm not sure what wizardry this uses, but it dies to a NPE if a hullmod's description calls
Code
ship.getVariant().getHullMods().contains()

As an aside, why is ignore no_built_in enabled by default?

default

  • Lieutenant
  • **
  • Posts: 79
    • View Profile
    • Email

This mod makes hullmod interactions kind of funky. I have 2 examples.

First one is when a mod adds a custom built in hullmod that has incompatibilities, such as Monobolic Construction from DME. It is not compatible with Heavy Armor. However, if you simply "show all" in the build-in menu, it can still be selected and built in. This causes the hullmod conflict to always be there and always play the error noise, but it will still work and do what it's supposed to despite it not normally being possible.

Second one is with more modded hullmods, but still worth noting. "Minimal preparations" added by SCY is incompatible with Efficiency Overhaul, and when you build in one or the other and exit the menu, the other can not be built in. If you select both to be built in at the same time though, you can. Again, the "show all" button needs to be pressed, and the hullmod conflict won't go away, but you still can.
Edit: It seems you have to select Minimal Preparations first in order for it to work.
« Last Edit: February 09, 2022, 12:23:41 PM by default »
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

This mod makes hullmod interactions kind of funky. I have 2 examples.

First one is when a mod adds a custom built in hullmod that has incompatibilities, such as Monobolic Construction from DME. It is not compatible with Heavy Armor. However, if you simply "show all" in the build-in menu, it can still be selected and built in. This causes the hullmod conflict to always be there and always play the error noise, but it will still work and do what it's supposed to despite it not normally being possible.

Second one is with more modded hullmods, but still worth noting. "Minimal preparations" added by SCY is incompatible with Efficiency Overhaul, and when you build in one or the other and exit the menu, the other can not be built in. If you select both to be built in at the same time though, you can. Again, the "show all" button needs to be pressed, and the hullmod conflict won't go away, but you still can.
Edit: It seems you have to select Minimal Preparations first in order for it to work.

The reason this is happening is because custom hull mods cannot add themselves to a base game hull mod's incompatibility list. Take your SCY example. If you add efficiency overhaul first, minimal preparations is blocked from being added. But if you add minimal preparations first, you can still add efficiency overhaul. This is because if a mod wanted to make efficiency overhaul inapplicable when minimal preparations is present, it would have to modify -- i.e. replace -- the core game's efficiency overhaul script. This would of course make different mods that wanted to be incompatible with efficiency overhaul incompatible with each other, so it's not a good solution.

Instead, what modders do is this: they will check after ship creation whether the ship simultaneously has both incompatible mods. Then, they will remove one of the incompatible mods if they detect the incompatibility. This is done *after the ship is created*, which means that prior to ship creation there is actually no incompatibility.

I think I may have a way to somewhat fix this. I can check, after you try to build in a set of two or more hull mods, whether a test ship created just for checking the hull mods still has those mods on. If not, I can block the build-in process. I'll see if this works, but honestly if this is going to cause even more trouble I might just make it so you can only build in one hull mod at a time...
Logged

default

  • Lieutenant
  • **
  • Posts: 79
    • View Profile
    • Email

... I might just make it so you can only build in one hull mod at a time...

Wouldn't this still allow for the first example to occur, or would you make it so it has to be installed first? Seems like the main issue is being able to build in hullmods that are not currently installed with OP.
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

True. I should be able to check for mod incompatibilities by spawning a temporary ship and seeing if any other hull mods get removed from the ship's variant.

As for why I even have the "show all" feature, it's a major convenience. I don't like having to flip back and forth between the refit screen and the build-in screen. Now if I could modify the build-in interface in the refit screen directly, then that might not be so much of an issue, but that's not possible without reflection (since no part of the refit screen is exposed in the API) + a complete code rewrite, which I'm unwilling to do.

Logged

Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile

Hello,

I've created a pull request due to conflict with CONCORD's new mechanics, can you take a look?
Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.

Yunru

  • Admiral
  • *****
  • Posts: 1559
    • View Profile

As for why I even have the "show all" feature, it's a major convenience
It's also a bit of a cheat with the most OP-starved ships, allowing you to S-mod things that otherwise would be too expensive to fit.
Pages: 1 2 3 [4] 5 6 ... 11