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.

Messages - Kothyxaan

Pages: [1] 2
1
Mods / Re: [0.96a] Ship Catalogue/Variant Editor (SCVE) v1.8.1
« on: July 11, 2023, 12:29:18 AM »
This mod is so handy, cheers for making it  ;D
I have a small request if it is possible. Would it be possible to have a "load variant" option in the refit hull mod selection (kind of like the save variant option)?
Not sure if that would be possible though.
Thanks again for this mod.

2
Looking for help: I want to make Ballistic Range Finder work for small ships too...

Try using the source file in starfarer.api.zip\com\fs\starfarer\api\impl\hullmods\ rather than decompiling the .class file. You'll need to change the package to your mod directory as well, but other than that it should work better.
Thanks for the reply.
I don't know how to edit .class files. I used JD-GUI to open it up, copy pasted the .class info (that seems to be opened in a .java format) into a .java file. I have the hullmod.csv pointing to it. It just doesn't work. JD-GUI doesn't let me edit the file itself.
Meh.

3
Looking for help: I want to make Ballistic Range Finder work for small ships too

I have extracted the .class and changed it to a java and added frigate to the classes of ship that can use the ballistic range finder. When I try to load the game I get an error message


Spoiler
package data.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
//myone removed  import com.fs.starfarer.api.impl.hullmods.BallisticRangefinder;
import com.fs.starfarer.api.loading.WeaponSlotAPI;
import com.fs.starfarer.api.ui.Alignment;
import com.fs.starfarer.api.ui.TooltipMakerAPI;
import com.fs.starfarer.api.util.Misc;
import java.awt.Color;

public class BallisticRangefinder extends BaseHullMod {
  public static float BONUS_MAX_1 = 800.0F;
 
  public static float BONUS_MAX_2 = 800.0F;
 
  public static float BONUS_MAX_3 = 900.0F;
 
  public static float BONUS_SMALL_1 = 100.0F;
 
  public static float BONUS_SMALL_2 = 100.0F;
 
  public static float BONUS_SMALL_3 = 200.0F;
 
  public static float BONUS_MEDIUM_3 = 100.0F;
 
  public static float HYBRID_MULT = 2.0F;
 
  public static float HYBRID_BONUS_MIN = 100.0F;
 
  public void applyEffectsBeforeShipCreation(ShipAPI.HullSize hullSize, MutableShipStatsAPI stats, String id) {}
 
  public static WeaponAPI.WeaponSize getLargestBallisticSlot(ShipAPI ship) {
    if (ship == null)
      return null;
    WeaponAPI.WeaponSize largest = null;
    for (WeaponSlotAPI slot : ship.getHullSpec().getAllWeaponSlotsCopy()) {
      if (!slot.isDecorative() &&
        slot.getWeaponType() == WeaponAPI.WeaponType.BALLISTIC && (
        largest == null || largest.ordinal() < slot.getSlotSize().ordinal()))
        largest = slot.getSlotSize();
    }
    return largest;
  }
 
