Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 565 566 [567] 568 569 ... 710

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

briansd9

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8490 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: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8491 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

  • Commander
  • ***
  • Posts: 135
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8492 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: 131
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8493 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

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8494 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

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8495 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: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8496 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: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8497 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: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8498 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

  • Commander
  • ***
  • Posts: 105
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8499 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

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8500 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 #8501 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.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8502 on: February 09, 2022, 01:10:04 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.

I don't think there's any specific config value for this, at least not that I recall. You could do this with a script, though.


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?)

Just an oversight; added that in.

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

Hmm - mainly I'm amazed that this works at all, not that it breaks somewhat. Once a ship exists, changes to the variant are not going to be reflected in the ship - all of the weapons etc for the ship have been created, so changing the variant should have at best no effect. Or, at worst, it might break things if some ship code expects the variant to still match what the ship was created from.


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.

Hmm, I don't think you can do this *during* a battle. But you could provide your own version of BattleCreationPluginImpl for a specific battle that would add the objectives you want.
Logged

itBeABruhMoment

  • Commander
  • ***
  • Posts: 159
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8503 on: February 09, 2022, 02:40:37 PM »

I'm trying to use the SettingsAPI loadJSON method. To test it, I tried loading my mod's "mod_info.json" with the console command "runcode org.json.JSONObject data = Global.getSettings().loadJSON("mod_info.json", "better_variants");", "better_variants" being the id of my mod. The problem is that this line of code throws a nullpointer exception. Any clue what I what I might be doing wrong?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8504 on: February 09, 2022, 02:47:36 PM »

Seeing the actual stack trace would help here - I forget, does console commands print it? I'd kind of expect that it would...
Logged
Pages: 1 ... 565 566 [567] 568 569 ... 710