Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 623 624 [625] 626 627 ... 637

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

Raif Redacted

  • Ensign
  • *
  • Posts: 22
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9360 on: November 22, 2022, 07:38:46 PM »

Is it possible to create a new category of hullmod that applies a logistics-style two-at-once rule? I want to split the logistics hullmods into two categories: Supply and Science. Basically, toss the "find us more room for people and things, and be more efficient at it!" into one pile and then "Go do science for us!" into the other, but still apply the current logistics rule to both.
Logged

vicegrip

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9361 on: November 22, 2022, 11:36:40 PM »

Terminator and Borer drones don't show up as equippable even in devmode. I would like to have a custom drone mimic this behavior but I'm not sure what's triggering it or how to invoke it. Is this something that can be done to modded content?

Audax

  • Ensign
  • *
  • Posts: 48
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9362 on: November 23, 2022, 05:27:44 AM »

How to get a ships location in combat for that frame?

Ruddygreat

  • Captain
  • ****
  • Posts: 317
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9363 on: November 23, 2022, 06:53:13 AM »

How to get a ships location in combat for that frame?

ship.getLocation();
It's a function from combatEntityAPI, shipAPI inherits it from there since it extends combatEntityAPI

Ontheheavens

  • Ensign
  • *
  • Posts: 42
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9364 on: November 24, 2022, 02:12:16 AM »

I am adding my BaseIntelPlugin-inherited class as a campaign message via
Code
void addMessage(IntelInfoPlugin intel, MessageClickAction action);
What I want to do is take the player to cargo screen each time he clicks message icon. Problem is, MessageClickAction enum has every UI tab except the one I need: cargo.
Code
	public static enum MessageClickAction {
FLEET_TAB,
REFIT_TAB,
INTEL_TAB,
CHARACTER_TAB,
INCOME_TAB,
COLONY_INFO,
INTERACTION_DIALOG,
NOTHING,
}
And even if it would have needed enum, that wouldn't solve the issue because

Code
public void actionPerformed(Object var1, Object var2) {
method in obfuscated "A" class that actually handles icon clicks does not account for cargo tab variant in its switch block:

Spoiler
Code
        if (var3 != null && var3.getAction() != null) {
            Object var7 = var3.getCustom();
            switch($SWITCH_TABLE$com$fs$starfarer$api$campaign$comm$CommMessageAPI$MessageClickAction()[var3.getAction().ordinal()]) {
            case 1:
                CampaignEngine.getInstance().getCampaignUI().showCoreUITab(CoreUITabId.FLEET, var7);
                break;
            case 2:
                if (var7 instanceof FleetMember) {
                    CampaignEngine.getInstance().getCampaignUI().showCoreUITab(CoreUITabId.REFIT, var7);
                } else {
                    CampaignEngine.getInstance().getCampaignUI().showCoreUITab(CoreUITabId.REFIT);
                }
                break;
            case 3:
                if (var7 == null) {
                    CampaignEngine.getInstance().getCampaignUI().showCoreUITab(CoreUITabId.INTEL, var3.getIntel());
                } else {
                    CampaignEngine.getInstance().getCampaignUI().showCoreUITab(CoreUITabId.INTEL, var7);
                }
                break;
            case 4:
                CampaignEngine.getInstance().getCampaignUI().showCoreUITab(CoreUITabId.CHARACTER);
                break;
            case 5:
            case 6:
                CampaignEngine.getInstance().getCampaignUI().showCoreUITab(CoreUITabId.OUTPOSTS, var7);
                break;
            case 7:
                if (var7 instanceof SectorEntityToken) {
                    InteractionDialogPlugin var6 = CampaignEngine.getInstance().getModAndPluginData().pickInteractionDialogPlugin((Object)null, (SectorEntityToken)var7);
                    if (var6 != null && !CampaignEngine.getInstance().getCampaignUI().isShowingDialog()) {
                        CampaignEngine.getInstance().getCampaignUI().showInteractionDialog(var6, (SectorEntityToken)var7);
                    }
                }
            case 8:
            }

        }
[close]

My question is: can I work around this issue to implement the desired behaviour? If not, can I request adding the option for cargo tab as MessageClickAction and expanding respective switch options, since it doesn't appear to be that much work to add?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21230
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9365 on: November 24, 2022, 05:06:52 PM »

We are re-implementing the code that calculates damage to the hit cell and surrounding cells of an ArmorGridAPI and resulting damage (without any other modifiers) to the hull for our Starsector research project but do not quite know how it works and cannot find any reference implementation or a rigorous specification for one, so I have proposed one below.  Is it exactly correct?   :D

If you're following the wiki, I believe what's there about the armor damage calculations is correct. Whether what you wrote is a correct implementation of that is a different question :)

How to change the explosion effect when a missile runs out of flight time or fizzling?

Without knowing what you mean by "effect" (visual? mechanical?) I'd say probably a script with custom code doing <whatever>?