  public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
    WeaponAPI.WeaponSize largest = getLargestBallisticSlot(ship);
    if (largest == null)
      return;
    float small = 0.0F;
    float medium = 0.0F;
    float max = 0.0F;
    switch (largest) {
      case null:
        small = BONUS_SMALL_3;
        medium = BONUS_MEDIUM_3;
        max = BONUS_MAX_3;
        break;
      case MEDIUM:
        small = BONUS_SMALL_2;
        max = BONUS_MAX_2;
        break;
      case SMALL:
        small = BONUS_SMALL_1;
        max = BONUS_MAX_1;
        break;
    }
    ship.addListener(new RangefinderRangeModifier(small, medium, max));
  }
 
  public String getDescriptionParam(int index, ShipAPI.HullSize hullSize) {
    return null;
  }
 
  public boolean shouldAddDescriptionToTooltip(ShipAPI.HullSize hullSize, ShipAPI ship, boolean isForModSpec) {
    return false;
  }
 
  public void addPostDescriptionSection(TooltipMakerAPI tooltip, ShipAPI.HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec) {
    float pad = 3.0F;
    float opad = 10.0F;
    Color h = Misc.getHighlightColor();
    Color bad = Misc.getNegativeHighlightColor();
    Color t = Misc.getTextColor();
    Color g = Misc.getGrayColor();
    WeaponAPI.WeaponSize largest = getLargestBallisticSlot(ship);
    tooltip.addPara("Utilizes targeting data from the ship's largest ballistic slot to benefit certain weapons, extending the base range of typical ballistic weapons to match similar but larger weapons. Also benefits hybrid weapons. Point-defense weapons are unaffected.",
       
        opad, h, new String[] { "ship's largest ballistic slot", "base range" });
    tooltip.addPara("The range bonus is based on the size of the largest ballistic slot, and the increased base range is capped, but still subject to other modifiers.",
        opad);
    tooltip.addSectionHeading("Ballistic weapon range", Alignment.MID, opad);
    tooltip.addPara("Affects small and medium ballistic weapons.", opad);
    float col1W = 120.0F;
    float colW = (int)((width - col1W - 12.0F) / 3.0F);
    float lastW = colW;
    tooltip.beginTable(Misc.getBasePlayerColor(), Misc.getDarkPlayerColor(), Misc.getBrightPlayerColor(),
        20.0F, true, true,
        new Object[] { "Largest b. slot", Float.valueOf(col1W), "Small wpn", Float.valueOf(colW), "Medium wpn", Float.valueOf(colW), "Range cap", Float.valueOf(lastW) });
    Color c = null;
    if (largest == WeaponAPI.WeaponSize.SMALL) {
      c = h;
    } else if (largest == WeaponAPI.WeaponSize.MEDIUM) {
      c = h;
    } else {
      c = g;
    }
    tooltip.addRow(new Object[] {
          Alignment.MID, c, "Small / Medium",
          Alignment.MID, c, "+" + (int)BONUS_SMALL_1,
          Alignment.MID, g, "---",
          Alignment.MID,
          c, (int)BONUS_MAX_1 });
    if (largest == WeaponAPI.WeaponSize.LARGE) {
      c = h;
    } else {
      c = g;
    }
    tooltip.addRow(new Object[] {
          Alignment.MID, c, "Large",
          Alignment.MID, c, "+" + (int)BONUS_SMALL_3,
          Alignment.MID, c, "+" + (int)BONUS_MEDIUM_3,
          Alignment.MID,
          c, (int)BONUS_MAX_3 });
    tooltip.addTable("", 0, opad);
    tooltip.addSectionHeading("Hybrid weapon range", Alignment.MID, opad + 7.0F);
    tooltip.addPara("Affects hybrid weapons (those that can fit into both ballistic and energy slots) of all sizes.",
        opad);
    col1W = 120.0F;
    colW = (int)((width - col1W - lastW - 15.0F) / 3.0F);
    tooltip.beginTable(Misc.getBasePlayerColor(), Misc.getDarkPlayerColor(), Misc.getBrightPlayerColor(),
        20.0F, true, true,
        new Object[] { "Largest b. slot", Float.valueOf(col1W), "Small", Float.valueOf(colW), "Medium", Float.valueOf(colW), "Large", Float.valueOf(colW), "Range cap", Float.valueOf(lastW) });
    c = null;
    if (largest == WeaponAPI.WeaponSize.SMALL) {
      c = h;
    } else if (largest == WeaponAPI.WeaponSize.MEDIUM) {
      c = h;
    } else {
      c = g;
    }
    tooltip.addRow(new Object[] {
          Alignment.MID, c, "Small / Medium",
          Alignment.MID, c, "+" + (int)(BONUS_SMALL_1 * HYBRID_MULT),
          Alignment.MID, c, "+" + (int)HYBRID_BONUS_MIN,
          Alignment.MID,
          c, "+" + (int)HYBRID_BONUS_MIN,
          Alignment.MID, c, (int)BONUS_MAX_1 });
    if (largest == WeaponAPI.WeaponSize.LARGE) {
      c = h;
    } else {
      c = g;
    }
    tooltip.addRow(new Object[] {
          Alignment.MID, c, "Large",
          Alignment.MID, c, "+" + (int)(BONUS_SMALL_3 * HYBRID_MULT),
          Alignment.MID, c, "+" + (int)(BONUS_MEDIUM_3 * HYBRID_MULT),
          Alignment.MID,
          c, "+" + (int)HYBRID_BONUS_MIN,
          Alignment.MID, c, (int)BONUS_MAX_3 });
    tooltip.addTable("", 0, opad);
    tooltip.addSectionHeading("Interactions with other modifiers", Alignment.MID, opad + 7.0F);
    tooltip.addPara("Since the base range is increased, this modifier - unlike most other flat modifiers - is increased by percentage modifiers from other hullmods and skills.",
       
        opad);
  }
 
  public float getTooltipWidth() {
    return 412.0F;
  }
 
  public boolean isApplicableToShip(ShipAPI ship) {
    WeaponAPI.WeaponSize largest = getLargestBallisticSlot(ship);
    if (ship != null && largest == null)
      return false;
    return (getUnapplicableReason(ship) == null);
  }
 
  public String getUnapplicableReason(ShipAPI ship) {
    WeaponAPI.WeaponSize largest = getLargestBallisticSlot(ship);
    if (ship != null && largest == null)
      return "Ship has no ballistic weapon slots";
    if (ship != null &&
      ship.getHullSize() != ShipAPI.HullSize.CAPITAL_SHIP &&
      ship.getHullSize() != ShipAPI.HullSize.DESTROYER &&
      ship.getHullSize() != ShipAPI.HullSize.CRUISER &&
      ship.getHullSize() != ShipAPI.HullSize.FRIGATE)
      return "Can only be installed on destroyer-class hulls and larger";
    return null;
  }
}

