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: Simulator Enhancements (03/13/24)

Pages: 1 ... 531 532 [533] 534 535 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1699672 times)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7980 on: September 24, 2021, 07:16:36 PM »

(Oh, durr, I didn't see Histidine's reply! Half asleep over here, sorry.)
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7981 on: September 25, 2021, 08:06:59 PM »

I’m also interested in where to find it in the api, since I’ve been looking for it and can’t find it.
com.fs.starfarer.api.campaign.econ.MarketAPI

Have you been looking in starfarer_api.zip? If you have an IDE and add it to source, you can jump to any API class/method by Ctrl-clicking it in the IDE (at least that's the shortcut in NetBeans, dunno if other IDEs do it differently). Also you can search for stuff in the extracted folder with Notepad++ or similar.

Quote
Now I also have a different question: After digging through the system code of some mods, it seems they either follow the vanilla style of not adding industries/conditions to their planets in said system code(mostly ORA), while other mods use ArrayLists to state clearly industries/conditions(XLU/VIC/SCY etc). I don’t really get why there are these two coding types here, is it a compatibility issue that got jury rigged to workability or just a stylistic/convenience decision that doesn’t affect much?
Think it's just a 'pick whatever you prefer' thing, although the code approach is needed if you're adding markets after game start. Also I think the config JSONs didn't exist in earlier versions of the game?

Thanks, though I believe I have found success in coding the industries and conditions through arraylists. Another question(sorry for all the questions lo, im pretty new to modding) though, how do I override the default(vanilla) Askonia file to use my own? Currently it seems that the game is using the default Askonia file instead of the one in my mod so changes are not applying.

Edit: After temporarily removing the vanilla Askonia file and adding the new one in, the markets still don’t spawn. I’m guessing something is wrong somewhere in the code itself too.

(The code, for reference)
https://imgur.com/MxfE3Pp
« Last Edit: September 25, 2021, 09:35:02 PM by JAL28 »
Logged

shoi

  • Admiral
  • *****
  • Posts: 649
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7982 on: September 26, 2021, 07:34:15 PM »

Is it possible to disable and hide/enable and show weapon mounts with a hullmod by playing with the variant or something?
Kind of like the damaged weapon mounts thing, but without a skin file?
Logged

Dazs

  • Admiral
  • *****
  • Posts: 1028
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7983 on: September 27, 2021, 04:43:10 AM »

I was wondering if there was a way to show the mining strength of each weapon and ship as you hover over them as an additional stat. I know that Nex has a list that pops up when you click on a planet and ask it to list them so those stats are out there. However that list does not seem to include some weapons and drones from other mods.

It is a feature I've wanted for awhile but never asked until I came across theDragn's WhicMod and realized it was possible to show additional text on each ship and weapon regardless of what mod it comes from. TY

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7984 on: September 27, 2021, 12:18:53 PM »

Working with Contacts now... (shaking... developing something with milk)

If I don't want a particular contact mission to show up in the bar at all BUT not restrict it to a person_id. How would I do this? Because the person that hands out these type of contact missions can differ in procgen of my contact printer that prints out contact cards for the player to call.

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7985 on: September 27, 2021, 05:37:54 PM »

It is a feature I've wanted for awhile but never asked until I came across theDragn's WhicMod and realized it was possible to show additional text on each ship and weapon regardless of what mod it comes from. TY

WhichMod uses a hack - it edits every mod's description files. Useful, mostly harmless, but a hack nonetheless.


Working with Contacts now... (shaking... developing something with milk)

If I don't want a particular contact mission to show up in the bar at all BUT not restrict it to a person_id. How would I do this? Because the person that hands out these type of contact missions can differ in procgen of my contact printer that prints out contact cards for the player to call.

PersonAPIs have memory that you can put a memory key in - then you just look for contacts that have that memory key.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7986 on: September 27, 2021, 07:08:47 PM »

PersonAPIs have memory that you can put a memory key in - then you just look for contacts that have that memory key.

You misunderstood. I'm making a custom contact mission right now and it's spawning in bar events even though I don't want it to. >.>

Oh maybe it's something when I copied too much. Let's see... silly me. I copied it into BAR_EVENTS.csv
« Last Edit: September 27, 2021, 07:11:14 PM by Techpriest »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7987 on: September 27, 2021, 07:25:00 PM »

Oh, lol, didn't see it was you, Techpriest, sorry :P don't mind me stating basic modding stuff at you.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7988 on: September 27, 2021, 08:24:09 PM »

I wanted to make a mod that the Player Faction does not select the portrait the player has currently by thinking there would be a removePortrait similar to removeKnown[stuff].

I'm saddened to see that the FactionAPI does not contain a removePortrait nor a getPortrait that returns a set (instead of a weightrandompicker). I'd like for the player to be able to choose their set of portraits on a new game start, but then remove those portraits for their player faction portraits.

May I ask for a request for this in the next version?

Dazs

  • Admiral
  • *****
  • Posts: 1028
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7989 on: September 28, 2021, 12:41:46 AM »

It is a feature I've wanted for awhile but never asked until I came across theDragn's WhicMod and realized it was possible to show additional text on each ship and weapon regardless of what mod it comes from. TY

WhichMod uses a hack - it edits every mod's description files. Useful, mostly harmless, but a hack nonetheless.

Thank you for pointing that out SafariJohn. The more I look into it I do not think it would work anyway since there seems to be two different ways mining is handled and it is separate from the weapon and ship files.

I've been digging around various mods to see how they interact with Nexerelin’s mining mini game. I noted that some have two files in the data folder "\data\config\exerelin". The first seems to be for mining weapons (mining_weapons.csv) and the second for mining ships (mining_ships.csv).

On top of the mining_ships.csv and mining_weapons.csv files I have also learned that mining values can also be set in modSettings.json (found in \data\config) under the lines "mining_ship_strengths" and "mining_weapon_strengths". This is how Nexerelin does it in its own folders for vanilla stuff and how some mods like Scy do it.

Essentially it looks like Nexerelin originally used those csv files because I had noticed that in Nexerelin those files just say "#deprecated; use modSettings.json instead,," but 4 of the mods I checked (haven’t checked them all) still used the mining_ships.csv and mining_weapons.csv files.

This is becoming a deeper rabbit hole than I had expected lol.

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7990 on: September 28, 2021, 03:21:49 AM »

Is there a way to add "gas giant" condition to a planet(or in this case, station)? Specifically, the one that allows Plasma Dynamo to work properly. I tried "GAS_GIANT" and it doesn't exist.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7991 on: September 28, 2021, 10:56:11 AM »

Edit: After temporarily removing the vanilla Askonia file and adding the new one in, the markets still don’t spawn. I’m guessing something is wrong somewhere in the code itself too.

If it wasn't mentioned already, make sure that the folder path for your Askonia.java file is correct - same as in vanilla. Other than that, maybe try some minor changes to make sure that it works? Also, maybe goes without saying, but you need to start a new game for changes in that kind of file to apply.

Is it possible to disable and hide/enable and show weapon mounts with a hullmod by playing with the variant or something?
Kind of like the damaged weapon mounts thing, but without a skin file?

I don't think so, not without a .skin file.

I wanted to make a mod that the Player Faction does not select the portrait the player has currently by thinking there would be a removePortrait similar to removeKnown[stuff].

I'm saddened to see that the FactionAPI does not contain a removePortrait nor a getPortrait that returns a set (instead of a weightrandompicker). I'd like for the player to be able to choose their set of portraits on a new game start, but then remove those portraits for their player faction portraits.

May I ask for a request for this in the next version?

(Not the right thread for modding feature requests!) That said, the player's portrait should already be extremely unlikely to be picked for a player-faction NPC. It's still possible but it'd have to get picked like 5 times in a row.

Is there a way to add "gas giant" condition to a planet(or in this case, station)? Specifically, the one that allows Plasma Dynamo to work properly. I tried "GAS_GIANT" and it doesn't exist.

The market conditions are defined in data/campaign/market_conditions.csv
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7992 on: September 28, 2021, 01:16:26 PM »

I wanted to make a mod that the Player Faction does not select the portrait the player has currently by thinking there would be a removePortrait similar to removeKnown[stuff].

From AO as an example. Afaik this works though I'm not 100% sure I actually tested it thoroughly.

Code
    // Used by the mod plugin to remove faction portraits from the player faction after the player portrait is selected.
    public void removePortraits(String faction) {
        if (faction == null) {
            return;
        }

        WeightedRandomPicker<String> factionMalePortraitIDs = new WeightedRandomPicker<>();
        WeightedRandomPicker<String> factionFemalePortraitIDs = new WeightedRandomPicker<>();

        factionMalePortraitIDs.addAll(Global.getSector().getFaction(faction).getPortraits(FullName.Gender.MALE));
        factionFemalePortraitIDs.addAll(Global.getSector().getFaction(faction).getPortraits(FullName.Gender.FEMALE));

        List<String> maleIDs = factionMalePortraitIDs.getItems();
        Iterator<String> maleIDsIterator = maleIDs.iterator();
        while (maleIDsIterator.hasNext()) {
            Global.getSector().getPlayerFaction().getPortraits(FullName.Gender.MALE).remove(maleIDsIterator.next());
        }

        List<String> femaleIDs = factionFemalePortraitIDs.getItems();
        Iterator<String> femaleIDsIterator = femaleIDs.iterator();
        while (femaleIDsIterator.hasNext()) {
            Global.getSector().getPlayerFaction().getPortraits(FullName.Gender.FEMALE).remove(femaleIDsIterator.next());
        }
    }

And I've tested this and I know it worked at the time:

Code

    // Used by the rule command and also available for use in other classes. (See: CheckCommissionForPortraitLocks.java)
    // Passing in "all" as the faction id sets all available portraits depending upon faction rep with some factions.
    public void setPortraits(String faction) {
        if (faction == null) {
            return;
        }

        WeightedRandomPicker<String> factionMalePortraitIDs = new WeightedRandomPicker<>();
        WeightedRandomPicker<String> factionFemalePortraitIDs = new WeightedRandomPicker<>();

        if (!faction.equalsIgnoreCase("all")) {
            factionMalePortraitIDs = Global.getSector().getFaction(faction).getPortraits(FullName.Gender.MALE);
            factionFemalePortraitIDs = Global.getSector().getFaction(faction).getPortraits(FullName.Gender.FEMALE);
        } else {
            List<FactionAPI> allFactions = Global.getSector().getAllFactions();
            Iterator<FactionAPI> iterator = allFactions.iterator();
            FactionAPI playerFaction = Global.getSector().getPlayerFaction();
            String nextFaction;

            while (iterator.hasNext()) {
                nextFaction = iterator.next().getId();

                if (checkForBlacklistedFactions(nextFaction)) {
                    factionMalePortraitIDs.addAll(Global.getSector().getFaction(nextFaction).getPortraits(FullName.Gender.MALE));
                    factionFemalePortraitIDs.addAll(Global.getSector().getFaction(nextFaction).getPortraits(FullName.Gender.FEMALE));
                }
            }
            if (playerFaction.isAtWorst(ArcheusFactions.ADAMANTINE, RepLevel.FAVORABLE)) {
                factionMalePortraitIDs.addAll(Global.getSector().getFaction("adamantine_consortium").getPortraits(FullName.Gender.MALE));
                factionFemalePortraitIDs.addAll(Global.getSector().getFaction("adamantine_consortium").getPortraits(FullName.Gender.FEMALE));
            }
            if (playerFaction.isAtWorst(ArcheusFactions.ARCHEUS, RepLevel.FRIENDLY) || Misc.getCommissionFactionId().equalsIgnoreCase("archean_order")) {
                factionMalePortraitIDs.addAll(Global.getSector().getFaction("archean_order").getPortraits(FullName.Gender.MALE));
                factionFemalePortraitIDs.addAll(Global.getSector().getFaction("archean_order").getPortraits(FullName.Gender.FEMALE));
            }
        }

        Global.getSector().getPlayerFaction().getPortraits(FullName.Gender.MALE).clear();
        Global.getSector().getPlayerFaction().getPortraits(FullName.Gender.FEMALE).clear();
        Global.getSector().getPlayerFaction().getPortraits(FullName.Gender.MALE).addAll(factionMalePortraitIDs);
        Global.getSector().getPlayerFaction().getPortraits(FullName.Gender.FEMALE).addAll(factionFemalePortraitIDs);
    }
Logged

Kolokol

  • Ensign
  • *
  • Posts: 13
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7993 on: September 28, 2021, 02:59:43 PM »

Hello!

I was wondering, maybe someone has done or has attempted to do a mod, that lets you visually change the paint job on a ship?
Like change the sprite of your Paragon to Ludic colours or Hegemony. Add in stripe/fractal/tribal effects to mix it a bit.
Logged

geminitiger

  • Commander
  • ***
  • Posts: 119
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7994 on: September 28, 2021, 11:54:15 PM »

How would I change the required 20,000 metal requirement for a Hypershunt?
Logged
Pages: 1 ... 531 532 [533] 534 535 ... 706