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 ... 418 419 [420] 421 422 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6285 on: April 12, 2020, 11:26:27 AM »

Hello Alex, I am putting in a hullmod that should not be installed on any ship's modules so I used this method. It seems that modded ships like the Cathedral (from SWP) aren't affected by this and I'm able to attach it on the Cathedral's modules. Are there any plans to make a vanilla ship with modules, so a way to block hullmods on modules can be implemented?

Hmm - assuming it's in this release, you could I think use ship.getFleetMember() to figure out if the current ship's hull corresponds to the main body of the ship or to one of its modules.


1: Is it possible to make a Hullmod that add extra logistic slots to the ship it's installed in?

Yes:

ship.getMutableStats().getDynamic().getMod(Stats.MAX_LOGISTICS_HULLMODS_MOD).modifyFlat(...)

2: Is it possible to make a Hullmod cost credits to install, possibly unrecoverable (Ie you pay to put it in, but don't get it back if you uninstall it)

Not easily or cleanly, I don't think. It might be possible to do something where you can only install the hullmod at a station after you've paid to make it temporarily available or something, but you'd have to get creative with it (as opposed to it just cleanly working in the refit screen).

How do you make the game start battles with the view zoomed out all the way? I see no reason to ever zoom in, and having to zoom out at the start of every single battle is getting a bit tiresome.

Hmm - you could set minCombatZoom in settings.json to be the same as maxCombatZoom - it might still start at the default zoom, but would in this case - iirc? - zoom out to full after one touch of the zoom control.
Logged

Sordid

  • Captain
  • ****
  • Posts: 313
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6286 on: April 12, 2020, 02:22:58 PM »

How do you make the game start battles with the view zoomed out all the way? I see no reason to ever zoom in, and having to zoom out at the start of every single battle is getting a bit tiresome.

Hmm - you could set minCombatZoom in settings.json to be the same as maxCombatZoom - it might still start at the default zoom, but would in this case - iirc? - zoom out to full after one touch of the zoom control.

Ah, awesome! That even starts fully zoomed out. Thanks a bunch!

Also, and this might be more of a bug report, buuuut.... a pather base that was supplying cells in my colonies decivilized and became an abandoned station, but somehow it's still supplying them? So I can't get rid of them because I can't do anything with the station other than store stuff in it. Wat do? Can I, like, edit the save file to get rid of that? I can look up the names of places in the save file, but I can't make heads or tails of what to edit in there.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6287 on: April 12, 2020, 02:34:09 PM »

Hello Alex, I am putting in a hullmod that should not be installed on any ship's modules so I used this method. It seems that modded ships like the Cathedral (from SWP) aren't affected by this and I'm able to attach it on the Cathedral's modules. Are there any plans to make a vanilla ship with modules, so a way to block hullmods on modules can be implemented?

Hmm - assuming it's in this release, you could I think use ship.getFleetMember() to figure out if the current ship's hull corresponds to the main body of the ship or to one of its modules.
Ok that's great to hear!

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6288 on: April 13, 2020, 02:31:38 AM »

Hello, after some theorising about a possible TC with some folks that hinges around the idea of a custom hyperspace map with fog of war. This isn't possible to implement in the vanilla map, so my question is, is it currently possible to override the hyperspace map GUI element? Furthermore, how is the hyperspace map rendered in game? How is it layered, what elements can be removed, can elements be added?

If not, some API hooks to apply effects / or somehow replace the hyperspace map would be greatly appreciated.

Thanks  :)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6289 on: April 13, 2020, 10:59:47 AM »

Ah, awesome! That even starts fully zoomed out. Thanks a bunch!

Yep!

Also, and this might be more of a bug report, buuuut.... a pather base that was supplying cells in my colonies decivilized and became an abandoned station, but somehow it's still supplying them? So I can't get rid of them because I can't do anything with the station other than store stuff in it. Wat do? Can I, like, edit the save file to get rid of that? I can look up the names of places in the save file, but I can't make heads or tails of what to edit in there.

Ah, it is a bug report - thank you, and fixed. I'd already done this for pirate bases (that is, making sure they can't decivilize), but missed Pather cells. The good news is Pather cells are currently bugged so that if your stability is 2 or higher, incidents will never happen, so you're basically free to ignore them - no need to remove them from the save file. Which I think could get kind of tricky anyway.


Hello, after some theorising about a possible TC with some folks that hinges around the idea of a custom hyperspace map with fog of war. This isn't possible to implement in the vanilla map, so my question is, is it currently possible to override the hyperspace map GUI element? Furthermore, how is the hyperspace map rendered in game? How is it layered, what elements can be removed, can elements be added?

If not, some API hooks to apply effects / or somehow replace the hyperspace map would be greatly appreciated.

