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)

Pages: [1] 2

Author Topic: [0.97a] Ship Browser 1.2  (Read 10714 times)

itBeABruhMoment

  • Commander
  • ***
  • Posts: 174
    • View Profile
[0.97a] Ship Browser 1.2
« on: March 08, 2023, 05:42:39 PM »

Ship Browser 1.2
Download



Do you have a chronic mod addiction that makes the list ships command produce several pages of console output? Well I do, so I took the logical step of spending several hours to automate a 5 minute task. This mod includes a ship browser that allows you to browse ships by mod and add them to your fleet via a gui. To use it simply open the console, enter the command "ShipBrowser" and close the console. This mod also contains some console commands for fleet building and entity searching.


The Commands:

Spoiler
ShipBrowser
Open the ship browser. Opens after the console is closed.

FindSystemsWithTags <manditory1stTag> [optionalAdditionalTags]

List the star systems with all of the tags specified in the arguments. A list of tags can be found in com.fs.starfarer.api.impl.campaign.ids.Tags of the StarSector API. Input the string that corresponds to the tag obtained by viewing Constant Field Values.

GetTagsCurrentSystem

Lists the tags of the system the player is in.

FindNumConstellations

Find the number of constellations in the sector with a totally not scuffed implementation.

FindEntitiesByName  <nameOfEntity>

List the location of every entity with a specified name. The name of a entity is usually the same as its in game description.

FindEntitiesByType  <nameOfEntity>

List the location of every entity with a specified custom entity type. Custom entity types can be found in custom_entities.json.

ListEntitiesCurrentLocation

List the full name and custom entity type of every entity in the player's current location.

FindDerelict <hullid>

List the location of every derelict ship with of a specified hull type. Use the command "list ships" to see the names of hull types

AddHullMods <shipSelection> <[hullModId1,hullModId2,hullModId3]>

Permanently adds the hull mods specified in the second argument to the ships specified in "shipSelection". "shipSelection" can be a number (eg. 5), a range (eg, 5-10) or the word all. The numbers in "ShipSelection"  corresponds to the order ships appears in the fleet or refit screen. For example the fifth ship in the refit screen is ship 5. Then second argument is a list of any number of hull mod ids separated by commas and enclosed by square brackets WITH NO SPACES. Hull mod ids can be found in hull_mods.csv

AddDMods <shipSelection> <numDmods>

Adds "numDmods" dmods to the ships specified by "shipSelection". "NumDmods" is a number. "shipSelection" can be a number (eg. 5), a range (eg, 5-10) or the word all. The numbers in "ShipSelection"  corresponds to the order ships appears in the fleet or refit screen. For example the fifth ship in the refit screen is ship 5.

CloneShip <shipNumber> [numberOfClones]

Clones a specified ship in the player fleet  "shipNumber" times. If no number of clones is specified one is made. "shipNumber" corresponds to the order ships appears in the fleet or refit screen. For example the fifth ship in the refit screen is ship 5. "numberOfClones" is the number of copies that will be made.

Note that some of the fleet editing commands don't work in the refit screen for some reason under some circumstances. No clue why
[close]

Changelog:

Spoiler
1.2
-updated to 0.97a

1.1
-updated to 0.96a
-fixed bug with cloneship command

1.0
- first release
[close]
« Last Edit: February 02, 2024, 12:57:38 PM by itBeABruhMoment »
Logged

Mizzy

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: Ship Browser 1.0
« Reply #1 on: March 08, 2023, 10:31:42 PM »

With this mod activated my game fails to finish loading, the process hangs and gets stuck waiting on a thread. Deactivating the mod allowed my game to load. I do not have a mod titled "Additional Search and Fleet Building Commands". Here is a pastebin containing my current active mods (sans Ship Browser) https://pastebin.com/8Nx2tkEx.
Hopefully this information helps you troubleshoot and iterate upon your mod.
Logged

Dadada

  • Admiral
  • *****
  • Posts: 601
    • View Profile
Re: Ship Browser 1.0
« Reply #2 on: March 09, 2023, 02:16:53 AM »

°_° Awesome!
>list ship sunder
>get 14 entries...
Doge bless the gui!
Logged

itBeABruhMoment

  • Commander
  • ***
  • Posts: 174
    • View Profile
Re: Ship Browser 1.0
« Reply #3 on: March 10, 2023, 08:48:21 AM »

With this mod activated my game fails to finish loading, the process hangs and gets stuck waiting on a thread. Deactivating the mod allowed my game to load. I do not have a mod titled "Additional Search and Fleet Building Commands". Here is a pastebin containing my current active mods (sans Ship Browser) https://pastebin.com/8Nx2tkEx.
Hopefully this information helps you troubleshoot and iterate upon your mod.
Can I get your logs up to the crash/hang. I can't really do anything with just a mod list. If this is actually a thread hanging issue I don't think there is much I can do though.
« Last Edit: March 10, 2023, 10:39:56 AM by itBeABruhMoment »
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 154
    • View Profile
Re: Ship Browser 1.0
« Reply #4 on: March 13, 2023, 07:29:23 PM »

Well done. A very nice UI.
Logged

itBeABruhMoment

  • Commander
  • ***
  • Posts: 174
    • View Profile
