Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Anubis-class Cruiser (12/20/24)

Pages: 1 ... 745 746 [747] 748 749 ... 751

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

NikoTheGuyDude

  • Captain
  • ****
  • Posts: 430
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11190 on: December 13, 2024, 10:20:34 AM »

Why are fadeOutIfAny and fadeIn args of playCustomMusic ints? What's the accepted values of them? Just 1/0 AKA truthy/falsey?
Logged

starficz

  • Ensign
  • *
  • Posts: 28
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11191 on: December 13, 2024, 04:30:32 PM »

Is there anyway to hook functions into buttonApi onclick? using some *cough* methods I see buttons have a can have a listener with an actionPerformed, can we get this expanded into a list of listener's that all fire? The API getting access to be able to add their own listiners would then be very useful.
Logged

NikoTheGuyDude

  • Captain
  • ****
  • Posts: 430
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11192 on: December 14, 2024, 03:33:48 PM »

Im having some strange behavior with my raid fleets. They organize at the source, but not all leave for the bombardment. I suspect this has something to do with the power difference, as the target is unguarded save for some really bad fleets. Any way to force them all to respond?
Logged

NikoTheGuyDude

  • Captain
  • ****
  • Posts: 430
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11193 on: December 14, 2024, 03:45:48 PM »

On that note, I'm also noticing that the sheer quantity of fleets this event is spawning (27 - not final but just in case I want high numbers I want to fix this) is causing their AI to really freak out when it comes time to return to the base. They never actually return to the base, rather, they keep trying to adjust for eachother so they don't collide. Is there a flag to stop them from doing this?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25006
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11194 on: December 15, 2024, 10:40:37 AM »

The Ironshell tax code have a tax that triggers if player trades at black market (the code checks if market is blackmarket), this however also triggers when player trade at their own colony's open market if they are hostile to indepedent.

Ah - ok, yes, it will return true when hostile to independents.

Also further question from TL'ers, does Aptitude of a skill still do anything in current version of the game?

I'm not sure what you mean. They exist, are implemented in the AptitudeDesc class, and print the description of how how aptitudes work.

Why are fadeOutIfAny and fadeIn args of playCustomMusic ints? What's the accepted values of them? Just 1/0 AKA truthy/falsey?

The number of seconds; int for historical reasons.

Im having some strange behavior with my raid fleets. They organize at the source, but not all leave for the bombardment. I suspect this has something to do with the power difference, as the target is unguarded save for some really bad fleets. Any way to force them all to respond?

I'm sorry, this is not enough information and this sort of question is difficult enough to answer at the best of times. It's probably some kind of issue with the raid setup; it's not going to be the power difference, iirc it's not going to care about that.

On that note, I'm also noticing that the sheer quantity of fleets this event is spawning (27 - not final but just in case I want high numbers I want to fix this) is causing their AI to really freak out when it comes time to return to the base. They never actually return to the base, rather, they keep trying to adjust for eachother so they don't collide. Is there a flag to stop them from doing this?

Hmm, I kind of doubt this is the problem? I'd really have to see it, though, but again I suspect some kind of issue with the raid setup. Does it work normally with a low number of fleets? (If it does, then, uh, I'd suggest just using a lower number of fleets; I don't honestly think this is something I'll have time to dig into on my end).
Logged

NikoTheGuyDude

  • Captain
  • ****
  • Posts: 430
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11195 on: December 15, 2024, 05:02:50 PM »

How do I remove the visual component of an asteroid belt? loc.removeEntity(plugin.entity) removes the terrain, but the visual component (e.g. the bands and the asteroids) remain.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3097
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11196 on: December 15, 2024, 06:19:06 PM »

How do I remove the visual component of an asteroid belt? loc.removeEntity(plugin.entity) removes the terrain, but the visual component (e.g. the bands and the asteroids) remain.

Find their entities and remove them.

Asteroids are linked to their source, see AsteroidSource, I think.

The ring bands are separate entities and their relation to a nearby asteroid belt can be totally arbitrary, so there is no sure-fire way to pick the ones you want from nearby rings you might not want to remove.
Logged

Mycophobia

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11197 on: December 17, 2024, 07:59:56 PM »

Hello Alex, miko and I noticed that giving fighter break chance could sometime throw null error : "Cannot read field "origSegments" because "<parameter1>" is null"

However, for some other fighter we have made, this does not happen, and it isnt quite clear why it does that, it seems to be a Tesselator error but not sure why it works sometime and dont in others.

Edit: I am an idiot and forgot to give said fighter bound.  :'(

Still, would it be safe to give fighter break chances? I note they are never done on vanilla stuff.
« Last Edit: December 17, 2024, 08:09:53 PM by Mycophobia »
Logged

