Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 634 635 [636] 637 638 ... 710

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

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9525 on: January 30, 2023, 02:14:37 PM »

I'd like to make a bounty where the fleet will retreat when encountered (and you are forced to chase down their ships because they are being assassinated!) However, doing this in a way like reducing fleet points massively allows the player to autoresolve. Is there a way to force/allow the player to do a chasing fleeing enemy scenario without allowing the autoresolve option?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9526 on: January 30, 2023, 04:34:33 PM »

Is it possible to close a CustomDialogDelegate via code? I created a fancy custom panel that allows the player to easily select a weapon or fighter wing from their cargo, and it works entirely as it should, but I haven't found a single way to close the panel without the player pressing Confirm or Cancel. As the item selection is handled via buttons, I'd like to have a way to close the custom panel when the button is pressed (without closing the parent interaction dialog).

I don't think so, let me make a note.



In addition, please add a getBarrelSpriteName() function to the WeaponSpecAPI. It's currently impossible to render the barrels of weapons in a custom panel without manually entering the ID (which is infeasible if you're dealing with thousands of modded weapons).

Added these to ProjectileWeaponSpecAPI!


Edit: a way to render missiles in their launchers would be nice too.

Ah, sorry - that's more involved.


It just looks like the upkeep for a Size 3 colony with Vast Ruins is half what it should be (according to the Wiki). Am I correct? Is this intended?

(I know I know, it seems weird that I'm asking about this minor thing. I'm trying to understand the TechMining code and this looked odd to me - trying to be sure that I'm translating it correctly.)

... I'm going to assume the code is correct, though if we're being honest, I don't remember what was intended here. It could definitely use another look at some point.


I'd like to make a bounty where the fleet will retreat when encountered (and you are forced to chase down their ships because they are being assassinated!) However, doing this in a way like reducing fleet points massively allows the player to autoresolve. Is there a way to force/allow the player to do a chasing fleeing enemy scenario without allowing the autoresolve option?

I think the way to do this would be to provide your own BattleCreationPluginImpl for that specific battle which ignores the stuff specified in BattleCreationContext and creates a retreat-type scenario regardless. I'm not 100% sure this would play nice with everything in FleetInteractionDialogPluginImpl. You might need to change the FleetGoal for each side in the passed-in BattleCreationContext and just in general make sure the various battle-ending outcomes work properly.
Logged

Ontheheavens

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9527 on: January 30, 2023, 10:58:39 PM »

Constructors for implementations of ship systems are public and accept ship instance and system spec - so theoretically I can create instance of second ship system. BUT: I reckon there are plenty of things, features and calls that assume only a single system on the ship.

What I need the shipsystem instance for is the DroneAI constructor - I want to assign a vanilla AI to manually-spawned ship. Is that something realistic at all? My ultimate goal here is to hijack vanilla movement AI for my custom AI that would only provide target location and facing to vanilla implementations. I think I can do something of that spirit with BasicEngineAI, which allows for setting heading and facing - in absolute angles, if I understood correctly. What purpose BasicEngineAI serves and what can I make it do for me?

If that is not feasible or if asking questions about vanilla obfuscations is not permitted - is there any possible resources or help on constructing movement AI from scratch, or am I on my own here?

Edit: figured out BasicEngineAI and hijacking the movement part, now interested in getting rid of the jerkiness, which is quite resembling movements of vanilla fighters, while I require smooth movement of station drones. Saw the SmoothMovementModuleCombatCopy - is that what I need? Does this mean that velocity shenanigans are inevitable if precise locomotion is required?
« Last Edit: January 31, 2023, 09:41:31 AM by Ontheheavens »
Logged
   

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9528 on: January 31, 2023, 12:35:12 AM »

With my techmining mod I am getting to the point of doing drop groups and special code to determine what kinds of things would be appropriate to the planet which is being mined.

However I don't know how to tell the game "hey, use my custom extended techmining code instead of the base-game code". So that this code:

Code: java
package data.scripts.wta_industry;

/*
  ...imports here...
 */

public class wta_TechMining extends TechMining {

/*
 ... my code here ...
 */

}

I don't know how to say "TechMining, you're now using that ^^^ code up there".

Help on this will be much appreciated. :)

AnMGQfan

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9529 on: January 31, 2023, 09:35:42 AM »