[close]

Also I want to make a hullmod that regenerates ammo. Maybe 25% per 3 minutes or a set amount. No idea how to do this. Anyone able to help me?

4
Mods / Re: [0.95.1a] QoL Pack 1.1.0
« on: May 31, 2023, 03:50:14 AM »
Not sure if this is still getting updated,  but I have one request. Would be possible if the autosalvage ability did not function if there was an enemy fleet close by, as in I would temporarily turn off until the enemy fleet was out of range then go back on?
Basically what happens when the autosalavage is on and an enemy fleet is  close, it will go to the salvage screen, but it won't let you salvage due to the enemy. You leave the screen and the autosalavage takes you right back into the screen, and it will keep doing this until the enemy is far enough away which could take a long time.

5
Tried the command to spawn the Remnant Nexus and it seems to be broken...at least for 0.95.1a. It does spawn the nexus and a few small sub ordo fleets, which is problematic because you have to spam disengage to get away from it safely.
...

I found them spawning on top of you (player) problematic as well.
I changed the code a little, I changed three parts:

Spoiler
OverlordAdditionalCommands\data\console\commands\SpawnRemnandNexus.java

      if (args.length() > -10) //myone changed to -10 it spawns
      {
         LinkedHashMap<LocationType, Float> weights = new LinkedHashMap<LocationType, Float>();
         weights.put(LocationType.PLANET_ORBIT, 10f);
         weights.put(LocationType.STAR_ORBIT, 10f);
         weights.put(LocationType.GAS_GIANT_ORBIT, 5f);
         WeightedRandomPicker<EntityLocation> locs = BaseThemeGenerator.getLocations(random, system, null, 20f, weights); //myone was 200f

         if (locs.isEmpty()) {
            loc = BaseThemeGenerator.pickAnyLocation(random, system, 20f, null); //myone was 200f
         }
[close]

It will spawn a little way off in the system, you just need to find it.
There is also a "Command Console"  code for doing the same thing:

https://fractalsoftworks.com/forum/index.php?topic=4106.msg388963;topicseen#msg388963

6
Modding / Mod Request S-Mod to OP
« on: May 19, 2023, 12:09:44 AM »
Hello.
I am looking for some kind soul to make a mod for me. I would make the mod myself but I can only mod easy stuff and I have no idea how to make this one.
I want to replace S-Mods with ordinance points. So any skill that gives S-Mod will now give ordinance points based on the ship size.
Actually does anyone know a gui based java editor I could have a look at (for modding the .api files in this game) The only ones I found did not allow for editing (just viewing).
Anyway, help appreciated!

7
Mods / Re: [0.95.1a] Console Commands v2021.12.25
« on: April 21, 2023, 12:54:11 PM »
I was hoping someone could help me with a console command to either : add a market to stations, or perhaps trigger a pirate/pather base construction event at the designated star-system...
Turned out to be a two-liner (tested on Telepylus Station), although I haven't checked if this makes it colonizable with TASC. Also the dialog description may be a bit weird afterwards.
Run when docked with the station:
Code: java
runcode SectorEntityToken entity = Global.getSector().getCampaignUI().getCurrentInteractionDialog().getInteractionTarget();
Misc.setAbandonedStationMarket(entity.getId(), entity);
Quote
Unrelated to all this, I was wondering if somebody knew how to spawn/create a remnant nexus at the player's fleet location...

Quick and dirty port, generates an undamaged Remnant station that starts spawning fleets after about a day.
Spoiler
Code: java
runcode import com.fs.starfarer.api.impl.campaign.fleets.FleetFactoryV3;
import com.fs.starfarer.api.impl.campaign.procgen.themes.BaseThemeGenerator;
import com.fs.starfarer.api.impl.campaign.procgen.themes.RemnantOfficerGeneratorPlugin;
import com.fs.starfarer.api.impl.campaign.procgen.themes.RemnantThemeGenerator;
import com.fs.starfarer.api.util.DelayedActionScript;
import com.fs.starfarer.api.impl.campaign.procgen.themes.RemnantStationFleetManager;

String type = "remnant_station2_Standard";
Random random = new Random();
final CampaignFleetAPI fleet = FleetFactoryV3.createEmptyFleet(Factions.REMNANTS, FleetTypes.BATTLESTATION, null);

FleetMemberAPI member = Global.getFactory().createFleetMember(FleetMemberType.SHIP, type);
fleet.getFleetData().addFleetMember(member);

fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_MAKE_AGGRESSIVE, true);
fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_NO_JUMP, true);
fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_MAKE_ALLOW_DISENGAGE, true);
fleet.addTag(Tags.NEUTRINO_HIGH);

