Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 361 362 [363] 364 365 ... 710

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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5430 on: October 19, 2019, 08:34:39 PM »

Could you have your hullmod do:
stats.getDynamic().getMod(Stats.INDIVIDUAL_SHIP_RECOVERY_MOD).modifyFlat(id, 0f);
When it's not in the player's fleet?

I tried this. Unfortunately, it doesn't work. It may work after player combat salvage (haven't seen an example otherwise yet), but not on derelicts spawning after NPC fleets engage in a battle. I recovered an Astral derelict within 5 minutes of a new game in Hybrasil due to Archean Order and Tri-Tachyon skirmishes even though it has the hullmod.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5431 on: October 19, 2019, 08:59:14 PM »

CampaignPlanet oldPlanet = (CampaignPlanet)this.market.getPrimaryEntity();
CampaignPlanet newPlanet = null;
newPlanet = new CampaignPlanet(oldPlanet.getId(), oldPlanet.getName(), newPlanetType, oldPlanet.getRadius(),

(I'd highly recommend not doing this since you're using core code directly rather than using API stuff. You're relying on code that could change or stop working in the way you'd expect. Plus, just generally, if the API doesn't cut it for something, I'd much rather see a suggestion/request for improving it than a workaround like that.)

I tried this. Unfortunately, it doesn't work. It may work after player combat salvage (haven't seen an example otherwise yet), but not on derelicts spawning after NPC fleets engage in a battle. I recovered an Astral derelict within 5 minutes of a new game in Hybrasil due to Archean Order and Tri-Tachyon skirmishes even though it has the hullmod.

Ahh, hmm, yeah, I wasn't thinking about that, you're right. I suppose you *could* probably clear out the "recoverable" salvage special on nearby derelicts as needed with a script, even if that's a bit of an inelegant approach.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5432 on: October 19, 2019, 10:40:18 PM »

When does an orbital station get autofitted, and which code handles this?

I've just noticed that e.g. Jangala's station has a different loadout each time a new game is started, but those in a couple of mods (which add markets in the code rather than using the economy JSONs) have a constant loadout, which is retained even after the station is killed.
Campaign plugin's pickFleetInflater also doesn't seem to be called for stations.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5433 on: October 20, 2019, 09:07:47 AM »

Hmm - iirc, pickFleetInflater() does get called for it, and it's autofitted at the usual times. A bit of inflater configuration (provided it's the DefaultFleetInflater) is done in OrbitalStation.applyCRToStation() - it ensures all weapons are available.

... and, hmm, I think there's actually a bug there - it'll only make all weapons available if the station has already been inflated. This might explain Jangala ending up with different weapons - or, rather, since the player spawns next to it, it'll inflate for the first time, which will not have DefaultFleetInflaterParams.allWeapons == true.

Then again, it seems like faction stations should also have the same issue, since they would inflate for the first time when the player is nearby. So, not quite sure what's going on as far as that specifically. Possibly for some of the factions, given the autofit tags and weapon tiers, there just isn't much/any variety in possible station fits?
Logged

Dwarden

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5434 on: October 20, 2019, 05:17:30 PM »

is there simple way how via scripting/mod prevent / omit loading of any and all music (especially to stop building it's playlist) ?
this would cover both vanilla and every active mod

note: 33% of all mods size is music and it has notable effect on loading times
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5435 on: October 20, 2019, 05:27:38 PM »

Music is not loaded until it starts playing and is actually streamed from disk when it plays, so it has zero impact on loading times. So, uh, a good news/bad news type of situation :)
Logged

Dwarden

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5436 on: October 20, 2019, 06:49:40 PM »

Music is not loaded until it starts playing and is actually streamed from disk when it plays, so it has zero impact on loading times. So, uh, a good news/bad news type of situation :)

Spoiler
50109 [pool-4-thread-1] INFO  sound.OOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOO  - Creating music buffer #1
50111 [pool-4-thread-2] INFO  sound.OOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOO  - Creating music buffer #2
...
59468 [Thread-4] INFO  sound.oo0O  - Creating streaming player for music with id [RSF - Tsuna Awakens.ogg]
59473 [Thread-4] INFO  sound.oo0O  - Cleaning up music with id [RSF - Tsuna Awakens.ogg]
[close]

