Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 657 658 [659] 660 661 ... 710

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

float

  • Captain
  • ****
  • Posts: 269
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9870 on: May 12, 2023, 12:30:35 PM »

I noticed that there's now ProjectileWeaponSpecAPI.setRequiresFullCharge, but I'm not sure how to use it. I assume it means that you can fire a weapon at partial charge with partial strength, but after setting this to false, I don't notice any change in the weapon's behavior. I'm still unable to fire any weapons at partial charge.

Does anyone have any idea how to get this feature to work?
Logged

Argonaut

  • Lieutenant
  • **
  • Posts: 57
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9871 on: May 13, 2023, 08:55:13 AM »

I'm sure my problem is very basic.
I setup a project in VSCode with jdk 1.7 and i'm running an empty class, but i get the following issue:


My only library dependencies are taken from Starsector's core folder, and even leaving EFModPlugin to only contain an empty class still causes the same error.
My mod_info.JSON contains:
Code
    "jars":["jars/EF.jar"],
    "modPlugin":"data/scripts/EFModPlugin"
As stupid as it looks, i have no clue what the problem could be after looking at it for a long time, so any help would be appreciated.

Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9872 on: May 13, 2023, 09:07:28 AM »

it needs to be data.scripts.EFModPlugin

Tocks13

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9873 on: May 13, 2023, 09:28:58 AM »

Before diving into the documentation and trying to find clues in the Documentation:
Is there a "simple" way to hook into the conversation dialog to execute a method with the last written text as parameter whenever something is written in the dialog, without writing custom dialog for everything?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9874 on: May 13, 2023, 09:37:37 AM »

I'm trying to refresh the industry screen without having to exit/enter the entire dialogue, something that the new buttons seem to do on press, but doesn't appear to be accessible from the outside.
Any way to get at that?

Hmm, I don't think so, sorry!


How can I determine to which ship a Terminator Drone belongs?  No API method I have tried yields this answer.

I think the only way is to use ship.getWing() before the drone is converted into a missile and hold on to that info. At least, that's the only thing that comes to mind.


how do you set a weapon to "rest" in the center of it's firing arc?
I'm doing some stuff using the DEM drone & a semi-custom drone AI (using a script to control it's movement), but the weapons seemingly always want to point at 0,0 when I've not given them a target through the fire shipCommand

and an addendum to this now that I'm messing with normal fighters as well; is there a way to stop a fighter's AI from moving it without replacing the whole AI?
I'm giving commands to a fighter in an EveryFrameCombatPlugin but the AI still seems to be fighting against them (If I set thew AI to null they'll go exactly where they're told to, otherwise they drift & bounce wierdly)

They should just do this automatically after some time; it's hard to say what you might be doing that's overriding that, hmm.

For fighters: I guess you could set its location directly?

I noticed that there's now ProjectileWeaponSpecAPI.setRequiresFullCharge, but I'm not sure how to use it. I assume it means that you can fire a weapon at partial charge with partial strength, but after setting this to false, I don't notice any change in the weapon's behavior. I'm still unable to fire any weapons at partial charge.

Does anyone have any idea how to get this feature to work?

Ah, this shouldn't have been exposed; it's a holdover from when there was a different type of weapon - "pulse" weapons that required the button to be held down to charge and fired on release. It was too fiddly and was abandoned.


Before diving into the documentation and trying to find clues in the Documentation:
Is there a "simple" way to hook into the conversation dialog to execute a method with the last written text as parameter whenever something is written in the dialog, without writing custom dialog for everything?

Hmm, not that I can think of. That'd require the text panel to have a listener for that sort of thing and that doesn't exist. (Or I suppose some kind of code injection...)
Logged

Argonaut

  • Lieutenant
  • **
  • Posts: 57
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9875 on: May 13, 2023, 09:39:06 AM »

it needs to be data.scripts.EFModPlugin

Where, in the package name? If i do that it won't even compile and the IDE reports an error... EFModPlugin is a class in data/scripts after all
« Last Edit: May 13, 2023, 09:48:17 AM by Argonaut »
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9876 on: May 13, 2023, 10:38:29 AM »

it needs to be data.scripts.EFModPlugin

Where, in the package name? If i do that it won't even compile and the IDE reports an error... EFModPlugin is a class in data/scripts after all

ah yeah, I probably should've been more specific- replace the slashes in the modPlugin field w/ dots & it should work.
paths inside compiled .jar files are represented as dots instead of slashes (no idea why tbh), think like how you call a method with "blah.Methodname"

Tocks13

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9877 on: May 13, 2023, 11:10:37 AM »



Before diving into the documentation and trying to find clues in the Documentation:
Is there a "simple" way to hook into the conversation dialog to execute a method with the last written text as parameter whenever something is written in the dialog, without writing custom dialog for everything?