Is it possible to create a new category of hullmod that applies a logistics-style two-at-once rule? I want to split the logistics hullmods into two categories: Supply and Science. Basically, toss the "find us more room for people and things, and be more efficient at it!" into one pile and then "Go do science for us!" into the other, but still apply the current logistics rule to both.

Take a look at BaseLogisticsHullMod, the limited-number-of-mods aspect is handled there. I think the easiest would be to keep the Logistics tag but also add tags for Supply and Science.


Terminator and Borer drones don't show up as equippable even in devmode. I would like to have a custom drone mimic this behavior but I'm not sure what's triggering it or how to invoke it. Is this something that can be done to modded content?

I think it *would* let you mount it in the campaign if you ever got your hands on it. The "edit variants" screen I think goes off it *not* having any autofit tags (like bomber5 or similar). So just copying the Terminator's tags in wing_data.csv should do it.


My question is: can I work around this issue to implement the desired behaviour? If not, can I request adding the option for cargo tab as MessageClickAction and expanding respective switch options, since it doesn't appear to be that much work to add?

I'm fairly sure this isn't supported, yeah. You may be able to open the cargo tab using CampaignUIAPI.showCoreUITab() but offhand no way to detect that the click is coming from a message comes to mind. Let me add this to my list, though, full disclosure, the list is long and this is rather low priority.
Logged

Raif Redacted

  • Ensign
  • *
  • Posts: 22
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9366 on: November 24, 2022, 07:15:52 PM »

Is it possible to create a new category of hullmod that applies a logistics-style two-at-once rule? I want to split the logistics hullmods into two categories: Supply and Science. Basically, toss the "find us more room for people and things, and be more efficient at it!" into one pile and then "Go do science for us!" into the other, but still apply the current logistics rule to both.

Take a look at BaseLogisticsHullMod, the limited-number-of-mods aspect is handled there. I think the easiest would be to keep the Logistics tag but also add tags for Supply and Science.

Ok, found that. Turns out knowing nothing about this language makes it hard to adjust it. Who would have thought?

edit: I'm figuring it out. Thanks for the reply.
« Last Edit: November 25, 2022, 03:24:02 AM by Raif Redacted »
Logged

Argentum Rhodes

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9367 on: November 24, 2022, 11:11:29 PM »

So very new to the forums. I was browsing some of the mods, and frequently play heavily modded Starsector. I was wondering if it would be possible to make a Strike Craft from like Arma Armatura land on an enemy ship. Since they have the functionality to land on friendly carriers to resupply. What made me think of this was Boarding utility from Creature. Could a strike craft if enemy shields were down land on enemy ship to do a boarding action?
Logged

Liral

  • Admiral
  • *****
  • Posts: 529
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9368 on: November 25, 2022, 01:50:43 PM »

We are re-implementing the code that calculates damage to the hit cell and surrounding cells of an ArmorGridAPI and resulting damage (without any other modifiers) to the hull for our Starsector research project but do not quite know how it works and cannot find any reference implementation or a rigorous specification for one, so I have proposed one below.  Is it exactly correct?   :D

If you're following the wiki, I believe what's there about the armor damage calculations is correct. Whether what you wrote is a correct implementation of that is a different question :)

I guess I'll verify with experiments!

vicegrip

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9369 on: November 26, 2022, 04:07:49 PM »

Thanks for answering my previous questions Alex  :)

Is there a way to access the phase cost and phase upkeep of a ship? getPhaseCloakActivationCostBonus() and     getPhaseCloakUpkeepCostBonus() seem to be stat bonuses that don't allow me to pull the base value.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21230
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9370 on: November 27, 2022, 12:11:54 PM »

So very new to the forums. I was browsing some of the mods, and frequently play heavily modded Starsector. I was wondering if it would be possible to make a Strike Craft from like Arma Armatura land on an enemy ship. Since they have the functionality to land on friendly carriers to resupply. What made me think of this was Boarding utility from Creature. Could a strike craft if enemy shields were down land on enemy ship to do a boarding action?

I honestly don't know offhand, it's the sort of thing you (or someone) would need to muck around with and see.  I suppose the answer is "yes" because it's possible to rig up entirely custom graphics for this, though - and you'd probably want to avoid the existing fighter mechanics more or less entirely. I don't think they'd help much and they could get in the way.


Is there a way to access the phase cost and phase upkeep of a ship? getPhaseCloakActivationCostBonus() and     getPhaseCloakUpkeepCostBonus() seem to be stat bonuses that don't allow me to pull the base value.

You could get the base values using ShieldSpecAPI.getPhaseCost() and getPhaseUpkeep().

The actual cost-to-use-on-this-ship values I think you could get by:
ship.getPhaseCloak().getFluxPerUse() and
ship.getPhaseCloak().getFluxPerSecond().

Don't forget to check if ship.getPhaseCloak() != null...
Logged

Ontheheavens

  • Ensign
  • *
  • Posts: 42
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9371 on: November 28, 2022, 08:44:37 AM »