fleet.setStationMode(true);

RemnantThemeGenerator.addRemnantStationInteractionConfig(fleet);

fleet.clearAbilities();
fleet.addAbility(Abilities.TRANSPONDER);
fleet.getAbility(Abilities.TRANSPONDER).activate();
fleet.getDetectedRangeMod().modifyFlat("gen", 1000f);

fleet.setAI(null);

/*RemnantThemeGenerator.setEntityLocation(fleet, loc, null);
RemnantThemeGenerator.convertOrbitWithSpin(fleet, 5f);*/
final LocationAPI loc = Global.getSector().getCurrentLocation();
loc.addEntity(fleet);
CampaignFleetAPI player = Global.getSector().getPlayerFleet();
fleet.setLocation(player.getLocation().x, player.getLocation().y);

boolean damaged = type.toLowerCase().contains("damaged");
String coreId = Commodities.ALPHA_CORE;
if (damaged) {
fleet.getMemoryWithoutUpdate().set("$damagedStation", true);
fleet.setName(fleet.getName() + " (Damaged)");
}

AICoreOfficerPlugin plugin = Misc.getAICoreOfficerPlugin(coreId);
PersonAPI commander = plugin.createPerson(coreId, fleet.getFaction().getId(), random);

fleet.setCommander(commander);
fleet.getFlagship().setCaptain(commander);

if (!damaged) {
RemnantOfficerGeneratorPlugin.integrateAndAdaptCoreForAIFleet(fleet.getFlagship());
RemnantOfficerGeneratorPlugin.addCommanderSkills(commander, fleet, null, 3, random);
}

member.getRepairTracker().setCR(member.getRepairTracker().getMaxCR());

loc.addScript(new DelayedActionScript(1) {
@Override
public void doAction() {
int maxFleets = 10; /* close enough */
RemnantStationFleetManager activeFleets = new RemnantStationFleetManager(
fleet, 1f, 0, maxFleets, 15f, 8, 24);
loc.addScript(activeFleets);
}
});
[close]