Re: Ship Browser 1.1
« Reply #5 on: May 06, 2023, 10:39:47 AM »

This mod is now updated to 0.96a. Happy testing
Logged

Cyan Leader

  • Admiral
  • *****
  • Posts: 719
    • View Profile
Re: Ship Browser 1.1
« Reply #6 on: June 05, 2023, 06:47:09 PM »

I like the AddHullMods commands to add hullmods similar to those that are built-in, but after some time (after a reload? not sure) the "permanent" hullmod becomes just a normal hullmod and pushes your ship over the regular OP limit.

Is there a way to fix this?
Logged

Jang

  • Lieutenant
  • **
  • Posts: 77
    • View Profile
Re: Ship Browser 1.1
« Reply #7 on: June 06, 2023, 03:11:31 PM »

Thank you for updating this, the cloneship command has saved me a lot of time testing fleet comps
Logged

CrownedC

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Ship Browser 1.1
« Reply #8 on: July 09, 2023, 03:02:22 AM »

Simply awesome ;)
Logged

Fireman6

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: Ship Browser 1.1
« Reply #9 on: November 04, 2023, 11:09:41 PM »

hello there, first time posting on this forum.

i found a mod breaking error when it comes to using the 'findderelict' command. some mods spawn ships that apparently have 'null' variants which can break that specific command, leading to a nullpointer error in the console when used. as of this moment, i found some non-save breaking incompatibilities with 'secrets of the frontier' and 'kadur remnant', as those two spawn ships that have connections to questlines when interacted with. i had some very helpful assistance from the people over at the unofficial discord to discover this problem, and one of them created a very useful command to find the offending entities:

RunCode
import java.util.List;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import org.lazywizard.console.BaseCommand;
import org.lazywizard.console.CommonStrings;
import org.lazywizard.console.Console;
import com.fs.starfarer.api.impl.campaign.DerelictShipEntityPlugin;

for(StarSystemAPI system : Global.getSector().getStarSystems())
{
    List<SectorEntityToken> entities = system.getAllEntities();
    for(SectorEntityToken entity : entities)
    {
        if(entity.getCustomEntityType() != null && entity.getCustomEntityType().equals("wreck"))
        {
            String varID = ((DerelictShipEntityPlugin)entity.getCustomPlugin()).getData().ship.variantId;
            if (varID == null) {
                Console.showMessage("null variant on wreck in " + system.getBaseName());
            }
        }
    }
}

LocationAPI hyperspace = Global.getSector().getHyperspace();
List<SectorEntityToken> entities = hyperspace.getAllEntities();
for(SectorEntityToken entity : entities)
{
    if(entity.getCustomEntityType() != null && entity.getCustomEntityType().equals("wreck"))
    {
        String varID = ((DerelictShipEntityPlugin)entity.getCustomPlugin()).getData().ship.variantId;
        if (varID == null) {
            Console.showMessage("null variant on wreck in hyperspace");
        }
    }
}

according to the creator of this command, it searches the game for the ships that causes the nullpointer error and prints out the system where they are located.

specifically to SotF, i had to finish the questline to getting sierra (the Promise questline) to successfully remove her ship that was causing the problem.

for the kadur remnant thing, i didnt really have to participate in the questlines the offending ships are connected to, so either salvaging or rescuing the ships fixes the problem.

basically, the 'findderelict' command breaks when any mod adds ships that either are questline-specific or have 'null' variants.

credits to AtlanticAccent and Histidine over at the unoffificial discord for helping me find fixes to the problem.
Logged

bilbois

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Ship Browser 1.1
« Reply #10 on: December 01, 2023, 11:22:59 PM »

addhullmods command cannot add modded hullmod?
no hullmod with the id "" found

edit: the command is case sensitive but do not read. only lower case hullmod id works
« Last Edit: December 02, 2023, 12:52:32 AM by bilbois »
Logged

itBeABruhMoment

  • Commander
  • ***
  • Posts: 174
    • View Profile
Re: Ship Browser 1.2
« Reply #11 on: February 02, 2024, 12:57:21 PM »

I updated this mod to 0.97a. Happy testing
Logged

Alesha170

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: Ship Browser 1.2
« Reply #12 on: February 02, 2024, 03:22:05 PM »

I updated this mod to 0.97a. Happy testing
In mod.json version is still 1.1.
And the mod is working fine on 0.96.
Btw, wouldn't it be better to give variants instead of hulls? Because some modders tend to mess up and forget to add autofit variants for their ships.
Logged

Renarrd

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: [0.97a] Ship Browser 1.2
« Reply #13 on: May 27, 2024, 02:21:12 PM »

Do you have any plans to add a command to add hullmods as S-mods?
Right now the mods get only added as normal mods.

Logged

itBeABruhMoment

  • Commander
  • ***
  • Posts: 174
    • View Profile
Re: [0.97a] Ship Browser 1.2
« Reply #14 on: June 02, 2024, 03:16:42 PM »

Do you have any plans to add a command to add hullmods as S-mods?
Right now the mods get only added as normal mods.
Not at the moment. However, if you're finding flicking through menus to give a bunch of ships the same smods tedious, you could give a ship the smods you want and use the "CloneShip" command.
Logged
Pages: [1] 2