Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95a is out! (03/26/21); Blog post: Skill Changes, Part 2 (07/15/21)

Pages: 1 ... 511 512 [513] 514 515 ... 532

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

passwalker

  • Commander
  • ***
  • Posts: 154
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7681 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: 31
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7682 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

Tecrys

  • Admiral
  • *****
  • Posts: 548
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7683 on: July 08, 2021, 02:08:42 PM »

How do I get a left click input?

basically, if left click do this

I've tried this monstrosity but it does nothing at all
Spoiler
Code
    public void advance(float amount, WeaponAPI weapon, List<InputEventAPI> events) {

        boolean player;
        this.SHIP = weapon.getShip();
        List<FighterWingAPI> dronewings = this.SHIP.getAllWings();

        if (player = this.SHIP == Global.getCombatEngine().getPlayerShip()) {

            for (FighterWingAPI fighterWingAPI : dronewings) {

                this.FIGHTER = fighterWingAPI.getLeader();

                if (!fighterWingAPI.getWingId().equals("omm_weaponpod_wing")) {
                    continue;
                }

                this.FIGHTER.giveCommand(ShipCommand.HOLD_FIRE, null, 0);
            }
            for (InputEventAPI event : events) {
                if (event.isLMBEvent() || event.isLMBDownEvent()) {
                    this.FIGHTER.giveCommand(ShipCommand.FIRE, null, 0);
                }}}}
[close]
Logged
Adopt a mod! (Or parts of it) I'd be happy if Biomancy Genetic Engineering found a new patron or if my little monsters appear in some form or another in someone's mod.
https://fractalsoftworks.com/forum/index.php?topic=7682.0

Yunru

  • Admiral
  • *****
  • Posts: 928
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7684 on: July 09, 2021, 02:37:56 AM »

So as to prevent this getting buried:
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?

In more recent news, I am suffering the strangest... glitch? With skin variants.
I have a skin for the onslaught, but now the only autofit options for any onslaught (base, XIV, or mine) is the standard for a regular onslaught, or the standard for my skin.

I don't see this problem with the Falcon (P) (namely the other base variants no longer showing), so am confused where it's coming from.

I do, however, see this problem with the Brawler: the only variants listed are for the base hull, and the tritachyon variant isn't listed.

EDIT: This appears to be vanilla.

Deshara

  • Admiral
  • *****
  • Posts: 1524
  • Suggestion Writer
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7685 on: July 10, 2021, 11:47:43 AM »

Im so mad I have to ask this, I literally just asked a mod to delete my comments from this thread so I dont get notifications about it constantly; Is there a way to remove tags with hullmods? trying to get a carrier to not think its a carrier, for, reasons



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?

if the sabot method doesnt work out, check out the ravager mk3 weapon from the seeker mod, its literally just a shotty
Logged
Quote from: Deshara
I cant be blamed for what I said 5 minutes ago. I was a different person back then

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19110
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7686 on: July 10, 2021, 12:46:02 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?

I think applyDamage is your best bet, regardless - especially since you'll want to damage the armor. There's a makeLookDisabled() method internally but it wasn't in the API; I've added it.

You could also ship.setHulk(true) and .setHitpoints(-1) but iirc that would not do all the necessary steps to make it *look* disabled.


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

*thumbs up*


How do I get a left click input?

basically, if left click do this

I've tried this monstrosity but it does nothing at all

There are some other issues here (you need to check that the event is not event.isConsumed()) but that aside I'm not sure this method actually exists in any interface that would be called by core code?

public void advance(float amount, WeaponAPI weapon, List<InputEventAPI> events)


BaseEveryFrameCombatPlugin has:
advance(float amount, List<InputEventAPI> events)
and
public void processInputPreCoreControls(float amount, List<InputEventAPI> events)

Note the different method signatures (parameters etc).


Im so mad I have to ask this, I literally just asked a mod to delete my comments from this thread so I dont get notifications about it constantly; Is there a way to remove tags with hullmods? trying to get a carrier to not think its a carrier, for, reasons

Hmm, "tags"? I think you don't actually mean tags but rather stuff in the "hints" column? But tags on variants are also a thing. Offhand though I don't think this is possible without affecting *every* ship of that type.
Logged

Tecrys

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

There are some other issues here (you need to check that the event is not event.isConsumed()) but that aside I'm not sure this method actually exists in any interface that would be called by core code?

public void advance(float amount, WeaponAPI weapon, List<InputEventAPI> events)


BaseEveryFrameCombatPlugin has:
advance(float amount, List<InputEventAPI> events)
and
public void processInputPreCoreControls(float amount, List<InputEventAPI> events)

Note the different method signatures (parameters etc).

