Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 690 691 [692] 693 694 ... 711

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

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10365 on: December 10, 2023, 03:17:53 PM »

Misc.setUnremovable(person, true) may work.
Thanks! This partly worked in that I am not able to directly reassign the officer in question, but it seems I am still able to 'cheese' it somewhat by simply picking another officer (or the player character) and assigning them to the supposedly unremovable person's ship, thus initiating an officer swap. Would there be a way to counteract this loophole?
Logged

Sorrydough

  • Ensign
  • *
  • Posts: 30
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10366 on: December 11, 2023, 04:44:00 AM »

You want to set the BACK_OFF flag. BACKING_OFF is just a way it can signal that it's doing that to anything else that might care, such as a ship system AI. BACK_OFF is the actual instruction to do so.
Your AI is setting the BACKING_OFF flag without actually backing off and this is what triggered me to start trying to mess with the BACK_OFF flag. How do I use the BACKING_OFF flag if it can be set without the ship backing off?
For example I might write a behavior that checks whether the target is backing off by checking the flag, but it isn't actually backing off because it's aggressive, so the code I wrote is going to cause bugged behavior.
« Last Edit: December 11, 2023, 06:23:18 AM by Sorrydough »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10367 on: December 12, 2023, 09:26:40 AM »

Hey folks, do you know of a mod that allows you to create "loadouts" of your fleet?

I'm in a situation atm where I have a decent system that is visited by pirates, so I bounce between doing stuff in the core worlds (quests, smuggling, buying new ships etc) and going home to clean up the pirate fleets. So I was wondering if I could make 1 loadout with better smuggling and efficient ships for my core world business and 1 loadout for when I return to wreck the pirates.

Alternatively is there a better solution that does not require me to go back every so often?

Hi - ah, sorry, this isn't the right thread for it. You might have better luck asking in the general forum! This thread is for questions related to creating mods.


Thanks! This partly worked in that I am not able to directly reassign the officer in question, but it seems I am still able to 'cheese' it somewhat by simply picking another officer (or the player character) and assigning them to the supposedly unremovable person's ship, thus initiating an officer swap. Would there be a way to counteract this loophole?

Ah, I don't think so - looks like it only really works for the "integrated AI core" scenario. I'll keep this in mind!

Your AI is setting the BACKING_OFF flag without actually backing off and this is what triggered me to start trying to mess with the BACK_OFF flag. How do I use the BACKING_OFF flag if it can be set without the ship backing off?
For example I might write a behavior that checks whether the target is backing off by checking the flag, but it isn't actually backing off because it's aggressive, so the code I wrote is going to cause bugged behavior.

Looks like you're right - code changed since that flag was added, and since the AI basically doesn't use this flag internally, I never noticed it was being set in the wrong place. *Should* be fixed for the next release!

For now, checking that the DO_NOT_BACK_OFF and SAFE_VENT flags are not set should get you most of the way there.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10368 on: December 12, 2023, 07:19:47 PM »

Ah, I don't think so - looks like it only really works for the "integrated AI core" scenario. I'll keep this in mind!
Ah, alright. I'll just add a note for this.
Logged

bananana

  • Commander
  • ***
  • Posts: 229
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10369 on: December 13, 2023, 12:51:35 AM »

question
is stats.getProjectileSpeedMult() bugged?
it is used exactly once, in the since unused skill ranged_specialization
using it in the hullmod of my own making caused some rather interesting side effects, namely making proximity fuze bombs not explode forever
and i'm not sure where to put the blame, whether it is the stat itself being weird, or my own incompetence
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10370 on: December 15, 2023, 10:44:01 AM »

question
is stats.getProjectileSpeedMult() bugged?
it is used exactly once, in the since unused skill ranged_specialization
using it in the hullmod of my own making caused some rather interesting side effects, namely making proximity fuze bombs not explode forever
and i'm not sure where to put the blame, whether it is the stat itself being weird, or my own incompetence

My guess would be that the bombs do some kind of "how long should it take to travel to max range" calculation based on this multiplier, and if it's really low, they may end up with some weird numbers. You could check if that's the case by using less extreme values - but I'm not sure exactly what you're doing, of course.
Logged

Lukas04

  • Captain
  • ****
  • Posts: 372
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10371 on: December 17, 2023, 05:27:41 AM »

Is there any alternative to "removeDeployed" from "CombatFleetManager" in the API? Theres a few cases where manualy spawned ships dont appear to want to be removed, specificly still appearing in the deployment menu, even if dead and removed from the combat engine. This method seems to do the job, but its of course obfuscated, so an alternative or it being unobfuscated would be nice.

Would also be good to know if there is a method to hide spawned ships from the deployment menu.
« Last Edit: December 17, 2023, 05:30:20 AM by Lukas04 »
Logged
My Mods

Lukas04

  • Captain
  • ****
  • Posts: 372
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10372 on: December 17, 2023, 12:02:38 PM »

And another question, any good way to load new fonts in to the game for paragraphs, etc?
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10373 on: December 18, 2023, 10:14:58 AM »

Is there any alternative to "removeDeployed" from "CombatFleetManager" in the API? Theres a few cases where manualy spawned ships dont appear to want to be removed, specificly still appearing in the deployment menu, even if dead and removed from the combat engine. This method seems to do the job, but its of course obfuscated, so an alternative or it being unobfuscated would be nice.

