Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 602 603 [604] 605 606 ... 710

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

Liral

  • Admiral
  • *****
  • Posts: 718
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9046 on: August 26, 2022, 03:35:34 AM »

and that the forum had a dark mode.
It does. It's under one of the preference settings in... Profile, I think?

Ahhhhh... thank you.

Inari

  • Ensign
  • *
  • Posts: 9
  • Local foxgirl
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9047 on: August 28, 2022, 01:10:36 AM »

I ran into this weird bug where the dust rings and asteroid rings/belts in the Tia/Ta'xet system have gone missing. I have no idea what caused it and only noticed it today when I returned back to the system.

Looking at the save file, it is still there and has not been omitted:

Spoiler
<plugin cl="AsteroidBeltTerrainPlugin" z="1404" tid="asteroid_belt" n="Lagua's Torus" nTCA="false">
<entity cl="CampaignTerrain" ref="1396"></entity>
<params cl="AsteroidBeltParams" defined-in="BaseRingTerrain" z="1405" bWIE="170.0" mR="3600.0" n="Lagua's Torus" nA="150" minO="200.0" maxO="250.0" minS="4.0" maxS="16.0"></params>
<params ref="1405"></params>
[close]

Is there a way I can restore it by using the console commands mod or a particular line of code?

I tried some of the codes floating around on the forums but they created asteroid rings/belts on the planets themselves instead. Such an example of a code is shown here:

Spoiler
RunCode Global.getSector().getStarSystem("Tia").addAsteroidBelt((PlanetAPI)Global.getSector().getStarSystem("Tia").getPlanets().get(2), 50, 700f, 240f, 400f, 600f, Terrain.ASTEROID_BELT, "Izanagi's Halo");
Global.getSector().getStarSystem("Tia").addRingBand((PlanetAPI)Global.getSector().getStarSystem("Tia").getPlanets().get(2), "misc", "rings_asteroids0", 256, 3, Color.RED, 240f, 700f, 500f)
[close]
« Last Edit: August 28, 2022, 01:19:04 AM by Inari »
Logged
Hey hey people, Sseth here-

Audax

  • Commander
  • ***
  • Posts: 156
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9048 on: August 28, 2022, 06:29:44 AM »

Is it possible to change or lower peak performance time remaining during combat? like increasing it or decreasing it for reasons?

Shashakul

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9049 on: August 28, 2022, 06:55:36 AM »

How do I install only a part from a mod? For example I really like Amazigh's Ship Foundry mod weapons and fighter wings, but I don't want the ships. Is it possible to get just the weapons? How?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9050 on: August 28, 2022, 07:01:23 AM »

Hmmm, guess I'll have to override that rule id, thought returning/keeping the Hamatsu was somewhat significant to be remembered since there's a lingering $global.foundHamatsu permanently forever unexpired.

Yeah, that sounds like your best bet for the moment.

I ran into this weird bug where the dust rings and asteroid rings/belts in the Tia/Ta'xet system have gone missing. I have no idea what caused it and only noticed it today when I returned back to the system.

...

