Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - SpaceMonster

Pages: [1]
1
Modding / Re: [0.9.1.a RC8] Can't seem to override "maxIndustries".
« on: September 27, 2019, 04:45:49 PM »
Nah, this just sets the baseline. PO3 adds a bonus separately. To change that bonus, you have to find this file:
Code
data\characters\skills\planetary_operations.skill
Then, copy it into your mod keeping the structure & filename intact. This is the file the game uses to find the right class to use for the handling the bonus.

In that .skill file you will find:
Code
        {
            "name":"Level 3",
            "requiredSkillLevel":3,
            "effectBasedOnLevel":false,
            "effects":[
                {"type":"GOVERNED_OUTPOST", "script":"com.fs.starfarer.api.impl.campaign.skills.PlanetaryOperations$Level3A"},
            ]
        },

What you want to do is change `com.fs.starfarer.api.impl.campaign.skills.PlanetaryOperations$Level3A` to target your own code (class) instead. This means you have to create a .java file that either implements or extends Level3A (or use the copied code as a starting point), save it somewhere with the right package name, and change the script target to your `new.package.ClassName`.

You can find the existing implementation of that still in `starfarer.api.zip` under `com\fs\starfarer\api\impl\campaign\skills\PlanetaryOperations.java`.

In short, copy that file to the same dir as the .skill file, change the package to `package data.characters.skills;`, then edit it as you see fit.
Keep in mind this will only change `Level3A` since that's what the script points to. You'd have to change the other script targets in the .skill file if you want the other levels to be altered too.

