Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Yunru

Pages: [1] 2 3 ... 5
1
Suggestions / Bigger, better, raids
« on: October 20, 2022, 08:29:32 AM »
Currently you can raid a planet daily, but you pick up a pittance.
This leads to a situation where you sit in orbit doing nothing, just to maximise your profit from the opening you created, and inevitably causes the planet to collapse from lack of stability.

But what if it wasn't like that. What if we actually raided the Refineries, rather than the figurative break room fridge?

My suggestion is to up the cooldown to a full lunar month, and increase the loot you gain correspondingly. It will feel like you're actually raiding a planet's industrial sectors, it prevents accidental decivs, and it removes the downtime of sitting in orbit waiting for a day to pass.

2
Modding / BlockTags - Block vanilla hullmods with but a tag
« on: October 01, 2022, 01:03:39 PM »
Currently incompatible with BDSM, because their scripts are uncompiled (but otherwise fully compatible).

With BlockTags, all you need to make a vanilla hullmod incompatible with one of your own is a tag with the vanilla hullmod's id, and "_block" at the end of it.

Two mods because vanilla's loose script hullmods need to be compiled, but also need to be loaded first so mods like BDSM can overwrite them.

(Please tell me if I missed any vanilla incompatibilities, I had a headache by the end of this so my concetration wasn't the greatest.)

[attachment deleted by admin]

3
Modding / Ship Modules Unselectable
« on: March 22, 2022, 05:34:09 AM »
I've been banging my head against a wall trying to figure this one out:
This ship's modules are... barely selectable, at best. Of the six selectable modules, only the top three (plus the body) can actually be selected, and even that can require some finagling.

Simply put, I'm at a loss as to how to get these to neatly select like seeming all other module ships do.

https://drive.google.com/file/d/1sR6qoNJEK4eycA7q9E9YWwhqiQopZs3l/view?usp=sharing

4
Modding / Values not loading
« on: March 06, 2022, 11:53:45 AM »
I'm hoping this is a sleepy brain moment on my part. Here's the logging reporting what values get loaded:
Code
113832 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Yunru - Commencing hullmod value checks:
113832 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - ACE_MULT: 0.75
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - HAM_MIN: 100.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - HAM_MAX: 10.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - OBC: 50.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - PD_INC: 50.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - PD_RDC: 10.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RAM_INC: 50.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RAM_DEC: 30.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RAM_TD: 0.5
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RAM_TT: 88.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RP_INC: 25.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RLPC_SPD: 50.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RLPC_ENGAGE: 50.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RLPC_REFIT: 30.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - PDW_ROF: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - PDW_FD: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - PDW_MD: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - PDW_BDSM_MAN: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - PDW_BDSM_RNG: 0.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - DMG_RNG_RATIO: 1.5
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - BS_RNG_REDUCTION: 25.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - BS_BOOST_FRIGATE: 0.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - BS_BOOST_DESTROYER: 0.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - BS_BOOST_CRUISER: 0.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - BS_BOOST_CAPITAL: 0.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - BS_BDSM_RNG: 0.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - SVC_TIMID: 0.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - SVC_CAUTIOUS: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - SVC_STEADY: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - SVC_AGGRESSIVE: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - SVC_RECKLESS: 0.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - ARR_BOOST_ALPHA: 25.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - ARR_BOOST_BETA: 15.0
113835 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - ARR_BOOST_GAMMA: 5.0
113832 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - AIECM_ALPHA: 5.0
113832 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - AIECM_BETA: 2.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - AIECM_GAMMA: 1.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - DST_SPD: 100.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - DST_REACH: 60.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - DST_DMG: 15.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - AMR_ALPHA: 100.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - AMR_BETA: 50.0
113833 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - AMR_GAMMA: 25.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - QS_ALPHA: 50.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - QS_BETA: 25.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - QS_GAMMA: 10.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RFN_A: 10.0
113834 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - RFN_B: 50.0

Here's the file it's loading from:
Code
{
    ###########
    # General #
    ###########
   
    # How much Aegis Collision Emitters reduces HE damage
    "aceMult": 0.75,
   
    # HAM
    "HAM": {
        "minArmourFraction": 100, # A percentage modifier, so at 100 a 5% min armour becomes a 10% min armour.
        "maxDamageReduction": 10, # Also a percentage modifier.
    },
   
    # Ordinance Bay Conversion
    "ordinanceBayAmmo": 50, # Percentage increase per bay removed
   
    # PD Targeting Focus
    "PDT": {
        "PDInc": 50, # Percentage increase to PD weapon range
        "NonPDReduction": 10, # Percentage reduction to other weapons
    },
   
    # Ramburn Engines
    "ramburn": {
        "charge": 50, # Max speed and acceleration percentage increase
        "lumber": 30, # Max turn and turn acceleration percentage decrease
        "movie NOS": 88, # Threshold for BDSM time dialation
        "effect": 0.5, # Percentage increase in time dialation for each su above threshold
    },
   
    # Refined Propellant percentage increase
    "rpSpeed": 25,
   
    # Retuned LPCs
    "RLPC": {
        "speed": 50, # Flat increase to Max, Accel, and Decel
        "range": 50, # Percentage increase to engangement range
        "refit": 30, # Percentage increase to refit times
    },
   
    # Escort Wings
    "PDW": {
        "firerate": 10, # Percentage increase to energy and ballistic ROF
        "fighterhate": 0, # Percentage increase to damage dealt to fighters
        "missilehate": 0, # Percentage increase to damage dealt to missiles
        "BDSM range": 10, # Percentage increase to energy and ballistic range when S-Modded with BDSM enabled
        "BDSM manueverability": 10, # Percentage increase to manueverability when S-Modded with BDSM enabled
    },
   
    ###########################
    # Range:Damage converters #
    ###########################
   
    # How much damage is equivalent to 1 range
    "globalDamagePerRange": 1.5,
   
    # How much percentage range Beam Shear removes
    "beamShearReduction": 25,
    # Extra Beam Shear damage % based on hull size
    "beamShearBoost": {
        "frigate": 0,
        "destroyer": 0,
        "cruiser": 0,
        "capital": 0,
    },
    # How much percentage range Beam Shear removes when S-Modded with BDSM enabled
    "beamShearBDSM": 20,
   
    # Percentage range alteration based on captain personality
    "silvervaleConversion": {
        "timid": 50,
        "cautious": 25,
        "steady": 0,
        "aggressive": -25,
        "reckless": -50,
    },
   
    ##########################
    # Integrated AI Hullmods #
    ##########################
   
    # Advanced Redlining Regulations: Piraty speed increase
    "Arr": {
        "alpha": 25,
        "beta": 15,
        "gamma": 5,
    },
   
    # ECM Core percentage bonus
    "AIECM": {
        "alpha": 5,
        "beta": 2,
        "gamma": 1,
    },
   
    # Dynamic Shield Tuning modifiers, must be multiples of 3. Reach must be a multiple of 6.
    "DST": {
        "speedPercent": 100,
        "reachFlat": 60,
        "damagePercent": 15,
    },
   
    # Automated Missile Racks, percentage increase to RoF.
    "AMR": {
        "alpha": 100,
        "beta": 50,
        "gamma": 25,
    },
   
    # Quickstart Protocols, percentage reductions
    "QSP": {
        "alpha": 50,
        "beta": 25,
        "gamma": 10    ,   
    },
   
    # Remote Fighter Network
    "RFN": {
        "range": 50, # Percentage increase to operations range, acceleration, deceleration, and speed
        "damage": 10, # Percentage increase to damage dealt.
    }
}

And here's the code doing the loading (interestingly, all the missing values are at the end):
Code
private static void load(String filePath) throws IOException, JSONException {
            JSONObject json = Global.getSettings().loadJSON(filePath);

            JSONObject arrgh = json.getJSONObject("Arr");
            ARR_BOOST_ALPHA = (float) arrgh.getDouble("alpha");
            ARR_BOOST_BETA = (float) arrgh.getDouble("beta");
            ARR_BOOST_GAMMA = (float) arrgh.getDouble("gamma");

            ACE_MULT = (float) json.getDouble("aceMult");

            JSONObject aiecm = json.getJSONObject("AIECM");
            AIECM_ALPHA = (float) aiecm.getDouble("alpha");
            AIECM_BETA = (float) aiecm.getDouble("beta");
            AIECM_GAMMA = (float) aiecm.getDouble("gamma");

            JSONObject dst = json.getJSONObject("DST");
            DST_SPD = (float) dst.getDouble("speedPercent");
            DST_REACH = (float) dst.getDouble("reachFlat");
            DST_DMG = (float) dst.getDouble("damagePercent");

            JSONObject amr = json.getJSONObject("AMR");
            AMR_ALPHA = (float) amr.getDouble("alpha");
            AMR_BETA = (float) amr.getDouble("beta");
            AMR_GAMMA = (float) amr.getDouble("gamma");

            JSONObject ham = json.getJSONObject("HAM");
            HAM_MAX = (float) ham.getDouble("maxDamageReduction");
            HAM_MIN = (float) ham.getDouble("minArmourFraction");

            OBC = (float) json.getDouble("ordinanceBayAmmo");

            JSONObject pdf = json.getJSONObject("PDT");
            PD_INC = (float) pdf.getDouble("PDInc");
            PD_RDC = (float) pdf.getDouble("NonPDReduction");

            JSONObject qsp = json.getJSONObject("QSP");
            QS_ALPHA = (float) qsp.getDouble("alpha");
            QS_BETA = (float) qsp.getDouble("beta");
            QS_GAMMA = (float) qsp.getDouble("gamma");

            JSONObject ram = json.getJSONObject("ramburn");
            RAM_DEC = (float) ram.getDouble("lumber");
            RAM_INC = (float) ram.getDouble("charge");
            RAM_TD = (float) ram.getDouble("effect");
            RAM_TT = (float) ram.getDouble("movie NOS");

            RP_INC = (float) json.getDouble("rpSpeed");

            JSONObject rfn = json.getJSONObject("RFN");
            RFN_A = (float) rfn.getDouble("damage");
            RFN_B = (float) rfn.getDouble("range");

            JSONObject rlpc = json.getJSONObject("RLPC");
            RLPC_SPD = (float) rlpc.getDouble("speed");
            RLPC_ENGAGE = (float) rlpc.getDouble("range");
            RLPC_REFIT = (float) rlpc.getDouble("refit");

            DMG_RNG_RATIO = (float) json.getDouble("globalDamagePerRange");

            BS_RNG_REDUCTION = (float) json.getDouble("beamShearReduction");
            JSONObject bsBoost = json.getJSONObject("beamShear");
            BS_BOOST_FRIGATE = (float) bsBoost.getDouble("frigate");
            BS_BOOST_DESTROYER = (float) bsBoost.getDouble("destroyer");
            BS_BOOST_CRUISER = (float) bsBoost.getDouble("cruiser");
            BS_BOOST_CAPITAL = (float) bsBoost.getDouble("capital");
            BS_BDSM_RNG = (float) json.getDouble("beamShearBDSM");

            JSONObject svConversion = json.getJSONObject("silvervaleConversion");
            SVC_TIMID = (float) svConversion.getDouble("timid");
            SVC_CAUTIOUS = (float) svConversion.getDouble("cautious");
            SVC_STEADY = (float) svConversion.getDouble("steady");
            SVC_AGGRESSIVE = (float) svConversion.getDouble("aggressive");
            SVC_RECKLESS = (float) svConversion.getDouble("reckless");

            JSONObject pdw = json.getJSONObject("PDW");
            PDW_FD = (float) pdw.getDouble("fighterhate");
            PDW_MD = (float) pdw.getDouble("missilehate");
            PDW_ROF = (float) pdw.getDouble("firerate");
            PDW_BDSM_RNG = (float) pdw.getDouble("BDSM range");
            PDW_BDSM_MAN = (float) pdw.getDouble("BDSM manueverability");

5
As in the title, universal weapons can't be fitted to hybrid, synergy, or composite mounts, despite their description saying they'll fit any mount.

6
Suggestions / Eat burger, shuffle events
« on: February 15, 2022, 03:26:08 AM »
There should be an option to order food at bars to rerandomise the other events.

For balance reasons this should reduce the maximum event number by 1 each time, so you can't over-eat.

7
Modding / Script Failing Mid-use
« on: February 08, 2022, 03:02:35 PM »
So I have the following file in my mod's root file:
Code
{
###########
# General #
###########

# How much Aegis Collision Emitters reduces HE damage
"aceMult": 0.75,

# HAM
"HAM": {
"minArmourFraction": 100, # A percentage modifier, so at 100 a 5% min armour becomes a 10% min armour.
"maxDamageReduction": 10 # Also a percentage modifier.
},

# Ordinance Bay Conversion
"ordinanceBayAmmo": 50, # Percentage increase per bay removed

# PD Targeting Focus
"PDT": {
"PDInc": 50, # Percentage increase to PD weapon range
"NonPDReduction": 10, # Percentage reduction to other weapons
},

# Ramburn Engines
"ramburn": {
"charge": 50, # Max speed and acceleration percentage increase
"lumber": 30, # Max turn and turn acceleration percentage decrease
},

# Refined Propellant percentage increase
"rpSpeed": 25,

# Retuned LPCs
"RLPC": {
"speed": 50, # Flat increase to Max, Accel, and Decel
"range": 50, # Percentage increase to engangement range
"refit": 30, # Percentage increase to refit times
},

###########################
# Range:Damage converters #
###########################

# How much damage is equivalent to 1 range
"globalDamagePerRange": 2.5,

# How much percentage range Beam Shear removes
"beamShearReduction": 25,
    # Extra Beam Shear damage % based on hull size
    "beamShearBoost": {
        "frigate": 25,
        "destroyer": 25,
        "cruiser": 25,
        "capital": 25
    },

# Percentage range alteration based on captain personality
"silvervaleConversion": {
"timid": 50,
"cautious": 25,
"steady": 0,
"aggressive": -25,
"reckless": -50
},

##########################
# Integrated AI Hullmods #
##########################

# ECM Core percentage bonus
"AIECM": {
"alpha": 5,
"beta": 2,
"gamma": 1
},

# Dynamic Shield Tuning modifiers, must be multiples of 3. Reach must be a multiple of 6.
"DST": {
"speedPercent": 100,
"reachFlat": 60,
"damagePercent": 15
},

# Automated Missile Racks, percentage increase to RoF.
"AMR": {
"alpha": 100,
"beta": 50,
"gamma": 25
},

# Quickstart Protocols, percentage reductions
"QSP": {
"alpha": 50,
"beta": 25,
"gamma": 10
},

# Remote Fighter Network
"RFN": {
"range": 50, # Percentage increase to operations range, acceleration, deceleration, and speed
"damage": 10 # Percentage increase to damage dealt.
}
}

And the following code for a plugin:
Code: java
package data.plugin;

import com.fs.starfarer.api.Global;

import org.apache.log4j.Logger;

import data.scripts.overlord.SettingsYunru;

public class yunruSettingsLoad extends com.fs.starfarer.api.BaseModPlugin {

    private static final Logger log = Global.getLogger(yunruSettingsLoad.class);

    @Override
    public void onGameLoad(boolean newGame) {
        SettingsYunru.loadConstants("yunru_hullmods.json");
        log.info("Yunru - onGameLoad ran.");
        log.info("Yunru - Commencing checks.");
        log.info("Float AIECM_ALPHA: " + SettingsYunru.yunruVariables.AIECM_ALPHA + ".");
        log.info("Float AIECM_BETA: " + SettingsYunru.yunruVariables.AIECM_BETA + ".");
        log.info("Float AIECM_GAMMA: " + SettingsYunru.yunruVariables.AIECM_GAMMA + ".");
        log.info("Float DST_SPD: " + SettingsYunru.yunruVariables.DST_SPD + ".");
        log.info("Float DST_REACH: " + SettingsYunru.yunruVariables.DST_REACH + ".");
        log.info("Float DST_DMG: " + SettingsYunru.yunruVariables.DST_DMG + ".");
        log.info("Float AMR_ALPHA: " + SettingsYunru.yunruVariables.AMR_ALPHA + ".");
        log.info("Float AMR_BETA: " + SettingsYunru.yunruVariables.AMR_BETA + ".");
        log.info("Float AMR_GAMMA: " + SettingsYunru.yunruVariables.AMR_GAMMA + ".");
        log.info("Float HAM_MIN: " + SettingsYunru.yunruVariables.HAM_MIN + ".");
        log.info("Float HAM_MAX: " + SettingsYunru.yunruVariables.HAM_MAX + ".");
        log.info("Float OBC: " + SettingsYunru.yunruVariables.OBC + ".");
        log.info("Float PD_INC: " + SettingsYunru.yunruVariables.PD_INC + ".");
        log.info("Float PD_RDC: " + SettingsYunru.yunruVariables.PD_RDC + ".");
        log.info("Float QS_ALPHA: " + SettingsYunru.yunruVariables.QS_ALPHA + ".");
        log.info("Float QS_BETA: " + SettingsYunru.yunruVariables.QS_BETA + ".");
        log.info("Float QS_GAMMA: " + SettingsYunru.yunruVariables.QS_GAMMA + ".");
        log.info("Float RAM_INC: " + SettingsYunru.yunruVariables.RAM_INC + ".");
        log.info("Float RAM_DEC: " + SettingsYunru.yunruVariables.RAM_DEC + ".");
        log.info("Float RP_INC: " + SettingsYunru.yunruVariables.RP_INC + ".");
        log.info("Float RFN_A: " + SettingsYunru.yunruVariables.RFN_A + ".");
        log.info("Float RFN_B: " + SettingsYunru.yunruVariables.RFN_B + ".");
        log.info("Float RLPC_SPD: " + SettingsYunru.yunruVariables.RLPC_SPD + ".");
        log.info("Float RLPC_ENGAGE: " + SettingsYunru.yunruVariables.RLPC_ENGAGE + ".");
        log.info("Float RLPC_REFIT: " + SettingsYunru.yunruVariables.RLPC_REFIT + ".");
        log.info("Float DMG_RNG_RATIO: " + SettingsYunru.yunruVariables.DMG_RNG_RATIO + ".");
        log.info("Float BS_RNG_REDUCTION: " + SettingsYunru.yunruVariables.BS_RNG_REDUCTION + ".");
        log.info("Float BS_BOOST_FRIGATE: " + SettingsYunru.yunruVariables.BS_BOOST_FRIGATE + ".");
        log.info("Float BS_BOOST_DESTROYER: " + SettingsYunru.yunruVariables.BS_BOOST_DESTROYER + ".");
        log.info("Float BS_BOOST_CRUISER: " + SettingsYunru.yunruVariables.BS_BOOST_CRUISER + ".");
        log.info("Float BS_BOOST_CAPITAL: " + SettingsYunru.yunruVariables.BS_BOOST_CAPITAL + ".");
        log.info("Float SVC_TIMID: " + SettingsYunru.yunruVariables.SVC_TIMID + ".");
        log.info("Float SVC_CAUTIOUS: " + SettingsYunru.yunruVariables.SVC_CAUTIOUS + ".");
        log.info("Float SVC_STEADY: " + SettingsYunru.yunruVariables.SVC_STEADY + ".");
        log.info("Float SVC_AGGRESSIVE: " + SettingsYunru.yunruVariables.SVC_AGGRESSIVE + ".");
        log.info("Float SVC_RECKLESS: " + SettingsYunru.yunruVariables.SVC_RECKLESS + ".");
    }
}


With SettingsYunru looking like this:
Code: java
package data.scripts.overlord;

import java.io.IOException;

import com.fs.starfarer.api.Global;

import org.json.JSONException;
import org.json.JSONObject;

public class SettingsYunru {

    public static class yunruVariables {
        public static float ACE_MULT;

        public static float AIECM_ALPHA;
        public static float AIECM_BETA;
        public static float AIECM_GAMMA;

        public static float DST_SPD;
        public static float DST_REACH;
        public static float DST_DMG;

        public static float AMR_ALPHA;
        public static float AMR_BETA;
        public static float AMR_GAMMA;

        public static float HAM_MIN;
        public static float HAM_MAX;

        public static float OBC;

        public static float PD_INC;
        public static float PD_RDC;

        public static float QS_ALPHA;
        public static float QS_BETA;
        public static float QS_GAMMA;

        public static float RAM_INC;
        public static float RAM_DEC;

        public static float RP_INC;

        public static float RFN_B;
        public static float RFN_A;

        public static float RLPC_SPD;
        public static float RLPC_ENGAGE;
        public static float RLPC_REFIT;

        public static float DMG_RNG_RATIO;

        public static float BS_RNG_REDUCTION;
        public static float BS_BOOST_FRIGATE;
        public static float BS_BOOST_DESTROYER;
        public static float BS_BOOST_CRUISER;
        public static float BS_BOOST_CAPITAL;

        public static float SVC_TIMID;
        public static float SVC_CAUTIOUS;
        public static float SVC_STEADY;
        public static float SVC_AGGRESSIVE;
        public static float SVC_RECKLESS;

        /** Load constants from a json file */
        private static void load(String filePath) throws IOException, JSONException {
            JSONObject json = Global.getSettings().loadJSON(filePath);

            ACE_MULT = (float) json.getDouble("aceMult");

            JSONObject aiecm = json.getJSONObject("AIECM");
            AIECM_ALPHA = (float) aiecm.getDouble("alpha");
            AIECM_BETA = (float) aiecm.getDouble("beta");
            AIECM_GAMMA = (float) aiecm.getDouble("gamma");

            JSONObject dst = json.getJSONObject("DST");
            DST_SPD = (float) dst.getDouble("speedPercent");
            DST_REACH = (float) dst.getDouble("reachFlat");
            DST_DMG = (float) dst.getDouble("damagePercent");

            JSONObject amr = json.getJSONObject("AMR");
            AMR_ALPHA = (float) amr.getDouble("alpha");
            AMR_BETA = (float) amr.getDouble("beta");
            AMR_GAMMA = (float) amr.getDouble("gamma");

            JSONObject ham = json.getJSONObject("HAM");
            HAM_MAX = (float) ham.getDouble("maxDamageReduction");
            HAM_MIN = (float) ham.getDouble("minArmourFraction");

            OBC = (float) json.getDouble("ordinanceBayAmmo");

            JSONObject pdf = json.getJSONObject("PDT");
            PD_INC = (float) pdf.getDouble("PDInc");
            PD_RDC = (float) pdf.getDouble("NonPDReduction");

            JSONObject qsp = json.getJSONObject("QSP");
            QS_ALPHA = (float) qsp.getDouble("alpha");
            QS_BETA = (float) qsp.getDouble("beta");
            QS_GAMMA = (float) qsp.getDouble("gamma");

            JSONObject ram = json.getJSONObject("ramburn");
            RAM_DEC = (float) ram.getDouble("lumber");
            RAM_INC = (float) ram.getDouble("charge");

            RP_INC = (float) json.getDouble("rpSpeed");

            JSONObject rfn = json.getJSONObject("RFN");
            RFN_A = (float) rfn.getDouble("damage");
            RFN_B = (float) rfn.getDouble("range");

            JSONObject rlpc = json.getJSONObject("RLPC");
            RLPC_SPD = (float) rlpc.getDouble("speed");
            RLPC_ENGAGE = (float) rlpc.getDouble("range");
            RLPC_REFIT = (float) rlpc.getDouble("refit");

            DMG_RNG_RATIO = (float) json.getDouble("globalDamagePerRange");

            BS_RNG_REDUCTION = (float) json.getDouble("beamShearReduction");
            JSONObject bsBoost = json.getJSONObject("beamShearBoost");
            BS_BOOST_FRIGATE = (float) bsBoost.getDouble("Frigate");
            BS_BOOST_DESTROYER = (float) bsBoost.getDouble("Destroyer");
            BS_BOOST_CRUISER = (float) bsBoost.getDouble("Cruiser");
            BS_BOOST_CAPITAL = (float) bsBoost.getDouble("Capital");

            JSONObject svConversion = json.getJSONObject("silvervaleConversion");
            SVC_TIMID = (float) svConversion.getDouble("Timid");
            SVC_CAUTIOUS = (float) svConversion.getDouble("Cautious");
            SVC_STEADY = (float) svConversion.getDouble("Steady");
            SVC_AGGRESSIVE = (float) svConversion.getDouble("Aggressive");
            SVC_RECKLESS = (float) svConversion.getDouble("Reckless");

        }
    }
       
    public static void loadConstants(String filePath) {
        try {
            yunruVariables.load(filePath);
        } catch (IOException | JSONException e) {
            e.printStackTrace();
        }
    }

}

So what this should be doing is reading the values from the file and assigning the to the variables. However, what's printed to the log makes things very, very confusing:
Code
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Yunru - onGameLoad ran.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Yunru - Commencing checks.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float AIECM_ALPHA: 5.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float AIECM_BETA: 2.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float AIECM_GAMMA: 1.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float DST_SPD: 100.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float DST_REACH: 60.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float DST_DMG: 15.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float AMR_ALPHA: 100.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float AMR_BETA: 50.0.
16557 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float AMR_GAMMA: 25.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float HAM_MIN: 100.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float HAM_MAX: 10.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float OBC: 50.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float PD_INC: 50.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float PD_RDC: 10.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float QS_ALPHA: 50.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float QS_BETA: 25.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float QS_GAMMA: 10.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RAM_INC: 50.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RAM_DEC: 30.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RP_INC: 25.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RFN_A: 10.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RFN_B: 50.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RLPC_SPD: 50.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RLPC_ENGAGE: 50.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float RLPC_REFIT: 30.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float DMG_RNG_RATIO: 2.5.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float BS_RNG_REDUCTION: 25.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float BS_BOOST_FRIGATE: 0.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float BS_BOOST_DESTROYER: 0.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float BS_BOOST_CRUISER: 0.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float BS_BOOST_CAPITAL: 0.0.
16558 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float SVC_TIMID: 0.0.
16559 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float SVC_CAUTIOUS: 0.0.
16559 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float SVC_STEADY: 0.0.
16559 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float SVC_AGGRESSIVE: 0.0.
16559 [Thread-3] INFO  data.plugin.yunruSettingsLoad  - Float SVC_RECKLESS: 0.0.

As you can see, it just... stops working, 8 from the bottom of the list. No crashes or anything, but obviously non-functional.

I am completely lost as to what could be going on, any ideas?

8
Even with CORONA_EFFECT_MULT at 0, ships struck by hyperspace storms still lose some armour.

9
Suggestions / Antimatter should do HE damage
« on: January 05, 2022, 12:45:59 PM »
Something that's been bugging at me for a while:
Anti-matter is the explosive to end all explosives.

So why are the two weapons that boil down to "hit it with antimatter so it explodes" both weapons that deal energy damage? (Other than for gameplay reasons.)

10
Mods / [0.95.1] Badgesector: Portrait Conversion
« on: January 05, 2022, 12:13:46 PM »

Badgesector: Portrait Conversion

Features:
  • Many badges to choose from at the start of the game!
  • Pick your favourite badge for others to see when interacting with you!
  • Explore the sector and meet people to see their favourite badges!

(Un)Installation Instructions:
To install, simply click on the banner to download, then activate the mod.
To uninstall, simply de-activate the mod.

Custom Badges:
Included in the mod file is a template that can be applied to any portrait you want to convert to Badgesector. Simple apply it atop the portrait on a new layer using a programme like Paint.net, merge the layers, and save!

(Badgesector brought to you by the school of quick and easy edits.)

11
Modding / Custom Hullmod Woes
« on: January 01, 2022, 06:15:52 AM »
So I'm trying to make this hullmod work, and it just doesn't. I've no idea why, except maybe some modules voodoo.

What's supposed to happen is that it gets the modified speed from all active engines (designated by a dummy hullmod), totals it, and then divides it by the total number of engines.

This should, in theory, mean that putting things like Unstable Injectors on the engine modules increases the speed of the ship. In practice, it's having no effect.
Code
package data.scripts.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.ShipAPI;

public class YunruModuleEngines extends BaseHullMod {

    @Override
    public void advanceInCombat(ShipAPI ship, float amount) {
        super.advanceInCombat(ship, amount);

if (!ship.isAlive()) return;

        Float yunruMaxEngines = 0f;
        Float yunruEngineCount = 0f;
        Float yunruFlameoutCount = 0f;
        Float yunruMaxSpeed = 0f;
        Float yunruSpeedDif = 0f;
        Float yunruMaxAcc = 0f;
        Float yunruAccDif = 0f;
       
        for (ShipAPI module : ship.getChildModulesCopy()) {
            if (module.getVariant().getHullMods().contains("yunru_engine_module")) yunruMaxEngines += 1f;
            if (module.getStationSlot() == null || !module.isAlive() || !module.getVariant().getHullMods().contains("yunru_engine_module")) continue;
            if (module.getEngineController().isFlamedOut() == true) yunruFlameoutCount += 1f;
            if (module.getEngineController().isDisabled() == true) continue;
            yunruEngineCount += 1f;
            yunruMaxSpeed += module.getMutableStats().getMaxSpeed().getModifiedValue();
            yunruMaxAcc += module.getMutableStats().getAcceleration().getModifiedValue();
        }

        yunruMaxSpeed /= yunruMaxEngines;
        yunruMaxAcc /= yunruMaxEngines;

        yunruSpeedDif += yunruMaxSpeed-ship.getMutableStats().getMaxSpeed().getModifiedValue();
        yunruAccDif += yunruMaxAcc-ship.getMutableStats().getAcceleration().getModifiedValue();

        ship.getMutableStats().getMaxSpeed().modifyFlat("yunruModuleEngines", yunruSpeedDif);
        ship.getMutableStats().getAcceleration().modifyFlat("yunruModuleEngines", yunruAccDif);

        if (yunruFlameoutCount.equals(yunruMaxEngines) || yunruEngineCount.equals(0f)) ship.getEngineController().forceFlameout();

    }

}

12
Mods / [0.95.1] Slightly Better Tech-Mining
« on: December 31, 2021, 02:19:29 PM »

Tech-Mining. It's... an industry.
It's an industry that gives you diminishing returns of items you want, and decent credits-worth of... useless materials that other industries supply in vaster quantities.

So let's change that.
First up: No more trash! Fuel? Supplies? Metal? Transplutonics? Volatiles? Out the window! Now you get more of the other items, but still the same total value.
Second of all: Story points? On a diminishing returns industry? No good. So goodbye +25% bonus, and hello no depletion! Give your tech mine a story point and that ruin's as good as... freshly ruined?

Additionally, the exact level of depletion, should it be present, is now trackable in the industry's tooltip!

Now with two modes: Depletion floor, and depletion reset, configurable in... the config.

Safe to add to saves (although any existing tech mines will need rebuilding), unfortunately not safe to remove from saves, and now compatible with Better Colonies!

13
Suggestions / Can ships please stop flying into each other?
« on: December 23, 2021, 02:37:51 PM »
Especially with stations, although I've seen it elsewhere, ships have a big problem of happily ramming themselves into other ships. And I don't mean the enemy, I mean they'll practically ignore that there's a friendly ship between them and where they want to be.

The last battle I had, I lost over half of my small ships, not to enemy fire, but due to merrily backing into a Star Fortress.

14
Modding / Strange AI Behaviour
« on: December 16, 2021, 02:03:35 PM »
So I was testing a new ship for the first time, and I'm encountering a really weird bug (I think?) with the AI.

Here's the ship's loadout, it has no officer, and the fleet doctrine's set to steady (the custom hullmod doubles ammo capacity, ammo regen speed, and RoF for missiles):
Spoiler
[close]

One would assume that, given the Steady doctrine, it would stay at range in a (sim) fight against a Sunder. However, here's the opening moments of that fight:
Spoiler
[close]

At the first chance it dives straight at the Sunder to knife-fight with its point defence Vulcans, only ever backing off to try and vent flux. This repeats until it dies.

It seems like missiles aren't considered for longest weapon range, even ones with recharging or infinite ammo?

Edit: ***, thought I was in modded.

15
Suggestions / Omni-Shield rotation map to scroll wheel
« on: December 10, 2021, 02:35:38 PM »
Maybe tie zoom to Crtl+Scroll.
Being able to aim weapons and omnishield would be a great QoL, and is already something the AI can do.

Pages: [1] 2 3 ... 5