Sincronic

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11198 on: December 18, 2024, 02:37:35 AM »

I'm trying to make a weapon that deals about 200 energy dmg to shields and 20 to hull and armor, that is 10% of base dmg.

Can anyone give me a code line/s on how its done in onhit file? Or whichever other way, as long as it works. I kinda suck at coding and have been trying for 10 hours without success
Logged

Killer of Fate

  • Admiral
  • *****
  • Posts: 2126
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11199 on: December 18, 2024, 12:11:32 PM »

trying to invoke the line that would increase damage to capital ships for a changed Advanced Turret Gyros

there is

stats.getDamagetoFrigates
stats.getDamagetoDestroyers
stats.getDamagetoCruisers

What's the capital ship's equivalent?

stats.getDamageToCapital

that seemed to work... I'm getting weird damage increase of 100 to 108 against 1.0 shield... When it should be 110... Might be some sort of interference. (Harbinger shooting at an Atlas)
« Last Edit: December 18, 2024, 12:29:14 PM by Killer of Fate »
Logged

EnigmaniteZ

  • Commander
  • ***
  • Posts: 153
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11200 on: December 18, 2024, 12:49:03 PM »

another example usage can be found at  /com/fs/starfarer/api/impl/campaign/skills/StrikeCommander.java @ line 102
as for damage values...that depends on whether you're using modifyPercent or modifyMult, and whether other modifiers may be at play...plus weird rounding issues I guess
Logged
Also known as: Khe, Kherae. Pros: tend to be an optimizer and a fixer. Cons: ADD (Is that a squirrel over there?) and severe memory issues (as in: I'm the last 10+ years)

Dear fellow coders: please use more null checks...

Killer of Fate

  • Admiral
  • *****
  • Posts: 2126
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11201 on: December 18, 2024, 01:18:10 PM »

another example usage can be found at  /com/fs/starfarer/api/impl/campaign/skills/StrikeCommander.java @ line 102
as for damage values...that depends on whether you're using modifyPercent or modifyMult, and whether other modifiers may be at play...plus weird rounding issues I guess
tbh, I'm just cannibalising turret gyros code, so it should be perfectly fine as long as i find the thing for capitals
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25006
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11202 on: December 18, 2024, 01:41:22 PM »

Hello Alex, miko and I noticed that giving fighter break chance could sometime throw null error : "Cannot read field "origSegments" because "<parameter1>" is null"

However, for some other fighter we have made, this does not happen, and it isnt quite clear why it does that, it seems to be a Tesselator error but not sure why it works sometime and dont in others.

Edit: I am an idiot and forgot to give said fighter bound.  :'(

Still, would it be safe to give fighter break chances? I note they are never done on vanilla stuff.

Hi! I actually don't know, it seems like it should be ok but since as you say it's not done in vanilla, there may be some special cases that break it. Also it's probably not great for performance; this is the reason vanilla doesn't do it (and why fighters just vanish after exploding half the time).

I'm trying to make a weapon that deals about 200 energy dmg to shields and 20 to hull and armor, that is 10% of base dmg.

Can anyone give me a code line/s on how its done in onhit file? Or whichever other way, as long as it works. I kinda suck at coding and have been trying for 10 hours without success

Take a look at com.fs.starfarer.api.impl.combat.SquallOnFireEffect in starfarer.api.zip.

another example usage can be found at  /com/fs/starfarer/api/impl/campaign/skills/StrikeCommander.java @ line 102
as for damage values...that depends on whether you're using modifyPercent or modifyMult, and whether other modifiers may be at play...plus weird rounding issues I guess
tbh, I'm just cannibalising turret gyros code, so it should be perfectly fine as long as i find the thing for capitals

CR might factor in, among other things.
Logged

Killer of Fate

  • Admiral
  • *****
  • Posts: 2126
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11203 on: December 19, 2024, 02:23:07 AM »

is there a way to program a DEM missile to attempt to collide with the ship?
Like a Gazer going wild and just coming closer and closer to then explode on the shield like a Tempest Drone?
Logged

Sincronic

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11204 on: December 20, 2024, 07:00:48 AM »

I'm trying to make a weapon that deals about 200 energy dmg to shields and 20 to hull and armor, that is 10% of base dmg.

Can anyone give me a code line/s on how its done in onhit file? Or whichever other way, as long as it works. I kinda suck at coding and have been trying for 10 hours without success

Take a look at com.fs.starfarer.api.impl.combat.SquallOnFireEffect in starfarer.api.zip.


Thank you, i managed to get it working, just had to use different method for getSpec. Thankfully AI knows how to code better than i do lol
Logged
Pages: 1 ... 745 746 [747] 748 749 ... 751