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: Anubis-class Cruiser (12/20/24)

Author Topic: Is it possible to make a hullmod that reduces raid casualties?  (Read 517 times)

chiconspiracy

  • Ensign
  • *
  • Posts: 2
    • View Profile
Is it possible to make a hullmod that reduces raid casualties?
« on: February 22, 2024, 07:55:24 AM »

I'd like to try creating a recon drone hullmod that accompanies marines on a raid and reduces their casualties like the Tactical Drills skill does by altering "ground_attack_casualties_mult". I've looked at quite a few examples of published mods and it seems the most they can do is modify the "ground_support" raid damage multiplier which doesn't help with casualties (which makes no sense since they should be eliminating the enemy faster and removing danger).

Has anyone tried this and had any luck, or does anyone know of a mod that has done it?

Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7568
  • Harpoon Affectionado
    • View Profile
Re: Is it possible to make a hullmod that reduces raid casualties?
« Reply #1 on: February 22, 2024, 02:20:35 PM »

I haven't modded in a long time, but if the effect is already used in the tactical drills skill than you should be able to do the same thing by calling the same command.
Logged

Princess of Evil

  • Admiral
  • *****
  • Posts: 766
  • Balance is not an endpoint, but a direction.
    • View Profile
Re: Is it possible to make a hullmod that reduces raid casualties?
« Reply #2 on: February 23, 2024, 07:39:05 AM »

You can modify that stat through a HullModFleetEffect hullmod - check starfarer.api.jar for PhaseField for an example (specifically, the onFleetSync part).
Logged
Proof that you don't need to know any languages to translate, you just need to care.

chiconspiracy

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Is it possible to make a hullmod that reduces raid casualties?
« Reply #3 on: March 09, 2024, 12:46:42 AM »

You can modify that stat through a HullModFleetEffect hullmod - check starfarer.api.jar for PhaseField for an example (specifically, the onFleetSync part).

So it should be possible to put PLANETARY_OPERATIONS_CASUALTIES_MULT here?

   public void onFleetSync(CampaignFleetAPI fleet) {
      float mult = getPhaseFieldMultBaseProfileAndTotal(fleet, null, 0f, 0f)[0];
      if (fleet.is()) mult = 1f;
      if (mult <= 0) {
         fleet.getDetectedRangeMod().unmodifyMult(MOD_KEY);
      } else {
         fleet.getDetectedRangeMod().modifyMult(MOD_KEY, mult, "Phase ships in fleet");
      }
   }
Logged