Thank you for looking into it!
In the end it was suprisingly easy:
Code
                            ShipAPI player = Global.getCombatEngine().getPlayerShip();
                            if (player == this.SHIP) {
                                FIGHTER.resetDefaultAI();
                            }
                            if (Mouse.isButtonDown(0)) {
                                FIGHTER.giveCommand(ShipCommand.FIRE, mousepos, 0);           //clicky left drone shooty
                            }
Logged
Adopt a mod! (Or parts of it) I'd be happy if Biomancy Genetic Engineering found a new patron or if my little monsters appear in some form or another in someone's mod.
https://fractalsoftworks.com/forum/index.php?topic=7682.0

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19110
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7688 on: July 10, 2021, 01:21:18 PM »

Hmm - that might cause problems, for example what you wrote will trigger when the player is clicking on a menu button in the command interface or the "escape" menu.
Logged

Tecrys

  • Admiral
  • *****
  • Posts: 548
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7689 on: July 10, 2021, 01:48:19 PM »

I'll keep an eye out if it causes too many problems, I'm happy this works well enough.
Logged
Adopt a mod! (Or parts of it) I'd be happy if Biomancy Genetic Engineering found a new patron or if my little monsters appear in some form or another in someone's mod.
https://fractalsoftworks.com/forum/index.php?topic=7682.0

Great Wound

  • Lieutenant
  • **
  • Posts: 50
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7690 on: July 10, 2021, 04:46:51 PM »

Anybody know how to modify a ships OrdPoints with a hullmod?

I know the trick with using a negative value for the OP cost but that's not what I'm after.

The plan is to create a hullmod (Ordinance Storage) that increases OP by 8/12/16/20 based on hull size and reduces cargo capacity by x%.
The idea is to have the hull mod cost 4/6/8/10 so you only get access to the full value if you build it in.

Been playing around with the old getShipOrdnancePointBonus() from MutableCharacterStatsAPI but I can't seem to get it to work (used to be a character skill).

« Last Edit: July 10, 2021, 04:49:16 PM by Great Wound »
Logged

IonDragonX

  • Captain
  • ****
  • Posts: 497
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7691 on: July 10, 2021, 06:02:31 PM »

Anybody know how to modify a ships OrdPoints with a hullmod?
IDK. Whatever solution that you try, just be sure that the player can't "accidentally get a negative value of current OP. Once they are there, they have infinite OP.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19110
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7692 on: July 10, 2021, 06:26:06 PM »

The other thing to get around somehow is the player installing the hullmod, using the extra OP, and then removing it. Generally speaking the game assumes that hullmods that modify OP costs are non-removable, and breaking that assumption puts it into "unsupported by the game" territory. Not to say it couldn't be made to work somehow, perhaps!

I don't know that this specific thing is doable, though. You can adjust the costs of weapons and fighter LPCs, but not hullmods, nor the base OP available on the hull - at least, there aren't any hooks for this.
Logged

Kenshkrix

  • Ensign
  • *
  • Posts: 45
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7693 on: July 10, 2021, 08:23:36 PM »

The other thing to get around somehow is the player installing the hullmod, using the extra OP, and then removing it. Generally speaking the game assumes that hullmods that modify OP costs are non-removable, and breaking that assumption puts it into "unsupported by the game" territory. Not to say it couldn't be made to work somehow, perhaps!
I got a hacky implementation working, but it's not pretty.
Basically I have the negative OP hullmod add an invisible hullmod that re-adds the first hullmod if it's removed when the ship doesn't have enough OP available (otherwise removing both).
To make this actually matter I simply reduce the ship's speed to zero when it is 'invalid'.

It doesn't actually stop it from being exploitable, but if they're willing to ultra-slowboat around at 0 burn speed I won't bother stopping them.
Logged

Deshara

  • Admiral
  • *****
  • Posts: 1524
  • Suggestion Writer
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7694 on: July 10, 2021, 08:26:29 PM »

The other thing to get around somehow is the player installing the hullmod, using the extra OP, and then removing it.

interestingly, theres a mod hullmod in one of the 63 mods i have that adds a Scaffolding hullmod to your ship at a cost of -100 OP that gives the ship a burn rate of 0, for adding stuff & building hullmods in without having to dance around the OP limit & the burn rate thing prevents you from leaving the hullmod on. It's not helpful, i just thought it was neat & clever

ANYWAY, doesnt the a_kite have more OP than the regular kite? Is the OP boost built into the hull & not from the auxiliary hullmod?

edit: how do you make hybrid weapons? I checked in the cvs but all the hybrid weapons are just marked as a single type like normal
« Last Edit: July 11, 2021, 12:03:48 AM by Deshara »
Logged
Quote from: Deshara
I cant be blamed for what I said 5 minutes ago. I was a different person back then
Pages: 1 ... 511 512 [513] 514 515 ... 532