Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 691 692 [693] 694 695 ... 710

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

dor99alon

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10380 on: December 21, 2023, 11:01:00 AM »

The question:
Anyone knows how I can determine if the ShipAPI represents a ship that belongs to the player faction?

The details:
I'm trying to change hullmod "isApplicableToShip(ShipAPI ship)" method to check if the ship is part of the player faction or not.

I was hoping that ship.getFleetMember().GetFleetCommanderForStats().isPlayer() will do the trick but it returns false for the ships in my fleet.

I noticed there is ship.getOriginalOwner() which always returns "-1" and ship.getFleetMember().getOwner() which returns "0" but I have no idea if it returns the same for AI ships as well (no idea how to check that) so I'm hesitant to incorporate it without asking for advice first.

Thank you very much for helping me.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10381 on: December 22, 2023, 12:09:59 AM »

ShipAPI.beginLandingAnimation(ShipAPI target)

How well that'll actually work, I don't know; not enough may be exposed to make it work out.
Hi, I'd like to report that, unfortunately this function indeed doesn't quite work. I doesn't seem to trigger the landing animation when called. But it's okay, I will implement a workaround for now, I look forward to a future update in which this is possible!
Logged

TimeDiver

  • Captain
  • ****
  • Posts: 354
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10382 on: December 22, 2023, 05:41:24 AM »

In regards to getHitStrengthBonus(), does a multiplier increase only apply to armor, or also to shields?

One of my 'self-use-only' hullmods uses getHitStrengthBonus() in combination with getDamageToTargetShieldsMult() to modify damage output, and combined with other 'self-use-only' hullmods for role-playing "a C.O. who (foolishly) dials back their weapons output against weaker opponents, or goes all out against actual threats when necessary."

In particular, one scenario has both parameters being used to either severely nerf an ENERGY-type weapon, or to increase the output by an arbitrary multiplier; do the two combine for shields, or do any increases / decreases apply separately to armor/shields?
« Last Edit: December 22, 2023, 09:20:30 AM by TimeDiver »
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10383 on: December 22, 2023, 08:55:05 AM »

In regards to getHitStrengthBonus(), does a multiplier increase only apply to armor, or also to shields?
"Hit Strength" is the term the game uses. It'd be clearer if described as "armor penetration"; that value has no effect on damage dealt to shields. (It does have an effect on damage dealt to hull, however, due to the 5% residual armor.)
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10384 on: December 22, 2023, 12:15:45 PM »

Would it be possible to mod in such a thing as a reflective shield - not in that it would reflect things back to sender, but rather that the shield's surface would act like a (partially effective) mirror? I'd ideally manually blacklist some weapons from being reflected (anything that isn't explicitly light, for instance) as well. Even better if this can be done for arbitrary shield shapes (ellispoids is what I'm thinking about atm).

I'm not the best person to answer this, really; vanilla doesn't do this. From what I've seen/heard about in mods, maybe it's possible, but I'd take that with a grain of salt.


The question:
Anyone knows how I can determine if the ShipAPI represents a ship that belongs to the player faction?

The details:
I'm trying to change hullmod "isApplicableToShip(ShipAPI ship)" method to check if the ship is part of the player faction or not.

I was hoping that ship.getFleetMember().GetFleetCommanderForStats().isPlayer() will do the trick but it returns false for the ships in my fleet.

I noticed there is ship.getOriginalOwner() which always returns "-1" and ship.getFleetMember().getOwner() which returns "0" but I have no idea if it returns the same for AI ships as well (no idea how to check that) so I'm hesitant to incorporate it without asking for advice first.

Thank you very much for helping me.

In that method, the answer is "always" - this method is only called from the refit screen and similar. (Note that this means it also won't do anythin if e.g. you're trying to use this method to prevent the hullmod from being used on NPC ships.)


Hi, I'd like to report that, unfortunately this function indeed doesn't quite work. I doesn't seem to trigger the landing animation when called. But it's okay, I will implement a workaround for now, I look forward to a future update in which this is possible!

Thank you, noted!
Logged

dor99alon

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10385 on: December 23, 2023, 01:46:58 AM »

In that method, the answer is "always" - this method is only called from the refit screen and similar. (Note that this means it also won't do anythin if e.g. you're trying to use this method to prevent the hullmod from being used on NPC ships.)
Thank you very much for replying to my question.
This is exactly what I'm trying to do so if this method is "not the right place" than how could I block the hullmod from being used on NPC ships based on a condition?

For example like the SO hullmod is only allowed in frigates and destroyers, I want to have my mod only be allowed by AI based on some condition but not lock the player by that condition.
If we continue with the SO example than I would allow my hullmod to be installed on player capital ships but not on NPC capital ships.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10386 on: December 24, 2023, 11:44:40 AM »

