Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 630 631 [632] 633 634 ... 711

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

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9465 on: January 07, 2023, 10:43:33 AM »

Hey Alex, could you add a way for ships to house drone-fighters only. Currently the only way is through the automated ship hullmod and there's nothing in the hullmod itself that governs this so I'm guessing it's handled elsewhere.

It would be nice if we could, for example, remove the mining pods from the Shepherd and upgrade it to carry wasps... or worse...

You can do this yourself already; make a FighterOPCostModifier listener that checks for the auto_fighter tag or similar, if it doesn't find the tag set the op cost to 10k (I'd imagine automated ship basically does this behind the scenes)
the fighter / weapon op cost mod listeners are super powerful tools, you can mess around with them to do basically anything to op costs

Great Wound

  • Captain
  • ****
  • Posts: 279
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9466 on: January 07, 2023, 11:01:47 AM »

You can do this yourself already; make a FighterOPCostModifier listener that checks for the auto_fighter tag or similar, if it doesn't find the tag set the op cost to 10k (I'd imagine automated ship basically does this behind the scenes)
the fighter / weapon op cost mod listeners are super powerful tools, you can mess around with them to do basically anything to op costs

I get what you're saying (although I would struggle given my sub-par java-skills). But it feels somewhat silly and redundant to re-implement something Alex has already implemented. It's the same with adding AI officers to ships, Alex has already done the work but it's hidden behind the scenes. Adding something like drone_fighters and ai_officer as ship hints to enable them would be a useful feature.

It also saves the headaches when you, me and Scooby-Doo make 3 different implementations and the bugs are blamed on Alex by someone who doesn't know the difference.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24149
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9467 on: January 07, 2023, 11:17:54 AM »

Is there any way to spawn a hulk in combat, and then split it? I ask because I was recently told that setHulk(true), or some similar method, would automatically force a ship to become a hulk. I'm not sure of how true this is, but in the case it's wrong, all I want is some way to just create derelicts in combat without messing around with post-battle loot/creating the death message.

I also want the resulting ship to be dead, so split() works, and I'm not sure if setHulk(true) kills a ship or not.

I think you'd just want to apply a bunch of damage to it. I don't think just .setHulk() would do everything you want, iirc it's just a flag for some of the aspects of it. And if you apply the damage judiciously, you'd get damaged armor etc.


I'd like to add an option to the player's choices when he has the option to stabilize cargo pods floating in space. Where would I do that?

Look for "# CARGO PODS" (without the quotes) in rules.csv!


Are InstallableItemEffects singletons, or does an instance of this exist for every item? Ex. if I install 3 nanoforgres on 3 worlds, do those 3 nanoforges each have their own instance of this class?

Take a look in ItemEffectsRepo; it's all handled there. The entirety of the relevant code is in mod-land!


(Re: drone fighters etc - this isn't the right thread for outright functionality requests, but I'll keep it in mind!)
Logged

Warppy

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9468 on: January 07, 2023, 02:00:16 PM »

Hello, I'm completely new here so I wanted to ask a few things.

I've played starsector for quite some time, but I had some disagreements with a couple of vanilla ships [though I love most of them]. One that I couldn't really stomach was Colossus Mk.II I just didn't think Ludic Path would have modified Colossus in such a way.

So, I've "modded" a micro rework of that ship, that has these features:
Spoiler
- Unlike Mk. III; Mk. II is not a multi-purpose ship, it is a hammer of divine wrath. Pathers have no reason to keep so much unused cargo space in their variant of Colossus. Instead, of (relatively) large cargo space, there's an inbuilt expanded missile racks mod. So you get 10 salvos of barrage instead of 5.

- As the main intended armament is the inbuilt Hammer Barrage, there is little reason to install a better flux capacitors and vents. For that reason, Mk. II. keeps weak flux stats of Cargo Colossus, rather than upgraded stats of Mk. III [though technically not really because safety overdrives doubles flux dissipation anyways]. Pathers also made the shield arc a bit smaller, because they could.

- Instead of flux capacity for shielding, pathers have made Colossus more durable with 1000 armour, rather than just 300 or 600.

- But with so much armour on their ship, all but two of Colossus' turrets have become more like casemates, having only very small (45°) turning arc and awkward angles of fire, with four weapon placements turned into awkward hardpoints entirely. Of those four,  they managed to turn two side facing ballistics turrets into composite hardpoints, but they are still side facing, making them awkward for use of most missile weapons.


[close]

As you can tell, the reason I wrote "modded" in parentheses is that none of my changes is really something that requires any proper modding work. I for example don't even know how I would approach changing weapon ports graphically. I would not compare what I did with what I see actual modders do here.

So what I'm meaning to ask, would sharing a "mod" like one mentioned above be a bad thing? I know it's low effort compared to what I usually see here. Would posting something like that get me in any trouble due to how basic it is?
Logged

Great Wound

  • Captain
  • ****
  • Posts: 279
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9469 on: January 08, 2023, 06:23:12 AM »

Hello, I'm completely new here so I wanted to ask a few things.

I've played starsector for quite some time, but I had some disagreements with a couple of vanilla ships [though I love most of them]. One that I couldn't really stomach was Colossus Mk.II I just didn't think Ludic Path would have modified Colossus in such a way.

So, I've "modded" a micro rework of that ship, that has these features:

Looks like a fine start to me and what you've done makes a kind of sense. I'm not a fan of the Colossus as-is and if I had to tweak it I'd pretty much start out like you have, it's a no brainer adding expanded missile racks.


As you can tell, the reason I wrote "modded" in parentheses is that none of my changes is really something that requires any proper modding work. I for example don't even know how I would approach changing weapon ports graphically. I would not compare what I did with what I see actual modders do here.

