Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 413 414 [415] 416 417 ... 467

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

SirHartley

  • Captain
  • ****
  • Posts: 294
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6210 on: March 21, 2020, 06:38:06 AM »

I don't believe so, but it depends on the specifics of what you're doing. For example if the drugs are being produced by a specific industry, then having it return true from isSupplyLegal() *should* make them legal on that market as far as getting income from exports.

(You could also set the market to free port, though that of course has other implications...)

I'm trying to make the general import and export of drugs (only drugs, not organs) legal for a specific market, via a condition that can be applied by the player through a menu.
This should affect all industries, not just mine - which it currently doesn't as I'd like to avoid that if possible :)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6211 on: March 21, 2020, 10:16:05 AM »

Is there a way to change when enemy retreats? I fly with big fleet and when I meet small enemy, I deploy matching force of my ships, so that I dont overpower them but keep it fair. Of course enemy retreats because calculations take into account my whole fleet. Same thing when I join a friend in a fight, I deploy only one ship, but enemies turn tails. And so, how do I make AI braver? Its ok if only in battle - fleeing on campaign screen is permitted :) 

IIRC the AI doesn't consider enemy reserves when deciding whether to retreat from the battlefield.

I'm not sure if it's in the current release or not, but: CombatTaskManagerAPI.setPreventFullRetreat(false) would do the job.

Otherwise, there's BattleCreationContext.aiRetreatAllowed, but getting to that would be more complicated.

Second thing - I suspect Alex actually enjoys helping modders, seeing how often he replies here, what a guy!

(Ha! Let's just say I'm glad to help.)

I'm trying to make the general import and export of drugs (only drugs, not organs) legal for a specific market, via a condition that can be applied by the player through a menu.
This should affect all industries, not just mine - which it currently doesn't as I'd like to avoid that if possible :)

Ah, gotcha. Nothing comes to mind, unfortunately.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 2846
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6212 on: March 21, 2020, 08:16:28 PM »

Is there a way to make commodities be treated as crew/marines for cargo purposes (use crew capacity, can't be dumped with other cargo)?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6213 on: March 21, 2020, 08:36:47 PM »

No on both counts, I'm afraid - crew/marines are hardcoded as the only ones in a few different places. Sorry!
Logged

Histidine

  • Admiral
  • *****
  • Posts: 2846
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6214 on: March 22, 2020, 03:46:03 AM »

Ah, ouch. Could it be changed to read the personnel tag in commodities.csv?

Two new questions:
  • 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?
  • A user reported a graphical glitch in my mod's use of FleetMemberPickerDialog; see the white square in
    https://www.youtube.com/watch?v=VWmW5NmbaHU
    At a guess, what might cause such a thing?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6215 on: March 22, 2020, 09:20:01 AM »

Ah, ouch. Could it be changed to read the personnel tag in commodities.csv?

Probably not, honestly, not unless there's a vanilla use case. It'd be too much of a pain to do and make sure that it works (and that it continues to work) otherwise. There are many loose ends where I'm not *quite* sure whether they would "just work" or would need to be changed, and it's a lot of stuff to look through.

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.


A user reported a graphical glitch in my mod's use of FleetMemberPickerDialog; see the white square in
...
At a guess, what might cause such a thing?

Probably the icon rendering not being tested with icons that large - it does some stuff clearing out the destination alpha buffer and this likely means that the quads it's doing this with start overlapping for neighboring icons past a certain size and cause a bit of a mess. I *think* I may have tweaked this in the dev version? Not 100% sure.
Logged

Karamitsuko

  • Ensign
  • *
  • Posts: 11
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6216 on: March 24, 2020, 10:49:10 AM »

Is there any way to add restricted hullmods (such as the missile autoforge) to ships that aren't meant to have them by the use of console commands? Or, would I have to actually add them to the ship files themselves in order to do it? I've already tried manually adding the blueprint for certain restricted modspecs into my inventory and learning them that way, but they still won't allow me to actually put them on a ship
Logged

SirHartley

  • Captain
  • ****
  • Posts: 294
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6217 on: March 24, 2020, 12:05:09 PM »

I am facing a rather problematic situation - I got a class that just won't load:

Code
java.lang.RuntimeException: Problem loading class [com.fs.starfarer.api.impl.campaign.econ.conditions.deconomics_edict_conscription]
at com.fs.starfarer.loading.scripts.ScriptStore.Ó00000(Unknown Source)
at com.fs.starfarer.loading.newsuper.getNewPluginInstance(Unknown Source)
at com.fs.starfarer.campaign.econ.MarketCondition.readResolve(Unknown Source)
at com.fs.starfarer.campaign.econ.MarketCondition.<init>(Unknown Source)
at com.fs.starfarer.campaign.econ.Market.addCondition(Unknown Source)
at com.fs.starfarer.campaign.econ.Market.addCondition(Unknown Source)

All entries seem fine and the other 7 conditions I made load without issue.
This happens regardless of what the content of the class is.

Do you have any pointers for me?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6218 on: March 24, 2020, 12:22:36 PM »

Is there any way to add restricted hullmods (such as the missile autoforge) to ships that aren't meant to have them by the use of console commands? Or, would I have to actually add them to the ship files themselves in order to do it? I've already tried manually adding the blueprint for certain restricted modspecs into my inventory and learning them that way, but they still won't allow me to actually put them on a ship

You'd have to either edit the variant file or set the hullmod to not be hidden (via hull_mods.csv), but the latter might have some unintended consequences such as other ships starting to use it. Not 100% sure.

Do you have any pointers for me?

Post more of the error - there should be another stack trace, I believe? - and the contents of the class :)