Hi.
I am just starting to make mod and I want to know if it is possible to make my modded ships only spawn as derelict ship (better if I can make them rarer the closer we are to civilised space).
thx in advance.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9530 on: January 31, 2023, 10:59:45 AM »

Saw the SmoothMovementModuleCombatCopy - is that what I need? Does this mean that velocity shenanigans are inevitable if precise locomotion is required?

Given what you're trying to do, you probably just want to write some code that manually sets the velocity (or, heck, even the location) of the ship and makes the engines burn in the right way to make it look like they're doing that. Otherwise, you have to try to get really precise movement by giving commands to the ship's engines, and that's just not going to be *that* precise, since the minimum it can do is a frame's worth of acceleration.


I don't know how to say "TechMining, you're now using that ^^^ code up there".

Help on this will be much appreciated. :)

You want to provide your own copy of industries.csv which points to your new TechMining class.


Hi.
I am just starting to make mod and I want to know if it is possible to make my modded ships only spawn as derelict ship (better if I can make them rarer the closer we are to civilised space).
thx in advance.

Hmm - I don't see why not, though this seems like something you'd need to write custom code to do.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9531 on: January 31, 2023, 11:06:13 AM »

I don't know how to say "TechMining, you're now using that ^^^ code up there".

Help on this will be much appreciated. :)

You want to provide your own copy of industries.csv which points to your new TechMining class.
As a note, just changing industries.csv will only apply to newly-constructed tech-mining; if someone installs your mod mid-game, you need to take additional steps.

I'd suggest taking a look at my Planetary Shield mod, which includes code that does a replacement of existing planetary shield installations on initial mod activation. It shouldn't be too hard to modify that for your needs.
Logged
Wyvern is 100% correct about the math.

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9532 on: January 31, 2023, 11:08:32 AM »

I don't know how to say "TechMining, you're now using that ^^^ code up there".

Help on this will be much appreciated. :)
You want to provide your own copy of industries.csv which points to your new TechMining class.
Brilliantly easy, thank you Alex!

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9533 on: January 31, 2023, 11:16:07 AM »

I don't know how to say "TechMining, you're now using that ^^^ code up there".

Help on this will be much appreciated. :)

You want to provide your own copy of industries.csv which points to your new TechMining class.
As a note, just changing industries.csv will only apply to newly-constructed tech-mining; if someone installs your mod mid-game, you need to take additional steps.

I'd suggest taking a look at my Planetary Shield mod, which includes code that does a replacement of existing planetary shield installations on initial mod activation. It shouldn't be too hard to modify that for your needs.
Going the extra mile, eh? Will have a look-see tonight.

I should expect that uninstalling my mod would require the player to first remove all existing TechMining infrastructure?

What if I set TechMining to be a Structure rather than an Infrastructure?

What might that do to existing Infrastructure, or (on removal) do to a Structure suddenly switching back to Infrastructure when the planet is already maxed out with Infrastructure?

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9534 on: January 31, 2023, 11:23:00 AM »

I should expect that uninstalling my mod would require the player to first remove all existing TechMining infrastructure?
It's actually worse than that - to allow uninstalling, all existing tech-mining would need to be removed, including any tech-mining on NPC planets, and then the game would need to be run for two months in-game time, otherwise the end-of-month cost summaries will crash the game looking for your implementation of tech-mining.

If you want an uninstall-like option, the best I was able to do was to include a settings switch that restores vanilla behavior.

What if I set TechMining to be a Structure rather than an Infrastructure?

What might that do to existing Infrastructure, or (on removal) do to a Structure suddenly switching back to Infrastructure when the planet is already maxed out with Infrastructure?
Setting tech mining to be a structure rather than an industry will just work.

Setting it back will also 'just work', but planets that find themselves over the industry cap will suffer a -5 stability penalty. (This stability penalty is a vanilla mechanic, intended for the case of "Someone gets a hypershunt tap up and running, builds an extra industry, and then has a shipping shortage on transplutonics".)
« Last Edit: January 31, 2023, 11:26:18 AM by Wyvern »
Logged
Wyvern is 100% correct about the math.

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9535 on: January 31, 2023, 12:02:11 PM »

I should expect that uninstalling my mod would require the player to first remove all existing TechMining infrastructure?
It's actually worse than that - to allow uninstalling, all existing tech-mining would need to be removed, including any tech-mining on NPC planets, and then the game would need to be run for two months in-game time, otherwise the end-of-month cost summaries will crash the game looking for your implementation of tech-mining.