Not sure if a bug or just a consequence of tampering where one does not belong, but here's what I've encountered:

I decided to swap a grid layout in ability tooltip with tables, as I could not achieve desired precision of column alignment with grids (had to use spaces for adjustments, which was not pleasant), and after making the replacement I found out that tables produce a constant sound of mousing-over whenever I do actually mouse over them. My guess was that it was due to the tooltip constantly re-rendering, and tables are created by default without said re-rendering in mind.

Precisely speaking, each created row is in some way a Button, therefore at creation it is assigned setMouseOverSound("ui_button_mouseover"). Initially I thought the UITable instance is responsible for this behaviour, and tried to call setItemsSelectable() on it, but it turned out to be false. In the end, with the help of kind Viravain and Lyravega I was able to fix this behaviour by calling setMouseOverSound(null) on each row, but it's not exactly an optimal or easiest solution.

Perhaps an argument could be added to beginTable() in TooltipMakerAPI to have the rows created be without mouse-over sound? Of course hardly any modder finds himself with an urge to shove a table in his ability tooltip, I understand, and it does seem like a bit of work to implement...
« Last Edit: November 28, 2022, 08:59:13 AM by Ontheheavens »
Logged

passwalker

  • Commander
  • ***
  • Posts: 190
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9372 on: November 28, 2022, 08:14:14 PM »

question
is planet renderer obfuscated? or i just simply can't find where it is?
i always assumed it's obfuscated, but then i stumbled on the corona renderer, which is actually exposed, so ehhhhhhhhhhh
can i have some concrete answer ?
i mean the whole thing that renders the 3d object ball with texture. can it be called somehow without creating a new sector entity? just for pure visuals?
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: 21230
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9373 on: November 29, 2022, 12:38:31 PM »

Not sure if a bug or just a consequence of tampering where one does not belong, but here's what I've encountered:

I decided to swap a grid layout in ability tooltip with tables, as I could not achieve desired precision of column alignment with grids (had to use spaces for adjustments, which was not pleasant), and after making the replacement I found out that tables produce a constant sound of mousing-over whenever I do actually mouse over them. My guess was that it was due to the tooltip constantly re-rendering, and tables are created by default without said re-rendering in mind.

Precisely speaking, each created row is in some way a Button, therefore at creation it is assigned setMouseOverSound("ui_button_mouseover"). Initially I thought the UITable instance is responsible for this behaviour, and tried to call setItemsSelectable() on it, but it turned out to be false. In the end, with the help of kind Viravain and Lyravega I was able to fix this behaviour by calling setMouseOverSound(null) on each row, but it's not exactly an optimal or easiest solution.

Perhaps an argument could be added to beginTable() in TooltipMakerAPI to have the rows created be without mouse-over sound? Of course hardly any modder finds himself with an urge to shove a table in his ability tooltip, I understand, and it does seem like a bit of work to implement...

Had a quick look - easy enough to add a check that should (I think) fixed this, but, I'm confused: if this is a tooltip of the sort that gets recreated every frame, then how are you mousing over the table without the mouse movement hiding the tooltip?

question
is planet renderer obfuscated? or i just simply can't find where it is?
i always assumed it's obfuscated, but then i stumbled on the corona renderer, which is actually exposed, so ehhhhhhhhhhh
can i have some concrete answer ?
i mean the whole thing that renders the 3d object ball with texture. can it be called somehow without creating a new sector entity? just for pure visuals?

It's obfuscated, sorry! I don't think there's an easy way to render it.
Logged

passwalker

  • Commander
  • ***
  • Posts: 190
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9374 on: November 29, 2022, 09:58:02 PM »

is there some hidden trick with fighters' engine controller?
i'm running a code to get where the fighter is trying to accelerate, but it is only returning accurate value for what seems to be the wing leader(?), and for other fighters in wing it returns 0, meaning none of the checks are ever true
Spoiler
Code
public static float getEngineAccelerationDirection(ShipAPI ship){
            float result=0;

            ShipEngineControllerAPI eng = ship.getEngineController();
            if(eng.isAccelerating()){result=ship.getFacing();}
            if(eng.isAcceleratingBackwards()){result=ship.getFacing()+180f;}
            if(eng.isStrafingLeft()){result=ship.getFacing()+90f;}
            if(eng.isStrafingRight()){result=ship.getFacing()-90f;}
            if(eng.isAccelerating()&&eng.isStrafingLeft()){result=ship.getFacing()+45f;}
            if(eng.isAccelerating()&&eng.isStrafingRight()){result=ship.getFacing()-45f;}
            if(eng.isAcceleratingBackwards()&&eng.isStrafingLeft()){result=ship.getFacing()+135f;}
            if(eng.isAcceleratingBackwards()&&eng.isStrafingRight()){result=ship.getFacing()-135f;}

            if(eng.isDecelerating()){result=VectorUtils.getFacing(ship.getVelocity())+180f;}

            return result;
        }
[close]
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.
Pages: 1 ... 623 624 [625] 626 627 ... 637