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: Simulator Enhancements (03/13/24)

Pages: 1 ... 510 511 [512] 513 514 ... 706

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

Tecrys

  • Admiral
  • *****
  • Posts: 592
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7665 on: July 06, 2021, 01:09:28 PM »

Ah, as far as I know, that's not possible. If it's a proper weapon that can be fired, the arcs are just a UI thing.

okay, instead I would like to remove it from the weapons group but I'm having a hell of trouble with that.
here's my script so far: https://pastebin.com/JbXBJNwT

"droneslot" has to be deleted from the weapon group it is in, the other one is a decorative and doesn't draw weapon arcs.
I got really far with this script, I'd really like to finish it
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7666 on: July 06, 2021, 02:41:22 PM »

okay, instead I would like to remove it from the weapons group but I'm having a hell of trouble with that.
here's my script so far: https://pastebin.com/JbXBJNwT

"droneslot" has to be deleted from the weapon group it is in, the other one is a decorative and doesn't draw weapon arcs.
I got really far with this script, I'd really like to finish it

This line:

Code
mutableShipStatsAPI.getVariant().clearSlot("droneslot");

 - Might be your problem. That requires a slot id and it looks like you are passing in the weapon id from what I can see though its not 100% clear since you are hardcoding it by id. You can get the slot id from the relevant WeaponAPI I believe. Otherwise, seeing the .variant you are dealing with would be helpful.

*EDIT*

Ah nvm looking at it more closely it does seem to be a slot id at least in that you are using it for other parts of the script as a slot id. The only other thing I could think of is if you know the index of the weapon group you could try something like:

Code
stats.getVariant().getWeaponGroups().get(index).removeSlot("droneslot");

And then add it back in as needed.

Iterating through all seven groups and removing any of that slot you find is also possible though if you aren't sure of what the index would be. Other than that, I don't know, sorry.
« Last Edit: July 06, 2021, 03:04:20 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7667 on: July 06, 2021, 04:04:27 PM »

Just real quick:
ShipAPI.removeWeaponFromGroups(WeaponAPI weapon)
May be of interest.
Logged

Tecrys

  • Admiral
  • *****
  • Posts: 592
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7668 on: July 06, 2021, 04:05:52 PM »

Thank you! That helped quite a lot.
The game adds the weapons back in again but at least I can make sure they are not in group 1.

Just real quick:
ShipAPI.removeWeaponFromGroups(WeaponAPI weapon)
May be of interest.

Oh nice! I'll try that. Thank you
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

6chad.noirlee9

  • Captain
  • ****
  • Posts: 368
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7669 on: July 06, 2021, 04:07:02 PM »

is it possible to have three way (or more) battles in starsector?
Logged
edit: edit: maybe were just falling with style LOL.  make a bubble, make the space in front of it smaller and just fall forward

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7670 on: July 06, 2021, 04:21:43 PM »

 ::)
is it possible to have three way (or more) battles in starsector?

Technically maybe, with some ugly hackery and entirely custom ship AI and accepting that some things will be very rough around the edges. For practical purposes, though, it's just about a hard "no"...
Logged

6chad.noirlee9

  • Captain
  • ****
  • Posts: 368
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7671 on: July 06, 2021, 06:59:29 PM »

ha thats precisely what id expected
Logged
edit: edit: maybe were just falling with style LOL.  make a bubble, make the space in front of it smaller and just fall forward

MeinGott

  • Ensign
  • *
  • Posts: 35
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7672 on: July 07, 2021, 11:01:37 AM »

Hello there; is there documentation or even a brief post about upgrading mods from 91 to 95? Im sure im pretty late for the party so excuse me and thank you
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7674 on: July 07, 2021, 11:11:06 AM »

Hello there; is there documentation or even a brief post about upgrading mods from 91 to 95? Im sure im pretty late for the party so excuse me and thank you


You can have a look at 0.9.1a to 0.95a API diff: https://github.com/jaghaimo/starsector-api/commit/a8eb5000982512433042aa1f820b08d83e81fd4b
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7675 on: July 07, 2021, 01:33:51 PM »

I'm trying to create a shotgun-esque weapon by basically having a sabot rocket that immediately detonates into it's second stage. It works really well, both in producing loose visual debris and all the shots being created at once.

The problem I'm having is if an enemy isn't in range, the first stage never detonates ruining the illusion. Worse still, if it comes within range of an enemy before it flames out, it'll detonate to its second stage, effectively doubling the range.

Is there a way to make sure it either detonates immediately regardless (preference), or flame out if it doesn't immediately find an enemy?

Edit: On a different topic, how do identically named jsons interact? Does one straight override the other, or is it more as with CSVs?

Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7676 on: July 07, 2021, 02:00:28 PM »

I'm trying to create a shotgun-esque weapon by basically having a sabot rocket that immediately detonates into it's second stage. It works really well, both in producing loose visual debris and all the shots being created at once.

The problem I'm having is if an enemy isn't in range, the first stage never detonates ruining the illusion. Worse still, if it comes within range of an enemy before it flames out, it'll detonate to its second stage, effectively doubling the range.

Is there a way to make sure it either detonates immediately regardless (preference), or flame out if it doesn't immediately find an enemy?

Take a peek at Star Federation (FTL fanmod).
https://fractalsoftworks.com/forum/index.php?topic=19115.0

Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7678 on: July 07, 2021, 11:14:39 PM »

what's the most reliable way to turn a ship into a hulk? i know applyDamage works, but it's unpredictable. is there some boolean toggle that can be flipped to say that this ship is no alive?
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.

briansd9

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7679 on: July 08, 2021, 02:11:34 AM »

Is there a way to determine in a BaseEveryFrameCombatPlugin if a ship has retreated from battle?

ShipAPI.isRetreating() returns true if a ship intends to retreat, but it can be destroyed or the battle can end before the retreat is completed.

[Edit] Got it - monitoring CombatEngineAPI.getFleetManager(FleetSide.ENEMY).getRetreatedCopy() for changes instead.

what's the most reliable way to turn a ship into a hulk? i know applyDamage works, but it's unpredictable. is there some boolean toggle that can be flipped to say that this ship is no alive?
ShipAPI.setHulk()... haven't tried it myself but it looks like the right one
« Last Edit: July 08, 2021, 07:56:17 AM by briansd9 »
Logged
Pages: 1 ... 510 511 [512] 513 514 ... 706