My guess would be the maybe it doesn't have a default constructor?
Logged

SirHartley

  • Captain
  • ****
  • Posts: 294
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6219 on: March 24, 2020, 02:25:54 PM »

Oh my god there is a second stack trace
problem solved - thank you so much
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1595
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6220 on: March 26, 2020, 02:56:32 PM »

Are there hardcoded/seeded (by hull id specifically) derelicts in vanilla, and if so, what class in the API handles that and can it be easily modified?

If that part is obfuscated from the API, can I by chance alternatively get a list of the hull ids that can be seeded?

(I've removed all the vanilla references to hull ids in favor of a unique TC prefix for each of my ids (to prevent any mod merging from causing crashes or other weirdness) and replaced each hull instance that is necessary with an overriding csv line which removes its tags for blueprints/faction use and adds hints to remove them from the codex and prevent them from spawning in markets.)

Trying to cover all my bases for the full TC experience before working on additional tweaks to the "lite version"
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6221 on: March 26, 2020, 04:18:34 PM »

Other than MiscellaneousThemeGenerator spawning XIV Legions, hmm. There's a derelict shuttle on the station near Asharu (see: Corvus.java), and I *think* that might be it. Nothing else comes to mind, at least.

Oh! The game will also spawn a nebula_Standard whenever it can't find a ship that it's trying to spawn.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1595
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6222 on: March 26, 2020, 06:19:04 PM »

Other than MiscellaneousThemeGenerator spawning XIV Legions, hmm. There's a derelict shuttle on the station near Asharu (see: Corvus.java), and I *think* that might be it. Nothing else comes to mind, at least.

Oh! The game will also spawn a nebula_Standard whenever it can't find a ship that it's trying to spawn.

Thanks! The only thing that may be a problem there for me is the legion. The shuttle is unchanged in the TC (I'm like 90% sure anyway) and the nebula which will change with the next release shouldn't ideally come up if I'm doing things correctly.

I'll take a look at the theme generator class and see about different solutions. I feel that not changing the id may inevitably interfere with other mods, so I will likely have to do something.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 2846
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6223 on: March 27, 2020, 05:04:32 AM »

How do I get the list of freelance administrators the player has hired?
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 1835
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6224 on: March 27, 2020, 05:18:31 AM »

CharacterDataAPI has getAdmins()
Logged
Pages: 1 ... 413 414 [415] 416 417 ... 467