If you leave the `Level3A` as a inner class, your new target will be something like `data.characters.skills.PlanetaryOperations$Level3A` (Assuming you put it in {mod}\data\characters\skills). You only need to include inner & outer class names (separated by '$') if you leave the file as is.
If you move Level3A to an outer class, it would just be `data.characters.skills.Level3A` (Or whatever you've named the class.)

Note: Make sure the file name matches the top-level class.

Odds are you'll hit a syntax error or something along the way but those get printed straight to starsector.log so it's easy to check.

PS: You can actually setup a java IDE project and set `starfarer.api.zip` as a dependency to help you make edit the file. If you do, symlink your 'data' folder into the projects 'src' folder. (So it looks like {project root}\src\data\...) This should let you edit the files whilst keeping them where they need to be for the mod.
That will help you with everything you've forgotten about java.

PPS: If you do go the IDE route, make sure the project is set for java 1.7 as that is the IDE that's bundled with the game. (JAVA_VERSION="1.7.0")

2
Modding / Re: [0.9.1.a RC8] Can't seem to override "maxIndustries".
« on: September 24, 2019, 07:32:34 AM »
Thanks SpaceMonster, I will try to test it.
If I can make good use of it in a mod, I'll publish it by adding you in the credits, if you agree.
Thanks.  :D

Do whatever you wish with it. It's basically 2~3 lines of code. The rest is just boilerplate.

For licensings sake, I release this in public domain.

3
Modding / Re: [0.9.1.a RC8] Can't seem to override "maxIndustries".
« on: September 22, 2019, 11:36:40 AM »
Hi SpaceMonster,
Would it be possible for you to post a file that can be easily integrated into a mod?

Attached. I copied out just this part so, in theory it'll work; untested though.
I also renames the files to try to make it clearer. Possible syntax errors as a result.

[attachment deleted by admin]

4
How do I get bounties to spawn with large menacing fleets? I tried setting "maxShipsInAIFleet" to 100 but this seems to only result in a few more kites/shuttles/fluff.
My goal is to have a 50+ ship bounty fleet with, like, 5+ onslaughts or something. A big fleet vs big fleet challenge.

5
Is it possible to increase the number of ships shown in the fleet bubble? I mean visually only.
I like to run with large fleet vs large fleet but the numbers in the bubble seem so small when there's 40-50+ ships in the fleet.

6
Modding / Re: [0.9.1.a RC8] Can't seem to override "maxIndustries".
« on: May 28, 2019, 12:57:29 PM »
I found a bug! Yay!

To elaborate, I can queue up more than 13 but I don't know how far they make it. I know I can see a thirteenth structure in 'Command' -> 'Colonies' -> planet tooltip, "Industries & Structures" section. But I'm not waiting 90+ for each to know if they get built.

Where is best to make a feature request thread for this? I don't expect it to be in the base game, but if modding could get an override-able value somewhere (settings.json) that would be boss.
I imagine it's not a simple change, but I can dream.

7
Modding / Re: [0.9.1.a RC8] Can't seem to override "maxIndustries".
« on: May 28, 2019, 11:49:22 AM »
My only final issue is the colony UI won't show any modules past 12. I can build a thirteenth (planetary shield) but I can't access it, cancel it, etc.
Note that I have to have less than 12, then I can tell it to build two more modules leading to a planned total of 13. Once 12 are completed I can't build anything due to "Maximum number of industries reached" despite the planet being 7/8 industries. (And a shield isn't an industry. Err, well, I think it isn't.)
I'll wait but I expect the thirteenth I queued up will get built in time.

Is there some way to expand the UI? I'm not sure where in the code this is.

8
Modding / Re: [0.9.1.a RC8] Can't seem to override "maxIndustries".
« on: May 28, 2019, 10:37:12 AM »
Thanks. I got it working from that.
Here's my quick working copy if anyone else needs a base to work with.

Code
public class GMod extends BaseModPlugin {
    @Override
    public void onApplicationLoad() throws Exception {
        JSONArray maxIndustries = Global.getSettings().getJSONArray("maxIndustries");

        // Sets sizes 6-10 to 4-8 respectively.
        for (int i = 5; i < 10; i++) {
            maxIndustries.put(i, i - 1);
        }
    }
}

9
Modding / [0.9.1.a RC8] Can't seem to override "maxIndustries".
« on: May 27, 2019, 08:06:13 PM »
In my settings file I have this:
"maxIndustries": [1,1,1,2,3,4,5,6,7,8]

But the end result is still '4' on my size 10 colonies in-game. I know the settings file is valid json & it succeeds in changing the values of other things.
If I make the same change in starsector-core/data/config/settings.json the change works in-game.

Bug from merging json appending the values instead of replacing them? Or am I doing something wrong?

10
Announcements / Re: Starsector 0.9a (Released) Patch Notes
« on: November 19, 2018, 01:43:32 PM »
Bug report

Expected: When you click on a column you can change the sort to that column. Click on the same column again to toggle between Asc/Desc.

The bug: Clicking on a different column that the current sorted one *also* toggles Asc/Desc for the clicked column.
e.g. On the blueprint production screen, keep clicking between 'ship hull' & 'size'. This changes the sort column but also keeps reversing the sort direction.

So far I can repro this on custom production, colony / planet list, etc.

11
Announcements / Re: Starsector 0.9a (Released) Patch Notes
« on: November 18, 2018, 09:20:52 PM »
If you swap two officers on the fleet screen, the tooltip (of the officer) on either of them shows the data of the other. (Swap them, but the tooltip stays the same as if they were not swapped.)
Refreshing the Fleet screen (pressing 'F') is enough to fix this.

12
Announcements / Re: Starsector 0.9a (Released) Patch Notes
« on: November 18, 2018, 08:17:31 PM »
It seems to be really hard to find certain pather bases connected to your colonies. I've scoured about a fourth of the entire sector trying to figure out who's supplying the cells on my main colony but no luck. Is there any trick to it that I'm missing?

This and the occasional pirate base targeting me from some unknown system a thousand light years away.

All the other colony threats have some "spend money to negate it" mechanic, and this could really do with something like "spend money to have scouts locate the base".
Or something like that. I have a colony with 1bn peeps. Can't I hire some of them to do some searching? Then I don't have to spend months trying to find these things.

(I dug through campaign.xml to find one pather base. Turns out it was 7 squares (not sure what the SI is) away.)

13
Announcements / Re: Starsector 0.9a (Released) Patch Notes
« on: November 17, 2018, 01:51:07 PM »
I noticed a black hole that was marked as "Unsurveyed". If I clicked on it action '1' was survey, but it was greyed out. Methinks those shouldn't even be surveyable in the first place.

The custom production tab should show storage amounts of the items (well, storage of the gathering point).
Too many times I've taken a look at it an wondered how many X I have and what I need more of. I have to go to the planet, check storage, and try to remember what's needed as I go back and forth between screens.

On that point, I'd love a way to remotely view the storage contents of a colony.

PS: Thanks for keeping me up till 4am yesterday.  :P

Pages: [1]