(Sorry, no clue! It *is* weird that they're in the savefile but not showing up, though, but it's just hard to say without really digging into the specifics of what's going on in your save.)

Is it possible to change or lower peak performance time remaining during combat? like increasing it or decreasing it for reasons?

I think you'd want to use ShipAPI.setTimeDeployed() for this.

How do I install only a part from a mod? For example I really like Amazigh's Ship Foundry mod weapons and fighter wings, but I don't want the ships. Is it possible to get just the weapons? How?

In theory, it should be possible depending on the details of how the weapons are implemented (in a "normal" case, it should be, if the weapons are doing something very fancy, it *might* not be) but basically it would involve making your own version of the mod, cutting out the stuff you don't want. At a basic level, it'd mean going through the files in the mod, understanding what's ship-related and what's needed for the weapons, and removing the former. In particular, you'd want to remove default_ship_roles.json (which specifies how/where the ships are to be used), and anything similar, not just the ships themselves.
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9051 on: August 28, 2022, 07:43:48 AM »

Is there a way to give a ship a hullmod that changes the damage types of the weapons on it? Also if there is a way to change the hullmod dynamically without making it a modular

(eg. a hullmod on a ship that changes weapon types on it from energy to HE; and can be switched to kinetic or frag, or back to energy)
Logged

Liral

  • Admiral
  • *****
  • Posts: 718
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9052 on: August 28, 2022, 06:22:27 PM »

I've read of a multiplayer mod that could has all networking, interpolation, etc. written and working and could launch already if only all random numbers vanilla generates during combat were from the same seed: replacing every in-combat vanilla call to a method of java.util.Random with a call to a corresponding static method of one, global, static random number generator instance with an exposed method public static void seed(int seed) would guarantee they were.  If you implemented this request, all modders would likely follow suit, and we could all play Starsector with and against each other!  :)

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9053 on: August 28, 2022, 07:04:51 PM »

If you implemented this request, all modders would likely follow suit,

Doubt. Best you could hope for is some modders making an effort and labeling their mods as compatible.
Logged

Liral

  • Admiral
  • *****
  • Posts: 718
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9054 on: August 28, 2022, 07:17:13 PM »

Doubt. Best you could hope for is some modders making an effort and labeling their mods as compatible.

I hope most mods don't use RNG in combat to begin with, and that if they do, the calls are few and far-between enough to be easily replaced by the modder and, if not, found and noted by users and the community.

Audax

  • Commander
  • ***
  • Posts: 156
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9055 on: August 28, 2022, 09:24:04 PM »

Ty for answering my question as for another one

anyway to manipulate ordance point cost dynamically through code?

Example: if I install this hullmod/weapon that cost 10 op add an additional 5 op due to reasons?

alaricdragon

  • Commander
  • ***
  • Posts: 162
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9056 on: August 29, 2022, 05:49:35 PM »

I have a few more questions caused by my latest bout of insanity.
first: is there an market condition that is always present on a market?
second: in the advance(float amount) function of an class that extends BaseMarketConditionPlugin, what is amount? and how many would form an week, month or year? or is there an better way of getting that from an market condition?
third: is it possible to edit/change an industries text or image with out making your own class for it, or is something like that not possible?
thank you for your help all. I truly appreciate it.
Logged

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9057 on: August 29, 2022, 11:24:42 PM »

is there a limit to amount of abilities that a player can have? my mod attempts to add abilities but certain players don't see it in their ability menu.

i use onGameLoad to add ability if player doesn't have it.
Code
        if (!Global.getSector().getPlayerFleet().hasAbility("viewprisoners")) {
            Global.getSector().getPlayerFleet().addAbility("viewprisoners");
        }

a player used runcode $print(Global.getSector().getPlayerFleet().hasAbility("viewprisoners"))  which printed false
a player has tried to use runcode  Global.getSector().getPlayerFleet().addAbility("viewprisoners"); but it still did not appear, and the command above returned false as well afterwards
the same person has tried to print the spec (  runcode $print(Global.getSettings().getAbilitySpec("viewprisoners"))  ) which printed out a non-null answer (com.fs.starfarer.loading.specs.super@2381ebfc)

so the spec exists, the onGameLoad should add it, we tried to add it on demand, but no matter what some players still don't get it.
the only notable thing is the player has 21 abilities available to select, which is obviously a lot more than vanilla. the same player removed all of their mods except mine, and the ability added fine without any other mods that add abilities.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9058 on: August 30, 2022, 03:40:25 AM »

2 questions, one potential bug report!

1 - when does an onExplosion effect get run (i.e, if a mine reaches the end of it's lifetime, if a mine hits an enemy, if removeEntity() is called on it)? I've got some mines doing fancy things & I'm not sure if their onExplosion effects will all get properly run.

2 - are advanceableListeners supposed to not get advanced while attached to the engine? I'm using one to manage some of the fancy mine effects (mostly because I've got an irrational dislike of interacting with customdata :p) & whenever I attach the listener to the engine it gets added but advance() is never called. In the meantime I've attached the listeners to the ships the weaps are on & it's working fine, but this still seems unintended.

itBeABruhMoment

  • Commander
  • ***
  • Posts: 158
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9059 on: August 30, 2022, 10:57:26 AM »

How do you get the markets of any space station colonies that may be in a StarSystemAPI? I'm trying to write a function that checks which factions have heavy industry and space stations do not appear under StarSystemAPI.getPlanets().

edit: solved, you can do something like this
Code
         for(FactionAPI faction : Global.getSector().getAllFactions()) {
            String factionId = faction.getId();
            for(MarketAPI market : Misc.getFactionMarkets(factionId)) {
                boolean hasHeavyIndustry = false;
                try {
                    hasHeavyIndustry = market.hasIndustry("heavyindustry") || market.hasIndustry("orbitalworks");
                } catch(Exception e) {
                    hasHeavyIndustry = false;
                }

                if(hasHeavyIndustry) {
                    HAS_HEAVY_INDUSTRY.add(factionId);
                }
            }
        }
with HAS_HEAVY_INDUSTRY being a hash set
« Last Edit: August 30, 2022, 12:34:58 PM by itBeABruhMoment »
Logged
Pages: 1 ... 602 603 [604] 605 606 ... 710