Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 597 598 [599] 600 601 ... 709

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

Amazigh

  • Captain
  • ****
  • Posts: 288
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8970 on: July 25, 2022, 07:45:52 PM »

Is there any way to have a fighter with a limited ammo weapon that will return to the carrier to reload, without it being classed as a bomber.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8971 on: July 26, 2022, 02:07:41 PM »

was just poking around the api and saw stuff in CollisionGridAPI - what would you consider a "large area" for the purposes of using getCheckIterator() instead of just iterating over every ship or w/e?

also, is there a way to override the ECM rating status? I've had an idea for messing w/ it to make a system cooler so it's not entirely necessary if it's hard / annoying, but I'd like to know if it's possible.

and another quick edit - what's the warpingSpriteRendererUtil class used for / how should it be used? from the name it sounds like it could be cool for vfx, but I unfortunately can't make heads or tails of actually doing anything with it.
« Last Edit: July 26, 2022, 03:15:42 PM by Ruddygreat »
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 #8972 on: July 26, 2022, 04:13:28 PM »

Dear Alex,

Would you please add an explicit method to return the weapon_data.csv move speed of a ProjectileSpecAPI?

I ask because I wanted to know the weapon_data.csv move speed of a ProjectileSpecAPI but have struggled to do so.  A stacktrace of an error from my ProjectileWeaponSpecProxy referred to what I discovered to be the obfuscated class behind ProjectileSpecAPI; reviewing the obfuscated code of the method there, I guessed that an obfuscated variable was the weapon_data.csv move speed and that passing null to the first argument of ProjectileSpecAPI.getMoveSpeed(MutableShipStatsAPI stats, WeaponAPI weapon) would make it return the weapon_data.csv move speed.

I think an explicit method to return the weapon_data.csv move speed or mention of this feature in the ProjectileSpecAPI Javadoc would save future modders the effort I had to make.

Sincerely,
Liral

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8973 on: July 26, 2022, 05:48:11 PM »

I think an explicit method to return the weapon_data.csv move speed or mention of this feature in the ProjectileSpecAPI Javadoc would save future modders the effort I had to make.
what would've been even more useful
is to have a proper method for getting contents of any .csv field, even if only string
right now there are a lot of values that cannot be accessed directly, and only produce some derivative, at best, when called, especially for weapons, especially when calling from weaponSpec, when no specific weaponAPI actually exists.
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8974 on: July 27, 2022, 08:50:32 AM »

I don't really know what is wrong with this code:

(It's supposed to delete an entity and replace it with a similar entity in the same location with a unique marketplace data)

Spoiler
        // Replacing Drakon with Ravaryea analogue
        LocationAPI hyper = Global.getSector().getHyperspace();
        String amazing = "mamamia"; // 11000, -7500(Naraka), -4400,-4500(Askonia) +- 200
        for (SectorEntityToken e : hyper.getAllEntities()) {
            if (e.getLocation().x > -4200 && e.getLocation().x < -4600 && e.getLocation().y > -4300 && e.getLocation().y < -4700) {
                amazing = e.getId();
            }
        }
        Global.getSector().getHyperspace().removeEntity(Global.getSector().getEntityById(amazing));
        system.removeEntity(Global.getSector().getEntityById("drakon"));
        PlanetAPI drakon = system.addPlanet("drakon_fortress", system.getStar(), "Drakon", "terran-eccentric", 280, 150, 12000, 1000); //formerly 450 and 650
        if (!isPAGSM) {
            drakon.setCustomDescriptionId("planet_drakon_fortress");
        } else {
            drakon.setCustomDescriptionId("planet_drakon_fortress_PAGSM");
        }
        MarketAPI drakon_fortress_market = addMarketplace(
                "sindrian_diktat",
                drakon,
                null,
                "Drakon",
                5,

                new ArrayList<>(
                        Arrays.asList(
                                Conditions.POPULATION_5,
                                Conditions.HABITABLE,
                                Conditions.VERY_COLD,
                                Conditions.DARK,
                                Conditions.FARMLAND_ADEQUATE,
                                Conditions.ORGANICS_PLENTIFUL,
                                Conditions.VOLATILES_DIFFUSE,
                                Conditions.OUTPOST
                        )
                ),

                new ArrayList<>(
                        Arrays.asList(
                                Submarkets.SUBMARKET_OPEN,
                                Submarkets.SUBMARKET_STORAGE,
                                Submarkets.SUBMARKET_BLACK
                        )
                ),
                new ArrayList<>(
                        Arrays.asList(
                                Industries.POPULATION,
                                Industries.SPACEPORT,
                                Industries.PATROLHQ,
                                Industries.MINING,
                                Industries.FARMING,
                                "commerce",
                                Industries.ORBITALSTATION,
                                Industries.GROUNDDEFENSES
                        )
                ),
                //tariffs
                0.18f,
                //freeport
                false,
                //junk and chatter
                true);
        drakon.setMarket(drakon_fortress_market);
        drakon.getMarket().getIndustry(Industries.POPULATION).setSpecialItem(new SpecialItemData(Items.ORBITAL_FUSION_LAMP, null));
        Misc.setAllPlanetsKnown(system);
[close]

The market seems to spawn deformed; it fails to spawn conditions properly(no effect on hazard, or fail to show up on market screen) and has no admins or people on its comms boards. Does anyone know what's up?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24103
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8975 on: July 27, 2022, 09:02:50 AM »

Let me just add a few methods to SettingsAPI:
   JSONArray getMergedSpreadsheetData(String idColumn, String path)
   JSONObject getMergedJSON(String path)


The market seems to spawn deformed; it fails to spawn conditions properly(no effect on hazard, or fail to show up on market screen) and has no admins or people on its comms boards. Does anyone know what's up?

At a guess, the conditions are not marked as being surveyed, and so are not visible? I didn't dig into the code very much, though. But basically you'd want to iterate over the market's conditions and for each one do setSurveyed(true).
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 #8976 on: July 27, 2022, 09:09:49 AM »

Let me just add a few methods to SettingsAPI:
   JSONArray getMergedSpreadsheetData(String idColumn, String path)
   JSONObject getMergedJSON(String path)

Ayyyyy, let's gooooo! :D

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8977 on: July 27, 2022, 09:26:00 AM »

Hmm, interesting! The bad case here seems like it'd be the error popping up, putting some mission chain in a "permanently broken" state because something critical to it failed, and then the mission becomes incompletable a few play sessions later. And *then* the player reports a bug with that mission being in a broken state - without mentioning that, oh yeah, there was this error like a week ago. I don't know - I get the appeal, but I feel like this also destroys something very foundational about being able to look at a bug report and know certain things about what led to it. If you can no longer assume that X is true because it would've crashed earlier otherwise, that's real, real bad.

(I suppose one could store these errors in the savefile, but, that really gets to be a rabbit hole...)
Hm, could be useful if, on crash, the game threw you back to the main menu with a dialogue box like that. Best of both worlds for the player?

Alternatively, throwing up a console window with the stack trace and some info for the player to copy when the game crashes might be a good (and easier to implement?) thing.

For my own purposes, info I'd like to know in that crash short report would be:
- Game version
- Installed Mod IDs + version
- Stack trace

While keeping log output in the .log files as it is now.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4681
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8978 on: July 27, 2022, 05:56:37 PM »

The market seems to spawn deformed; it fails to spawn conditions properly(no effect on hazard, or fail to show up on market screen) and has no admins or people on its comms boards. Does anyone know what's up?
If the market replacement happens after economy load, you'll need to survey the conditions (as per Alex's post above) and add comm directory people yourself.
Logged