Thank you very much for replying to my question.
This is exactly what I'm trying to do so if this method is "not the right place" than how could I block the hullmod from being used on NPC ships based on a condition?

For example like the SO hullmod is only allowed in frigates and destroyers, I want to have my mod only be allowed by AI based on some condition but not lock the player by that condition.
If we continue with the SO example than I would allow my hullmod to be installed on player capital ships but not on NPC capital ships.

The ship loadout generator doesn't know about any of that but also won't try to stick random hullmods onto variants. The only way it's going to end up on a variant is if one of the stock variants for the ship has that hullmod. So for example if you added a variant of a capital ship with SO, then that capital ship would sometimes end up with SO in NPC fleets, despite it not being possible for the player to install in one. But since variants like that don't exist (at least in vanilla), this doesn't happen.
Logged

dor99alon

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10387 on: December 24, 2023, 11:46:00 PM »

The ship loadout generator doesn't know about any of that but also won't try to stick random hullmods onto variants. The only way it's going to end up on a variant is if one of the stock variants for the ship has that hullmod. So for example if you added a variant of a capital ship with SO, then that capital ship would sometimes end up with SO in NPC fleets, despite it not being possible for the player to install in one. But since variants like that don't exist (at least in vanilla), this doesn't happen.
Thank you again for replying to my question.
Yesterday I captured Erradicator which was using my hullmod which is exactly what I wanted to avoid :)
I don't know how to add "variants" to the game (unless you count the things I design and than "copy\paste" between ships in my own fleet as "variants") so I'm not sure how it happened.

Is there any way to tell the ship loadout manager to avoid using a particular hullmod altogether?
Maybe I can make two versions of my hullmod: one for "player only" and another for "AI"? (I don't know how to limit hullmod to player only).
Logged

ymfah

  • Ensign
  • *
  • Posts: 33
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10388 on: December 25, 2023, 02:10:40 AM »

Question

How to make D-mods and Hidden/Hidden Always flagged hullmods be S-moddable?

Detail

My first instinct was to look at BaseHullMod and overwrite it. Turns out this was not the case.

The only instance where I can see if Dmod/Hidden is checked is in com.fs.starfarer.api.util.Misc and ModPickerDialogV3.class, both of which are in vanilla and not easily accessible within a hullmod.

My current workaround is to make hidden hullmods no longer hidden in hull_mods.csv and add a no_drop, no_salvage tag. However, this cannot be applied to d-mods without messing with the games d-mod related codes and and the workaround has other issues of its own like showing up in the main menu missions.

How would I make D-mods and Hidden/Hidden Always flagged hullmods be S-moddable?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10389 on: December 25, 2023, 09:07:38 PM »

Hmm. There's a bit of a discussion a few pages earlier in this thread, starting here, but that doesn't get into d-mods, just trying to make hidden hullmods s-moddable. Without the d-mod aspect, I think it's mostly doable, with some limited rough edges; the posts from SafariJohn may be useful. It does also involve the "not hidden, no_drop/no_drop_salvage" approach.

With d-mods, I don't think this is going to be doable. I mean, it *might* be but there would likely be all sorts of problems, the game definitely expects s-mods and d-mods to be distinct sets and offhand I couldn't even tell you what all might break when that assumption is broken.

Your best bet might be something like duplicating d-mods as not-d-mods with no_drop etc and using an alternative UI to s-mod those into the hull instead. And have some sort of script remove the d-mod versions of those if the hull winds up with them again? Hm, this sounds very hacky, but it's the only thing that comes to mind that feels even remotely workable.
Logged

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10390 on: January 01, 2024, 09:30:13 PM »

question
is there another way to play a sound streamed from disk - i.e. without taking up preload memory - other than playCustomMusic ?
or to play more than one music simultaneously?
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: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10391 on: January 02, 2024, 03:15:29 PM »

There isn't, sorry!
Logged

TimeDiver

  • Captain
  • ****
  • Posts: 354
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10392 on: January 02, 2024, 03:57:22 PM »

Meant to post something here, but the forums were (temporarily) down at the time.

Is there a way to make missiles not impact with asteroids and/or disabled/destroyed ship hulks after they are launched?

One of my theories was to add/replace 'HITS_SHIPS_ONLY_NO_FF' to 'collisionClass' in a missile's .proj file, but that didn't work.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10393 on: January 02, 2024, 04:53:25 PM »

Hmm, I don't think there's a collision class that does that.
Logged

vicegrip

  • Commander
  • ***
  • Posts: 194
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10394 on: January 03, 2024, 09:41:51 AM »

How do I remove a blueprint package of "package_id" from the player's cargo?
Pages: 1 ... 691 692 [693] 694 695 ... 710