Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 416 417 [418] 419 420 ... 710

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

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6255 on: April 03, 2020, 09:31:57 PM »

So I tried:
How do I get a fleet's immediate movement waypoint (e.g. "I want to go to another star system, so I am currently headed for jump point X")? Is NavigationModulePlugin.getClickToMoveLocation() what I should be using?

Hmm. So the ultimate course target is SectorAPI.getUIData().getCourseTarget(). The intermediate one... <digs in> doesn't look like it's exposed. Let me add these to CampaignUIAPI:
   SectorEntityToken getCurrentCourseTarget();
   SectorEntityToken getNextStepForCourse(SectorEntityToken courseTarget);
   void layInCourseForNextStep(SectorEntityToken courseTarget);
   String getNameForCourseTarget(SectorEntityToken entity, boolean isEndpoint);
   float getLastLegDistance(SectorEntityToken courseTarget);
   
In the meantime, I think playerFleet.getInteractionTarget() should do the job. NavigationModulePlugin is ... ahh, I totally misinterpreted the question, thought it was about the course widget. Aha. Actually, getInteractionTarget() should work there, too, but it may not always point to that, i.e. if the fleet gets distracted chasing an enemy. getClickToMoveLocation() is just going to be some point along the path, which gets adjusted depending on how fast the fleet wants to go etc (and is iirc capped out at 10,000 units away from the fleet), it's not always going to be the destination.
but fleet.getInteractionTarget() seems to always return null for an NPC fleet, even when the fleet is clearly going somewhere (within the same star system) on an assignment.
Should I be doing something different?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6256 on: April 04, 2020, 11:17:55 AM »

but fleet.getInteractionTarget() seems to always return null for an NPC fleet, even when the fleet is clearly going somewhere (within the same star system) on an assignment.
Should I be doing something different?

Ahh - just yesterday, I ran into an issue with the interaction target being set to null by the tactical module, overriding the jump point that was set as the target (this was causing AI fleets to jump out without the jump-point opening). I'm not sure if this is also an issue in the release, or if this was just a dev bug, but it sounds like it might be the former, then. Nothing comes to mind as a good workaround, unfortunately.
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 #6257 on: April 04, 2020, 12:42:53 PM »

@Alex

Thanks for the info!
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6258 on: April 05, 2020, 06:14:18 AM »

Yeah, that AI generally assumes that it's the smaller ship's job to get out of the way, and that it's capable of it. Smaller ships too far out of the expected movement speed range band cause problems.

I have seen Doom crashing into capital ships and other cruisers. It is clearly the Doom flying into them, not, as you say, them expecting it to get out of the way. I can't remember if I've seen other ships displaying the same behavior, but either way you should watch for this when you are playtesting.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6259 on: April 05, 2020, 06:31:25 AM »

Is it possible that negative income application on colonies is bugged?
I am trying to apply costs via
Code
getIncome().modifyFlat()
and it sometimes works - and sometimes does this:
Logged

Sordid

  • Captain
  • ****
  • Posts: 313
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6260 on: April 05, 2020, 06:36:00 AM »

How do you change the number of skill points the player gets at the beginning of a new game? I assume it's just one number somewhere in the files, but I can't find it.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6261 on: April 05, 2020, 06:47:38 AM »

How do you change the number of skill points the player gets at the beginning of a new game? I assume it's just one number somewhere in the files, but I can't find it.

Starting options are managed by rules.csv.
Find the starting option you would like to edit in that file and change the number behind NGCAddCharacterPoints in the column "script" to the number you want.
Logged

Sordid

  • Captain
  • ****
  • Posts: 313
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6262 on: April 05, 2020, 08:01:20 AM »

Starting options are managed by rules.csv.
Find the starting option you would like to edit in that file and change the number behind NGCAddCharacterPoints in the column "script" to the number you want.

Brilliant, thanks very much!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6263 on: April 05, 2020, 08:42:59 AM »

Is it possible that negative income application on colonies is bugged?
I am trying to apply costs via
Code
getIncome().modifyFlat()
and it sometimes works - and sometimes does this:


Hmm - if it sometimes work and sometimes doesn't, I'd guess at least the consistency issue is somewhere in your code. Also, you should absolutely not be using income for negative values here - that's what upkeep is for. I wouldn't be surprised if the code clamps income to at least 0 or some such, as a sanity check.
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6264 on: April 06, 2020, 07:10:42 AM »

I'm using engine.getFleetManager(ship.getOriginalOwner()).spawnShipOrWing(...) to spawn in my drones fighter-style, and am using engine.getFleetManager(ship.getOriginalOwner()).setSuppressDeploymentMessages(true); to prevent the deployment messages, but upon ending missions (untested in campaign), the spawned drones all appear:
Spoiler
[close]
How do I prevent this? Thanks!
« Last Edit: April 06, 2020, 07:15:09 AM by tomatopaste »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6265 on: April 06, 2020, 09:19:35 AM »

Someone with more experience doing this might know better, but my initial guess would be that 1) this is unavoidable in missions and 2) this would not happen in the campaign, since it double-checks fleet members against what was present in the original fleets and discards ones that are not found.
Logged

lethargie

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6266 on: April 06, 2020, 01:49:44 PM »

Whats the standard JSON format used? Im trying to read json files in the starsector-core folder and I keep getting invalid Json format errors. Im fairly noob when it comes to these things of course, but I did try to paste the files in JsonFormatter or JSonLint and they dont like them either.

the specific files are
starsector-core\data\campaign\pings.json
starsector-core\data\config\engine_styles.json
starsector-core\data\config\settings.json
they have some weird number value with letters for some field: 1f

starsector-core\data\config\custom_entities.json
has some STATIONS instead of a value. It refer to something else, but how is that parsed?

I'm asking because I'm trying to replicate the process of merging related mod files outside the game.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6267 on: April 06, 2020, 02:16:54 PM »

STATIONS is an enum; for json purposes it's a string, but the game will generally parse it into an enum after loading the file - but that's after the json parser is done. The json parser the game uses supports stuff like "1f", with f meaning "type float" but that's not any different than just having a "1" there. If you see a 1f etc in the game's json files, it's unintentional - just used to doing it inside java code for float constants etc.

The main incompatibility with a standard json parser would be added support for #-style comments.
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 #6268 on: April 06, 2020, 06:40:17 PM »

What does:

Code
			"specialItems":[
"pristine_nanoforge",
],

- do in the econ files?

--------------
*EDIT*

I *think* it needs to not be available "nearby" but I'm not 100% sure. You'd probably need to dig through ProcurementMissionIntel to figure it out for sure.

Didn't get a chance to dig into this yet, but weirdly enough after the most recent economy changes (moving around orbital stations adding additional markets, etc) all of a sudden procurement intel missions are sprouting up like weeds even at markets across the sector from where I am (Nvm its all nearby). At least I can test more easily now XD
« Last Edit: April 06, 2020, 07:04:41 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6269 on: April 06, 2020, 07:42:03 PM »

What does:

Code
			"specialItems":[
"pristine_nanoforge",
],

- do in the econ files?

... nothing, apparently - I think it's just something I forgot to clean up out of aztlan.json. This is from before deciding to specify the special items preinstalled on an industry via this sort of array: ["orbitalworks", "pristine_nanoforge"],
Logged
Pages: 1 ... 416 417 [418] 419 420 ... 710