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 ... 511 512 [513] 514 515 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1699850 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 #7680 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
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7681 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: 1578
  • Suggestion Writer
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7682 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: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7683 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: 592
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7684 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
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7685 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: 592
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7686 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
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Great Wound

  • Captain
  • ****
  • Posts: 268
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7687 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

  • Admiral
  • *****
  • Posts: 816
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7688 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.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7689 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: 46
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7690 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: 1578
  • Suggestion Writer
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7691 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

SafariJohn

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

Use "mountTypeOverride" in the .wpn file.
Logged

dcong89

  • Ensign
  • *
  • Posts: 39
  • Work Hard Play Hard
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7693 on: July 11, 2021, 08:21:06 AM »

sorry to ask but i got this error after combat refit ship and spawnfleet derelist to test after battle it crash to desktop :

[Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ArrayIndexOutOfBoundsException: 4
java.lang.ArrayIndexOutOfBoundsException: 4
   at com.fs.starfarer.campaign.fleet.FleetMemberStatus$ShipStatus.applyDamage(Unknown Source)
   at com.fs.starfarer.campaign.fleet.FleetMemberStatus$ShipStatus.applyHullFractionDamage(Unknown Source)
   at com.fs.starfarer.campaign.fleet.FleetMemberStatus.applyHullFractionDamage(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.BattleAutoresolverPluginImpl.applyDamageToFl eetMember(BattleAutoresolverPluginImpl.java:490)
   at com.fs.starfarer.api.impl.campaign.BattleAutoresolverPluginImpl.computeOutcomeF orFleetMember(BattleAutoresolverPluginImpl.java:690)
   at com.fs.starfarer.api.impl.campaign.BattleAutoresolverPluginImpl.resolveEngageme nt(BattleAutoresolverPluginImpl.java:333)
   at com.fs.starfarer.api.impl.campaign.BattleAutoresolverPluginImpl.resolve(BattleAutoresolverPluginImpl.java:243)
   at com.fs.starfarer.campaign.fleet.Battle.doAutoresolveRound(Unknown Source)
   at com.fs.starfarer.campaign.fleet.Battle.advance(Unknown Source)
   at com.fs.starfarer.campaign.BaseLocation.advanceEvenIfPaused(Unknown Source)
   at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7694 on: July 11, 2021, 09:55:49 AM »

This looks like it has something to do with a modular ship involved in an AI-vs-AI battle on the campaign map, but beyond that it's hard to say.
Logged
Pages: 1 ... 511 512 [513] 514 515 ... 706