Somtaaw

  • Ensign
  • *
  • Posts: 11
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8979 on: July 27, 2022, 06:30:09 PM »

So I guess I have too many mods for the game to be comfortable with as its starting to say its running out of the RAM allocated to it but I can edit vmparams(?) file to change that.

I think it defaults to 2GB? at least as far as I can tell from my task manager. What's a safe amount that the game can handle? 8? or should I try 4 first?

Actually I just opened it in Notepad++ and its just a long string and no obvious way to tell the game to allocate more RAM. Thoughts?
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8980 on: July 27, 2022, 09:47:23 PM »

There's nothing wrong with storing permanent variables in $market for rules.csv right? I noticed that the rest of the $market.yadda always have an expiration... in dev mode.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24103
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8981 on: July 28, 2022, 11:19:02 AM »

There's nothing wrong with storing permanent variables in $market for rules.csv right? I noticed that the rest of the $market.yadda always have an expiration... in dev mode.

The variables created by CoreCampaignPluginImpl.updateXXXXXFacts() always have an expiration set because they're recomputed prior to every interaction and they don't need to be stored in memory long term. But yeah, if you're actually using a variable to keep track of something over time, then you can store one there without an expiration. IIRC this happens at times for vanilla missions etc.
Logged

Wispborne

  • Captain
  • ****
  • Posts: 407
  • Discord: wispborne
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8982 on: July 31, 2022, 09:53:12 PM »

Is there a way to arbitrarily set the min/max campaign zoom at runtime?

I've gotten as far as `game.settings.setFloat("maxCampaignZoom", zoomMult)` but it doesn't stick and it doesn't look like I have access to any code needed to make it stick, but maybe I'm wrong?

My goal is to be able to allow the player to zoom out to see most of a system for some set period, then change the limit back to their normal one.
Logged
Mod: Persean Chronicles | Mod Manager: SMOL | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24103
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8983 on: August 01, 2022, 08:10:55 AM »

Yeah, that's not going to work - those values are just used to initialize the zoom tracker. Let me add some stuff to CampaignUIAPI:

float getMinZoomFactor();
float getMaxZoomFactor();
void setMinZoomFactor(float min);
void setMaxZoomFactor(float max);

My goal is to be able to allow the player to zoom out to see most of a system for some set period, then change the limit back to their normal one.

Just as a heads up, that seems likely to cause an FPS dive in some star systems, especially if there is a lot of nebula. (Also, stuff isn't designed to look good at that level, but, I mean, that's kind of whatever.)
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 #8984 on: August 01, 2022, 08:28:42 AM »

Yeah, that's not going to work - those values are just used to initialize the zoom tracker. Let me add some stuff to CampaignUIAPI:

float getMinZoomFactor();
float getMaxZoomFactor();
void setMinZoomFactor(float min);
void setMaxZoomFactor(float max);

Ooh, while we're talking zoom, I would love for my mod to zoom out further in the Command UI but can't find any handle for it in the API.  Have I gotten lost, or is it really not there?
Pages: 1 ... 597 598 [599] 600 601 ... 709