this is with music disabled, on load
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5437 on: October 20, 2019, 07:09:47 PM »

It's checking that the music files actually exists; the process takes a few milliseconds per track at most and does not involve actually loading the file.

As you can see from the log there it took around 5 ms (59473 minus 59468); that's actually a bit higher than I'd expect though it depends on your HDD etc - for reference, on my PC, this process takes about 40 ms for all of vanilla's music. Even if it took 5 ms per, it'd take 200 tracks to add a second onto game's the load time.

It's not possible to load the music ahead of time. It would take too much memory and too much time.
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 #5438 on: October 20, 2019, 09:09:39 PM »

Ahh, hmm, yeah, I wasn't thinking about that, you're right. I suppose you *could* probably clear out the "recoverable" salvage special on nearby derelicts as needed with a script, even if that's a bit of an inelegant approach.

Could I make the hullmod do the inverse and set the recovery rate average for the player only and check for things that make that number 100? (might be more things than I think and would likely be update volatile, though)

Then add the UNBOARDABLE tag?
Logged

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5439 on: October 21, 2019, 12:10:05 AM »

I've got a ship with modules, and it seems to work fine in the simulator, except when I call it as a reinforcement, it shows up without its modules. Is there something simple I'm missing that would make it do that?

EDIT: Disregard, I figured it out. It was not set as a SHIP_WITH_MODULES
« Last Edit: October 21, 2019, 12:31:28 PM by Sinosauropteryx »
Logged

SomeDegenerate

  • Ensign
  • *
  • Posts: 15
  • Credit to TerminalMontage on YouTube for the PfP
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5440 on: October 21, 2019, 08:25:09 AM »

How do I get the game to read my industries.csv, and are there any conditions (i.e. an empty field in the csv) that would make the game disregard the industries inside? Is that something that happens automatically, or is there some initialization I need to do in the mod plugin?

To build off of that - how do I make an industry buildable? Even when overriding and setting isHidden() to return false and isAvailabletoBuild() to true, my industry still won't show up. I'm currently testing to generate a planet with the industry to verify that the industry exists in the first place.

Thanks!
« Last Edit: October 21, 2019, 11:14:29 AM by SomeDegenerate »
Logged
Roses are red, violets are blue. I'm complete garbage, how about you?

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5441 on: October 21, 2019, 12:32:54 PM »

Is there a way to dynamically change the render order of modules? Or can it only be changed in the .variant file?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5442 on: October 21, 2019, 05:04:53 PM »

How do I get the game to read my industries.csv, and are there any conditions (i.e. an empty field in the csv) that would make the game disregard the industries inside? Is that something that happens automatically, or is there some initialization I need to do in the mod plugin?

As long as it's in the right folder, it should be read/merged with the core file automatically.

To build off of that - how do I make an industry buildable? Even when overriding and setting isHidden() to return false and isAvailabletoBuild() to true, my industry still won't show up. I'm currently testing to generate a planet with the industry to verify that the industry exists in the first place.

Hmm - make sure it's not an upgrade of something else, but aside from that, it sounds like you've got it covered. Maybe make a copy of an industry with no requirements - both as far as the code and the csv row - and start from that? Light Industry (among others) should make a good starting point.

Is there a way to dynamically change the render order of modules? Or can it only be changed in the .variant file?

Changing the hull size might work - larger hull sizes are rendered below smaller ones - but it might have some side effects like more powerful explosions. Removing the module from the engine and re-adding it might also work; iirc the ones added last are rendered on top, but I could be wrong about that.
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 #5443 on: October 21, 2019, 07:24:04 PM »

How do I make a black hole have the correct hazard rather than a corona?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5444 on: October 21, 2019, 07:28:22 PM »

Check star_gen_data.csv - iirc the solar wind there has a negative direction?

Also see: StarSystemGenerator.setBlackHoleIfBlackHole() - that adds the event horizon terrain.
Logged
Pages: 1 ... 361 362 [363] 364 365 ... 710