Hmm, not that I can think of. That'd require the text panel to have a listener for that sort of thing and that doesn't exist. (Or I suppose some kind of code injection...)

Too bad.
Since I'm too impatient/lazy to read all the lore etc, which I don't want to miss, I was hoping to make it easier on me by hooking a text to speech system into the Dialog.
But it seems like that is going to be harder/more work intensive, than hoped, if at all possible.

Is it possible to overwrite standard dialog scripts to enhance them?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9878 on: May 13, 2023, 03:56:50 PM »

Ah! There's actually a setting in data/config/settings.json that could be useful for this:
writeInteractionTextToFile
The comment around there tells where the text file is located.
Logged

Tocks13

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9879 on: May 13, 2023, 05:09:53 PM »

Ah! There's actually a setting in data/config/settings.json that could be useful for this:
writeInteractionTextToFile
The comment around there tells where the text file is located.

Uh, that sounds promising.
Have to look how and when it writes it to the file, but that makes it a little bit easier, though still a little bit whacky.
But thanks for the Infos so far!
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9880 on: May 14, 2023, 04:37:23 AM »

Does MEMORY_KEY_ALLOW_PLAYER_BATTLE_JOIN_TOFF actually do anything?
Logged

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9881 on: May 14, 2023, 06:59:47 PM »

How does    ShipAPI.setLayer(CombatEngineLayers layer)  work with modules?

it looks like it works but modules will still render beneath the weapons of the parent ship? Is that expected behavior?
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9882 on: May 14, 2023, 07:07:17 PM »

BaseHubMission.triggerSpawnShipGraveyard seems to have an NPE (stacktrace from Java 17, but also happens on 8 )

Code: java
        triggerSpawnShipGraveyard(Factions.REMNANTS, 2, 2, loc);
        triggerSpawnShipGraveyard(Factions.PERSEAN, 4, 6, loc);
385638 [Thread-2] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException: Cannot read field "ship" because "this.data" is null
java.lang.NullPointerException: Cannot read field "ship" because "this.data" is null
        at com.fs.starfarer.api.impl.campaign.DerelictShipEntityPlugin.readResolve(DerelictShipEntityPlugin.java:347) ~[starfarer.api.jar:?]
        at com.fs.starfarer.api.impl.campaign.DerelictShipEntityPlugin.init(DerelictShipEntityPlugin.java:245) ~[starfarer.api.jar:?]
        at com.fs.starfarer.campaign.CustomCampaignEntity.<init>(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.campaign.BaseLocation.addCustomEntity(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.api.impl.campaign.procgen.themes.BaseThemeGenerator.addSalvage Entity(BaseThemeGenerator.java:1495) ~[starfarer.api.jar:?]
        at com.fs.starfarer.api.impl.campaign.missions.hub.BaseHubMission.spawnDerelict(BaseHubMission.java:2743) ~[starfarer.api.jar:?]
        at com.fs.starfarer.api.impl.campaign.missions.hub.BaseHubMission.spawnDerelict(BaseHubMission.java:2731) ~[starfarer.api.jar:?]
        at com.fs.starfarer.api.impl.campaign.missions.hub.BaseHubMission.spawnShipGraveya rd(BaseHubMission.java:2771) ~[starfarer.api.jar:?]
        at com.fs.starfarer.api.impl.campaign.missions.hub.HubMissionWithTriggers$SpawnShipGraveyardAction.doAction(HubMissionWithTriggers.java:285) ~[starfarer.api.jar:?]
        at com.fs.starfarer.api.impl.campaign.missions.hub.BaseHubMission.runTriggers(BaseHubMission.java:1165) ~[starfarer.api.jar:?]

EDIT: Worked around by overriding spawnShipGraveyard to set the DerelictType for each ship.
« Last Edit: May 15, 2023, 03:50:23 AM by Histidine »
Logged

alaricdragon

  • Commander
  • ***
  • Posts: 162
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9883 on: May 16, 2023, 03:55:53 PM »

hey all, its me again. with 3 more questions:
1) how do i add a special item to a sub-markets cargo?
2) how do i save data to a special item? (so the data on it is save persistent)
3) is it possible to change the credit cost of special items on a per stack basis?
thanks all for responding to my silly questions again.
Logged

SwagMcTwerkster

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9884 on: May 17, 2023, 09:19:22 AM »

Is beam weapons hit strength aka. the "half beam DPS" a 0.5 multiplier or a divisor of 2, and if it is a divisor does the calculation happen before or after damage types are considered(Graviton, HIL)?

Because, with HIL for example, 500*0.5*2 and 500/2*2 are different from 500*2/2 if the order of calculation is from left to right.


Nevermind, just had a four hour brainfart, sorry.
« Last Edit: May 17, 2023, 11:41:34 AM by SwagMcTwerkster »
Logged
Pages: 1 ... 657 658 [659] 660 661 ... 710