I don't think there's any alternative. Looks like I'd already added it to the API, though! Let me add the fighter wing version while I'm looking at it.


Would also be good to know if there is a method to hide spawned ships from the deployment menu.

I actually have no idea. These methods for spawning ships is not something vanilla uses much, so I'be equally unsurprised if you told me these do or don't show up in the deployment menu. I also don't know offhand whether these add into the deployment points total or not.

If you can give me a (Java 7 compatible) code snippet I can paste in somewhere and run, "can this ship be hidden from the deployment menu" would be an easier question for me to answer - and also, it'd be a lot easier to code up a way to do it. I don't really know the standard way these methods are used etc etc.


And another question, any good way to load new fonts in to the game for paragraphs, etc?

Don't think so. Added a SettingsAPI.loadFont(String filename) method.
Logged

alaricdragon

  • Commander
  • ***
  • Posts: 163
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10374 on: December 18, 2023, 11:54:32 AM »

hello again everyone! i have returned with but a single question
1) is there a way to edit a rules.csv $memory_whatsit with code?
thanks again for answering my question in the past everyone. its been helpful.
Logged

bananana

  • Commander
  • ***
  • Posts: 229
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10375 on: December 18, 2023, 04:24:06 PM »

My guess would be that the bombs do some kind of "how long should it take to travel to max range" calculation based on this multiplier, and if it's really low, they may end up with some weird numbers. You could check if that's the case by using less extreme values - but I'm not sure exactly what you're doing, of course.

well, the bombs have 0 proj speed, and a non-zero launch speed, so they're supposed to slow down to zero and stay there
and the multiplier is 2f, a +100% speed bonus
which should result in the same 0 proj speed
i tested again and the issue only happens when getProjectileSpeedMult.modifyMult is above zero and proj speed is lesser than launch speed
something suspicious happening tbh, i guess something odd in the prox fuze code?
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10376 on: December 19, 2023, 01:12:59 AM »

Hi, is there a way to force a fighter to do its "landing" animation at any time other than landing back at its carrier? I'm envisioning a sort of 'boarding' animation where a fighter would 'land' on top of an enemy ship, and disappear from there.
Logged

alp7292

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10377 on: December 19, 2023, 11:46:19 AM »

hello i copied ballistic rangefinder hullmod from original files to a mod file to edit i changed its location from com.fs.starfarer.api.imp to data.hullmods for both hull_mods.csv and from the script and no addational changes were made when i run the game it crashes saying assignment conversion not possible how can i fix it
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10378 on: December 19, 2023, 06:52:11 PM »

hello again everyone! i have returned with but a single question
1) is there a way to edit a rules.csv $memory_whatsit with code?
thanks again for answering my question in the past everyone. its been helpful.

Yes. Exactly how depends on which one but it'll be something using the MemoryAPI, obtained via a call like:

Global.getSector().getMemoryWithoutUpdate()
FactionAPI.getMemoryWithoutUpdate()
SectorEntityToken.getMemoryWithoutUpdate()
MarketAPI.getMemoryWithoutUpdate()

And similar.


well, the bombs have 0 proj speed, and a non-zero launch speed, so they're supposed to slow down to zero and stay there
and the multiplier is 2f, a +100% speed bonus
which should result in the same 0 proj speed
i tested again and the issue only happens when getProjectileSpeedMult.modifyMult is above zero and proj speed is lesser than launch speed
something suspicious happening tbh, i guess something odd in the prox fuze code?

... probably! Offhand I'm not surprised something goes weird if proj speed is zero. Launch speed being > proj speed is a fairly common occurrence, though.


Hi, is there a way to force a fighter to do its "landing" animation at any time other than landing back at its carrier? I'm envisioning a sort of 'boarding' animation where a fighter would 'land' on top of an enemy ship, and disappear from there.

ShipAPI.beginLandingAnimation(ShipAPI target)

How well that'll actually work, I don't know; not enough may be exposed to make it work out.


hello i copied ballistic rangefinder hullmod from original files to a mod file to edit i changed its location from com.fs.starfarer.api.imp to data.hullmods for both hull_mods.csv and from the script and no addational changes were made when i run the game it crashes saying assignment conversion not possible how can i fix it

Probably because it's now a script being compiled with Janino (a compiler the game uses to compile loose scripts) and the code from that hullmod uses Java in a way Janino does not support. The way to get around this would be to either tweak the code based on what exactly the error is, or to compile it into a jar yourself instead of having the game compile it.
Logged

nathan67003

  • Commander
  • ***
  • Posts: 158
  • Excellent imagination, mediocre implementation.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10379 on: December 20, 2023, 07:58:18 PM »

Would it be possible to mod in such a thing as a reflective shield - not in that it would reflect things back to sender, but rather that the shield's surface would act like a (partially effective) mirror? I'd ideally manually blacklist some weapons from being reflected (anything that isn't explicitly light, for instance) as well. Even better if this can be done for arbitrary shield shapes (ellispoids is what I'm thinking about atm).
« Last Edit: December 22, 2023, 08:50:51 AM by nathan67003 »
Logged
I have some ideas but can't sprite worth a damn and the ideas imply really involved stuff which I've no clue how to even tackle.
Pages: 1 ... 690 691 [692] 693 694 ... 711