Thanks  :)

See: HyperspaceTerrainPlugin.renderOnMap(), and renderOnMapAbove() it its superclass. Although, you're not asking just about the hyperspace terrain, are you? You couldn't hide stars, I don't think. Terrain, you could - but that's just the HyperspaceTerrainPlugin. It's hard to say because I don't understand exactly what the goal of having fog of war here would be - what would be hidden and why?
Logged

Sordid

  • Captain
  • ****
  • Posts: 313
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6290 on: April 13, 2020, 11:31:08 AM »

Ah, it is a bug report - thank you, and fixed. I'd already done this for pirate bases (that is, making sure they can't decivilize), but missed Pather cells. The good news is Pather cells are currently bugged so that if your stability is 2 or higher, incidents will never happen, so you're basically free to ignore them - no need to remove them from the save file. Which I think could get kind of tricky anyway.

Your bugfix response time is very impressive, you must be very proud. ;)

I tried the console commands mod, and that let me remove the pather cells condition from my markets, but the intel screen colony threat notifications still remain. I'm basically done with this playthrough, though, so I'm just not going to worry about them.

If I may make a suggestion - it would be a lot more awesome if, instead of pather and pirate bases never decivilizing, decivilizing them destroyed them. That's why I raided that pather base a bunch of times in the first place, because I didn't have a fleet strong enough to take it on directly, so I figured I'd decivilize it and get rid of it that way. It would be neat to have that easier but not quite as quick option, you know?

In any case, thanks for the fix. Looking forward to the next version!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6291 on: April 13, 2020, 12:13:32 PM »

Your bugfix response time is very impressive, you must be very proud. ;)

It was an easy one :)

If I may make a suggestion - it would be a lot more awesome if, instead of pather and pirate bases never decivilizing, decivilizing them destroyed them. That's why I raided that pather base a bunch of times in the first place, because I didn't have a fleet strong enough to take it on directly, so I figured I'd decivilize it and get rid of it that way. It would be neat to have that easier but not quite as quick option, you know?

Hmm - makes sense, but being able to raid repeatedly like that to cause something to decivilize is not exactly intended in the first place, and would be much more difficult in the next release, with the new raid mechanics. Still, I'll keep it in mind!
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6292 on: April 13, 2020, 05:08:26 PM »

Ah, awesome! That even starts fully zoomed out. Thanks a bunch!

Yep!

Also, and this might be more of a bug report, buuuut.... a pather base that was supplying cells in my colonies decivilized and became an abandoned station, but somehow it's still supplying them? So I can't get rid of them because I can't do anything with the station other than store stuff in it. Wat do? Can I, like, edit the save file to get rid of that? I can look up the names of places in the save file, but I can't make heads or tails of what to edit in there.

Ah, it is a bug report - thank you, and fixed. I'd already done this for pirate bases (that is, making sure they can't decivilize), but missed Pather cells. The good news is Pather cells are currently bugged so that if your stability is 2 or higher, incidents will never happen, so you're basically free to ignore them - no need to remove them from the save file. Which I think could get kind of tricky anyway.


Hello, after some theorising about a possible TC with some folks that hinges around the idea of a custom hyperspace map with fog of war. This isn't possible to implement in the vanilla map, so my question is, is it currently possible to override the hyperspace map GUI element? Furthermore, how is the hyperspace map rendered in game? How is it layered, what elements can be removed, can elements be added?

If not, some API hooks to apply effects / or somehow replace the hyperspace map would be greatly appreciated.

Thanks  :)

See: HyperspaceTerrainPlugin.renderOnMap(), and renderOnMapAbove() it its superclass. Although, you're not asking just about the hyperspace terrain, are you? You couldn't hide stars, I don't think. Terrain, you could - but that's just the HyperspaceTerrainPlugin. It's hard to say because I don't understand exactly what the goal of having fog of war here would be - what would be hidden and why?

The goal would be to hide everything, and have abstract regions on the map highlighted, with sections charted as the player travels outwards. At first this would be blind, but quests etc. could potentially give coordinates of specific locations in the murk. This would mean being able to clear absolutely everything from the map and have custom objects rendered over it, but it doesn't sound like that's possible at the moment.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6293 on: April 13, 2020, 05:21:27 PM »

Ah - your best/only bet might be to temporarily remove the star anchor jump-points from hyperspace. Either that, or temporarily giving it a sensor profile - i.e. something like:

jumpPoint.setSensorProfile(<some number>);
jumpPoint.setDiscoverable(true);

That *might* also work as far as concealing stars.
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6294 on: April 13, 2020, 06:37:17 PM »

Ah - your best/only bet might be to temporarily remove the star anchor jump-points from hyperspace. Either that, or temporarily giving it a sensor profile - i.e. something like:

jumpPoint.setSensorProfile(<some number>);
jumpPoint.setDiscoverable(true);

That *might* also work as far as concealing stars.

That's really funky, but if it works is also genius. I'll do some fiddling and see if that works out. Thanks
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6295 on: April 13, 2020, 06:59:21 PM »

Good luck :)
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 #6296 on: April 13, 2020, 10:58:58 PM »

Hello, after some theorising about a possible TC with some folks that hinges around the idea of a custom hyperspace map with fog of war.

Not sure how much you intend to override, but this list may help save you some time considering you're wanting to do a TC. It's easier in my experience to just delete what you don't need rather than type everything out. This post includes most if not all vanilla files. I can't remember how much I added to this before I started working on reducing the need for the replace array in general.

Replace Array Possible Entries For Windows
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6297 on: April 14, 2020, 03:44:06 AM »

Hello, after some theorising about a possible TC with some folks that hinges around the idea of a custom hyperspace map with fog of war.

Not sure how much you intend to override, but this list may help save you some time considering you're wanting to do a TC. It's easier in my experience to just delete what you don't need rather than type everything out. This post includes most if not all vanilla files. I can't remember how much I added to this before I started working on reducing the need for the replace array in general.

Replace Array Possible Entries For Windows

Thanks for the post, I'm sure it'll be useful when I start diving in  :D
Logged

lethargie

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6298 on: April 15, 2020, 11:56:24 AM »

I tried some personal edit in a mod by starting from someone else. I got an error message. It seems to tell me the field id is missing from a file, however how can I know which file?

I cant seem to be able to paste my log here, it always crash my post

I also have a very very weird and seemingly useless question betraying my ignorance.

Each mod_info of a mod point to a single mod plugin. Could a single mod define multiple plugin? Could a single mod have multiple mod info?
« Last Edit: April 15, 2020, 12:35:44 PM by lethargie »
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 #6299 on: April 15, 2020, 07:35:51 PM »

What does MarketAPI.reapplyIndustries() do? Is it necessary when changing industries through a script or, maybe, does it read and reapply what is contained in the economy json files?

-----------------------------------------
I had someone ask about portrait overrides or otherwise adding or removing portraits, so thought this might be helpful to anyone needing info on this (Edited for a general audience):

The faction file determines what portrait png files from the graphics folder will be applied to created npcs within that faction. So, afaik all portraits are added to the campaign this way in vanilla. Its not a script but part of the JSON file that is read by the game. You should be able to add portraits to each faction's pool using scripts, though. As an example of code that modifies portraits:

Spoiler
/**
 *   By Morrokain
 *
 *  Parameters: Accepts "ALL" or a faction ID which it will use to obtain that faction's portraits.
 */
public class SetPlayerPortraits extends BaseCommandPlugin {

    @Override
    public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Misc.Token> params, Map<String, MemoryAPI> memoryMap) {
       
        String faction = params.get(0).getString(memoryMap);

        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();
            String nextFaction;

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

                if (!nextFaction.equalsIgnoreCase("remnant") && !nextFaction.equalsIgnoreCase("pirates")
                        && !nextFaction.equalsIgnoreCase("sleeper") && !nextFaction.equalsIgnoreCase("scavengers")
                        && !nextFaction.equalsIgnoreCase("poor") && !nextFaction.equalsIgnoreCase("derelict")
                        && !nextFaction.equalsIgnoreCase("luddic_path") && !nextFaction.equalsIgnoreCase("player")
                        && !nextFaction.equalsIgnoreCase("neutral")) {

                    factionMalePortraitIDs.addAll(Global.getSector().getFaction(nextFaction).getPortraits(FullName.Gender.MALE));
                    factionFemalePortraitIDs.addAll(Global.getSector().getFaction(nextFaction).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);
        return true;
    }

}
[close]

If you are wanting to replace portraits (either overriding the vanilla portraits in a mod you are making or removing the mod portraits from being used in a mod due to subjective portrait tastes/themes, for instance) you don't have to mess with the replace array in mod_info for the portrait files but instead replace the faction files (to completely change everything- additions don't require this and can just add the portrait references in a mod faction json of the same name). For example:

Code
  	     "data\\world\\factions\\player.faction",
-In the replace array- Would override the player faction file in windows. Then change the portrait references in that faction file to reference your own portraits png names:

Code
			"graphics/portraits/portrait_hegemony01.png",
-is an example of how this is referenced in the faction file. Scroll down towards the bottom to see it.


To remove portraits, comment out the portrait line for the portrait files you don't want by adding a #

Code
			#"graphics/portraits/portrait_hegemony01.png",
Logged
Pages: 1 ... 418 419 [420] 421 422 ... 706