THANK YOU KINDLY! This is something I was looking for for a long time!

8
Mods / Re: [0.95a] Gacha S-Mods v1.5.0
« on: June 10, 2022, 01:08:35 PM »
Works fine, just was too lazy to update the version number. Make sure the Unique design/Special type is present at the bottom of the hullmod screen.
Aye it does indeed, I was going to delete my message, but I will keep it up since it got answered. Cheers for the quick response btw.

9
Mods / Re: [0.95a] Gacha S-Mods v1.5.0
« on: June 10, 2022, 11:43:23 AM »
Does this mod work for the latest version? The hullmods are not showing in my game. It could be a mod clash? I don't know, but the mods hullmods are not appearing.

10
Mods / Re: [0.95.1a] Console Commands v2021.12.25
« on: June 09, 2022, 11:04:32 AM »
to assign a planet to a faction afaik you need the nexerelin mod then you can setmarketowner to a faction. same as before: list factions...

I know this, but I wanted to make an unpopulated planet populated and then give to a faction and you cant do that in the method you suggest. I already tried this.
I have nexerilin mod.
Here is what I did.
I spawned the planet.
I went to the planet.
The planet options window opened up "survey, mine etc".
I opened the console.
setpopulation 4
setmarketsize 4
addsubmarket open_market
Now would be the "setmarketowner [market name here] [faction name here]" phase.
But you cannot, because it has no "market". A "market" in the game logic is a planet already colonised with a faction. The "open_market" is not considered a market for the "setmarketowner" command.
I was hoping for a way to bypass the colonisation phase because I didn't want to start my own faction at that time. Now I have made one it doesn't matter anymore.
I still want to know if it is possible (and how) for future reference.

Edit
Thanks for trying to help though.

11
Modding / Re: [0.9.1a] My additional commands for the console mod
« on: June 08, 2022, 01:09:32 PM »
Quote
144292 [Thread-4] ERROR org.lazywizard.console.Console  - Failed to load command AddAdmin (class: data.console.commands.AddAdmin) from C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\OverlordAdditionalCommands/data/console/commands.csv
java.lang.ClassNotFoundException: Ambiguous static method import: "public static boolean org.lazywizard.console.CommandUtils.isInteger(java.lang.String)" vs. "public static boolean org.lazywizard.console.CommandUtils.isInteger(java.lang.String)"

Just started getting this error on a new start and no idea why... I deleted and downloaded both modules and still getting it again. And I've used your commands in a previous game.
I get the same error.

12
Mods / Re: [0.95.1a] Console Commands v2021.12.25
« on: June 08, 2022, 12:05:14 PM »
@Kothyxaan

dock with planet you want to spawn the submarket in and the type addsubmarket

list see what options there are list submarkets
I tried this, but it only works on a planet with a market. I even changed it population level etc.
I spawned a planet and added the submarkets etc, but no go. I think I need a command to make it belong to a faction. Whixch is what im trying to do.
Cheers though.

13
Mods / Re: [0.95.1a] Console Commands v2021.12.25
« on: June 08, 2022, 09:11:02 AM »
Hello, I'm looking for a way to add a market to a planet that I will spawn in. Does anyone know a code to do this. As in I spawn a planet (I can do this bit) then add a faction market onto the planet. I know how to add industries and conditions.
Help appreciated!

14
General Discussion / Re: Devmode Commands?
« on: June 08, 2022, 08:57:05 AM »
No it doesn't IIRC, but this mod (https://fractalsoftworks.com/forum/index.php?topic=18461.0) does. Just make sure you get the required mods (console commands and lazylib)

And next time you might want to just start a new thread instead of necroing a 4 year old post

I'm glad he did and I'm glad you replied, I never knew this existed and always wanted to spawn a remnant station. So cheers!

15
Modding / Re: [0.95a-rc14] My additional commands for the console mod
« on: June 08, 2022, 08:54:46 AM »
Thank you kinda sir! I was looking for a way to spawn a remnant nexus. Cheers!

Ack much sadness. It does not work.

Pages: [1] 2