Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 305 306 [307] 308 309 ... 710

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

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4590 on: May 26, 2019, 09:15:35 AM »

That's the kind of question that makes me scared about what the underlying reason for asking it is :)
lol That's understandable. I should have offered more context. One of my mods (starship legends) keeps records for certain ships. Once those ships are destroyed the records serve no purpose but to bloat the save file, so I would like to remove them. The idea is to iterate through my records in beforeGameSave and cull any records that refer to destroyed ship and are therefore no longer necessary.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4591 on: May 26, 2019, 09:29:59 AM »

Hmm - how about adding a FleetEventListener to the player's fleet, and then detecting what got destroyed in the reportBattleOccurred() method? SystemBountyIntel has a decent reference implementation, though it adds the listener to Global.getSector().getListenerManager() instead of fleet.addEventListener(). Either way works; the latter only gets called for fleet events for that fleet so is a bit better performance-wise.

One thing to watch out for would be re-adding the listener when the player fleet despawns.

This wouldn't catch ships being scuttled, though.

This seems like it's fundamentally impossible to do perfectly - see case of "scripted event removes ships for a bit, does stuff, and puts them back later" - how could you ever detect that those ships are still around? So any solution would be partial.
Logged

vorpal+5

  • Captain
  • ****
  • Posts: 286
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4592 on: May 26, 2019, 11:36:22 AM »

Are the mods in general working if applied to a current game?

Mods that add ships, sectors, tweak rules?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4593 on: May 26, 2019, 11:40:21 AM »

That depends on the mod and how it's coded, and on what it's changing - kind of impossible to answer exactly in general. E.G. a mod that changes some settings may apply to a current game ... unless the setting in question are used when creating the game and not looked at afterwards. Or, a mod that adds a star system may do it in a way that only happens on new game creation - or may have code that adds the system to an existing game.

Mostly, though, I'd expect mods that add star systems, factions, and so on to require a new game. So that's less theoretical and probably closer to the answer you're looking for :)
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4594 on: May 26, 2019, 11:44:51 AM »

Hmm - how about adding a FleetEventListener to the player's fleet, and then detecting what got destroyed in the reportBattleOccurred() method? SystemBountyIntel has a decent reference implementation, though it adds the listener to Global.getSector().getListenerManager() instead of fleet.addEventListener(). Either way works; the latter only gets called for fleet events for that fleet so is a bit better performance-wise.

One thing to watch out for would be re-adding the listener when the player fleet despawns.

This wouldn't catch ships being scuttled, though.

This seems like it's fundamentally impossible to do perfectly - see case of "scripted event removes ships for a bit, does stuff, and puts them back later" - how could you ever detect that those ships are still around? So any solution would be partial.
Ok, that makes sense. I'll just clean up whatever I can based on events. Thanks Alex!

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4595 on: May 26, 2019, 11:49:43 AM »

... you know, I've got a really weird idea for this that just might work. The way to go would be to keep the tracked data in the fleet member itself, right? Might not be structured in a way that allows that on your end, but this just got me thinking.

FleetMemberAPI doesn't have an explicit container for custom data (i.e. a MemoryAPI) but it does have buffs - which can be any custom class implementing Buff. So you could in theory have a class that implements Buff holding all your data for that fleet member, and if it wasn't referenced elsewhere, it would be, ah, self-cleaning.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4596 on: May 26, 2019, 12:33:59 PM »

Holy crap, that's a beautiful hack!  :D
I wish I'd thought of it a few months ago. At this point I'd have to backtrack too much to use that method. I'll keep it in mind for the future.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4597 on: May 26, 2019, 12:58:19 PM »

Ah yeah, figures it'd be too much of a refactor at this point.

(Have to admit, I'm kind of happy with myself for thinking up that one :D)
Logged

vorpal+5

  • Captain
  • ****
  • Posts: 286
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4598 on: May 26, 2019, 02:13:40 PM »

Another newbie question if you allow!

Do I get a slow down in speed (like in Mount&Blade) by having a lot of ships? Or that's always the slowest one that dictate speed? What is the practical limit to the number of ships in my fleet (my budget?)
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4599 on: May 26, 2019, 07:22:04 PM »

That's not a mod question, but more general, and better asked elsewhere.

The slowest ship determines your speed, while bigger fleets are harder to accelerate, decelerate and move around. So having a small fleet feels nimble and responsive, while bigger fleets take time to get up to speed. Practical limit is simply by preference and determined through trial and error, although if you ask this question in the right area you'll no doubt get more detailed responses.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4600 on: May 26, 2019, 08:26:18 PM »

The slowest ship determines your speed, while bigger fleets are harder to accelerate, decelerate and move around. So having a small fleet feels nimble and responsive, while bigger fleets take time to get up to speed. Practical limit is simply by preference and determined through trial and error, although if you ask this question in the right area you'll no doubt get more detailed responses.

I think that's a mod feature, and vanilla doesn't have that mechanic - all fleets accelerate the same, depending on abilities. But as far as speed, yeah, it's just the slowest ship.

(Early versions of the game actually had the "larger fleet = slower" approach...)
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4601 on: May 27, 2019, 12:53:42 AM »

Any way to fix relations? How are they even handled?
It seems completely random as factions declare war agaisnt Independants or the factions they are supposed to be friendly too (starting relation 0.5+)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4602 on: May 27, 2019, 04:10:00 AM »

(sorry, forgot to reply the last time you asked)

The faction hostility event is indeed random. You can prevent it for any particular other-faction by making it cooperative with your faction, or for all factions by setting the custom boolean "engagesInHostilities":false, in your .faction file (see independents for an example). But I dunno what's going on if someone is starting hostilities with independents.
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4603 on: May 28, 2019, 03:19:47 AM »

A quick one - is it possible to add a line to a skin file to ensure it doesn't show up in the codex?

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4604 on: May 28, 2019, 03:29:59 AM »

Question: There is no tutorial or good info on making custom faction fleets (like Remnants), so one has to dig and try to reverse-engineer, which is tiresome.
Especially if what you want is something SIMPLER - no warning beacons, no dormant/resurgent, nothing.
Just fleet spawned in a system that either patrol or decide to attack some market somewhere.

Now, with recent changes most things work without a complied .jar. So far my entire mod seesm to work without it. If I want to create such faction fleets, will it also work without compiling a jar?
Logged
Pages: 1 ... 305 306 [307] 308 309 ... 710