If you want an uninstall-like option, the best I was able to do was to include a settings switch that restores vanilla behavior.
Is that tech-mining on NPC planets in the vanilla game, or something that happens with other mods like Nexrellin etc?

If tech-mining returns a special item, what does the NPC planet do with it?
Quote
What if I set TechMining to be a Structure rather than an Infrastructure?

What might that do to existing Infrastructure, or (on removal) do to a Structure suddenly switching back to Infrastructure when the planet is already maxed out with Infrastructure?
Setting tech mining to be a structure rather than an industry will just work.

Setting it back will also 'just work', but planets that find themselves over the industry cap will suffer a -5 stability penalty. (This stability penalty is a vanilla mechanic, intended for the case of "Someone gets a hypershunt tap up and running, builds an extra industry, and then has a shipping shortage on transplutonics".)
Cool, so the game can potentially handle the extra industrial. Apart from the crash potential above, so I’d have to do like you and provide a vanilla settings switch.

It’s tempting to take the lazy-mans way and say “not removable, test on a copy of your game”.

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9536 on: January 31, 2023, 12:10:53 PM »

I should expect that uninstalling my mod would require the player to first remove all existing TechMining infrastructure?
It's actually worse than that - to allow uninstalling, all existing tech-mining would need to be removed, including any tech-mining on NPC planets, and then the game would need to be run for two months in-game time, otherwise the end-of-month cost summaries will crash the game looking for your implementation of tech-mining.

If you want an uninstall-like option, the best I was able to do was to include a settings switch that restores vanilla behavior.
Is that tech-mining on NPC planets in the vanilla game, or something that happens with other mods like Nexrellin etc?

It's any tech-mining that's using your code. So, if you just change industries.csv, the only tech-mining that needs to be removed for an uninstall is any that were constructed after the mod is installed. It's all tech-mining if you do like my mod does and scan through all colonies to replace vanilla tech-mining with your own implementation.

If tech-mining returns a special item, what does the NPC planet do with it?
As for return of special items: to the best of my knowledge, tech-mining on AI colonies doesn't actually do anything. So, it doesn't return any special items or put the occasional unusual item up in the markets, and by the same token, it doesn't install special items because it doesn't generate any in the first place. Changing this behavior is certainly something a mod could do, though.
Logged
Wyvern is 100% correct about the math.

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9537 on: January 31, 2023, 12:48:34 PM »

Is that tech-mining on NPC planets in the vanilla game, or something that happens with other mods like Nexrellin etc?

It's any tech-mining that's using your code. So, if you just change industries.csv, the only tech-mining that needs to be removed for an uninstall is any that were constructed after the mod is installed. It's all tech-mining if you do like my mod does and scan through all colonies to replace vanilla tech-mining with your own implementation.

If tech-mining returns a special item, what does the NPC planet do with it?
As for return of special items: to the best of my knowledge, tech-mining on AI colonies doesn't actually do anything. So, it doesn't return any special items or put the occasional unusual item up in the markets, and by the same token, it doesn't install special items because it doesn't generate any in the first place. Changing this behavior is certainly something a mod could do, though.
Is it possible to scan through and only affect the player’s colonies?

Since tech-mining on AI colonies does nothing, and changing that behavior would definitely be feature-creep. Leave that sort of thing to the mod authors who have Factions actively expanding and growing by settling new colonies.

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9538 on: January 31, 2023, 01:57:13 PM »

Is it possible to scan through and only affect the player’s colonies?
Technically yes, but I don't recommend it: that would interface poorly with Nexerelin's ability for the player to capture NPC colonies. I'd think it'd be better to simply replace everything and just have your tech-mining implementation not do anything if it's not at a player-controlled colony.
Logged
Wyvern is 100% correct about the math.

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9539 on: January 31, 2023, 02:34:41 PM »

is there a listener that i can attach to a ship that advances while combat is paused? hullmod's advance doesn't, and neither does an AdvanceableListener.

edit: alternatively, is there any kind of script/listener that i can add to the combat engine that is easy to clean up when combat ends? i am trying to draw onto the UI but only when the ship is alive and controlled by the player.
Logged
Pages: 1 ... 634 635 [636] 637 638 ... 710