So what I'm meaning to ask, would sharing a "mod" like one mentioned above be a bad thing? I know it's low effort compared to what I usually see here. Would posting something like that get me in any trouble due to how basic it is?

The only people who wouldn't consider what you're doing as modding are over-pretentious egoists. It's a mod, create a thread and post it, hopefully you'll get some feedback on what to tweak and improve and if you need direction ask. My first foray into Starsector modding was pretty much the the same as yours, a few tweaks, then it was reskinning existing ships before making my own... etc. If you you don't want to create your own sprites there's a whole thread of free-to-use for you https://fractalsoftworks.com/forum/index.php?topic=12896.0

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24149
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9470 on: January 10, 2023, 08:23:10 AM »

That sounds like a lot of fun! And kind of reminds me of making similar personal mods for Morrowind :)

It probably wouldn't end up in the mod index (super small mods *generally* don't), but there's absolutely no reason why you shouldn't post it!
Logged

TheLemu

  • Ensign
  • *
  • Posts: 19
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9471 on: January 10, 2023, 12:43:11 PM »

Is there any way of increasing the amount of levels an administrator can possess?
Logged

NuclearStudent

  • Ensign
  • *
  • Posts: 20
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9472 on: January 10, 2023, 03:01:41 PM »

Quick question, where is factions threatening you and reducing your growth if you settle in their system handled? Looking to override that.
Logged

Liral

  • Admiral
  • *****
  • Posts: 718
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9473 on: January 11, 2023, 06:40:11 AM »

I have noticed that we will get a new ship explosion animation!  Will we get to use the old animation too, how much control will we have over the new animation, and will the spikes and sphere be 'baked in' together, or will they be two pieces?

Histidine

  • Admiral
  • *****
  • Posts: 4690
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9474 on: January 11, 2023, 04:45:35 PM »

Quick question, where is factions threatening you and reducing your growth if you settle in their system handled? Looking to override that.
That's a Nex function, and you can't currently override it for a specific faction/system except by making the faction non-territorial in its .faction file.
(in vanilla they just go straight to trying to satbomb the offending colony)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4690
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9475 on: January 12, 2023, 04:18:18 AM »

Tracked down a savegame load failure a couple of people were having with Nex. Now I'm like, why does this happen??

Context: I have a CampaignFleetAPI stored in an intel item. I was trying to inflate the fleet in readResolve, but this caused an NPE.
It turns out, trying to access the fleet's faction data in any way causes the NPE, because the faction doesn't have its spec loaded:

Code: java
	FactionAPI faction = offeredFleet.getFaction();
Faction trueFaction = (Faction)faction;

/* Uncomment this line to reload trueFaction's spec and thus prevent the exception that breaks loading the game */
/* trueFaction.getSpec(); */
log.info(String.format("Preparing to inflate merc fleet for faction %s", faction));
log.info(String.format("Faction name is %s", faction.getDisplayName()));
1508912 [Thread-2] INFO  exerelin.campaign.intel.merc.MercContractIntel  - Preparing to inflate merc fleet for faction sindrian_diktat
1508921 [Thread-2] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Error loading
1508921 [Thread-2] ERROR com.fs.starfarer.campaign.save.CampaignGameManager  - Failed calling method
[...]
Caused by: java.lang.NullPointerException: Cannot invoke "com.fs.starfarer.loading.J.this.Object()" because "this.spec" is null
   at com.fs.starfarer.campaign.Faction.getDisplayName(Unknown Source)
   at exerelin.campaign.intel.merc.MercContractIntel.readResolve(MercContractIntel.java:84)
   at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
   at java.base/java.lang.reflect.Method.invoke(Method.java:577)
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9476 on: January 12, 2023, 11:01:17 AM »

How can I get all projectiles within a certain range of a specific missile?

Also, do projectiles have mass like a ship?
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9477 on: January 12, 2023, 12:20:56 PM »

How can I get all projectiles within a certain range of a specific missile?

Also, do projectiles have mass like a ship?

for the projectiles check, something like this should work

Code
            //use whatever for the missile
            //getCheckIterator gets everything in a square area centered on the first param

            MissileAPI missile = null;         
            Iterator<Object> iter = engine.getAllObjectGrid().getCheckIterator(missile.getLocation(), width, height);
            while (iter.hasNext()) {
                Object next = iter.next();
                if (next instanceof DamagingProjectileAPI) {
                    //yada yada do your stuff here
                    //will need to do a second distance check in here if you want to make sure it's a circular area instead of a square
                }
            }

and no, projectiles have no mass.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24149
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9478 on: January 12, 2023, 12:23:30 PM »

Is there any way of increasing the amount of levels an administrator can possess?

Hmm, you could do something like checking for the presence of an admin in a reportPlayerOpenedMarket() method and then tweaking it with code.


Tracked down a savegame load failure a couple of people were having with Nex. Now I'm like, why does this happen??

Context: I have a CampaignFleetAPI stored in an intel item. I was trying to inflate the fleet in readResolve, but this caused an NPE.
It turns out, trying to access the fleet's faction data in any way causes the NPE, because the faction doesn't have its spec loaded:

Right, loading-order stuff like this can happen sometimes and it's a huge pain. I think the way you're working around it seems reasonable? Or am I missing something and is there still a problem? Generally though the solution for this sort of thing is "avoid the situation and lazy-load at some later point" etc.
Logged

prav

  • Captain
  • ****
  • Posts: 395
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9479 on: January 12, 2023, 03:48:46 PM »

and no, projectiles have no mass.

Depends on their spawn type and impact value.
Logged
Pages: 1 ... 630 631 [632] 633 634 ... 711