Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: hullmod help  (Read 2100 times)

Regoso

  • Ensign
  • *
  • Posts: 25
    • View Profile
hullmod help
« on: July 22, 2017, 05:55:15 PM »

 Feel like crap that i need to ask for help....... i have no idea what to do as i know 0 java.  im attempting to in effect create a fighter wing based Heavy Ballistics Integration hullmod. Except it increases there cost not decreases.

the code im dealing with "bolded the parts iv edited""enlarged the one part i know i need to change but have no idea what to put in there":
Spoiler

package com.fs.starfarer.api.impl.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import com.fs.starfarer.api.impl.campaign.ids.Stats;

public class IncreasedHangarLogistics extends BaseHullMod {

   public static final float COST_INCREASE  = 10;
   
   public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
      stats.getDynamic().getMod(Stats.LARGE_BALLISTIC_MOD).modifyPercent(id, -COST_INCREASE);
   }
   
   public String getDescriptionParam(int index, HullSize hullSize) {
      if (index == 0) return "" + (int) COST_INCREASE + "";
      return null;
   }

   @Override
   public boolean affectsOPCosts() {
      return true;
   }

}
[close]
Any help at all would be awesome even if it just points me to were i can make the things to replace the things that needs to be replaced.
« Last Edit: July 22, 2017, 06:45:41 PM by Regoso »
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: hullmod help
« Reply #1 on: July 23, 2017, 10:53:46 PM »

As far as I can tell, that particular hullmod is scripted internally in the games api, so you can't copy and edit the hullmod file like some others without creating your own script for it and compiling it into a jar, which is quite a bit of research and effort.

Well worth it if you want to get into modding starsector though.

What that file does is give a description and set a few attributes like op cost. I was going to do the same thing to reduce the cost of small mounts on capitals, but it can't even be used for that. (at least i couldn't get it to work)

Can't remember off the top of my head, but I don't even think the api supports a reference to fighter wings op cost yet, and so you cannot do things like effect their cost per ship. You also can't make specific wings -like only a hi tech bomber for instant- modified in any way either or restrict them by hull.

I can tell you that some of this support has been requested though.
Logged

Regoso

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: hullmod help
« Reply #2 on: July 25, 2017, 01:33:25 PM »

As far as I can tell, that particular hullmod is scripted internally in the games api, so you can't copy and edit the hullmod file like some others without creating your own script for it and compiling it into a jar, which is quite a bit of research and effort.

Well worth it if you want to get into modding starsector though.

What that file does is give a description and set a few attributes like op cost. I was going to do the same thing to reduce the cost of small mounts on capitals, but it can't even be used for that. (at least i couldn't get it to work)

Can't remember off the top of my head, but I don't even think the api supports a reference to fighter wings op cost yet, and so you cannot do things like effect their cost per ship. You also can't make specific wings -like only a hi tech bomber for instant- modified in any way either or restrict them by hull.

I can tell you that some of this support has been requested though.

Thanks for the heads up saved me alot of time and pain searching for a way
Logged