Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 301 302 [303] 304 305 ... 710

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

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4530 on: May 01, 2019, 12:26:13 AM »

Unfortunately not a great time for me to delve into this right now, what with .1 being very soon.
No worries. Trust me; I don't want to slow you down!

it should be "its" rather than "it's" in all three places.
Thanks! Wow, I must make that mistake a lot...

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4531 on: May 02, 2019, 11:01:17 AM »

How does EmpResistance on MissileAPIs work?  ???

Code: java
	/**
* Number of times a missile will ignore being hit by an system EMP *arc* (not emp damage) instead of flaming out.
* @param empResistance
*/
void setEmpResistance(int empResistance);
int getEmpResistance();
void decrEMPResistance();

I mean, how to use the methods is pretty self-explanatory, but what I'm wondering is:
1) Do missiles have any "innate" EmpResistance? Is it based on HP?
2) Will arcs created by spawnEmpArc or spawnEmpArcPierceShields always flame out a missile (regardless of damage/EMP damage) if they hit one with no EmpResistance remaining?
3) Is there any relation to arc damage or arc EMP damage in any part of this?
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4532 on: May 02, 2019, 11:37:30 AM »

No/yes/no :)

Basically it's a (currently) modding-only thing that you can use to have missiles ignore a fixed number of EMP arc hits.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4533 on: May 02, 2019, 11:49:02 AM »

Ah okay, awesome. I was kinda imagining it'd be tied to HP, like missiles would get one EmpResistance for every 400 HP or something. This is much simpler, thanks!
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4534 on: May 07, 2019, 09:29:31 AM »

If two mods use the same key for a list of strings in the "custom" section of a faction's JSON, will the lists merge when using getCustom() in FactionAPI?

For example:
Code: JSON
# mod A
"custom":{
   "ListKey":[
      "item1"
   ]
}
and

Code: JSON
# mod B
"custom":{
   "ListKey":[
      "item2",
      "item3"
   ]
}
results in "ListKey":["item1", "item2", "item3]?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4535 on: May 07, 2019, 10:07:55 AM »

I believe so, but I'm not 100% sure.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4536 on: May 07, 2019, 01:43:53 PM »

Can someone confirm if this error is from the core game, and not my mod?
Game crashed during combat (missile heavy)

Code
266937 [Thread-4] INFO  org.histidine.chatter.ChatterDataManager  - Assigning character default to officer  
266937 [Thread-4] INFO  org.histidine.chatter.ChatterDataManager  - Assigning character badass to officer 
373840 [Thread-8] INFO  sound.public  - Cleaning up music with id [Battle - Accelerated World.ogg]
373938 [Thread-10] INFO  sound.public  - Creating streaming player for music with id [Battle - Accelerated World.ogg]
373944 [Thread-10] INFO  sound.null  - Playing music with id [Battle - Accelerated World.ogg]
374465 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.C.oooO.o00000(Unknown Source)
at com.fs.starfarer.combat.ai.missile.MirvAI.checkSplit(Unknown Source)
at com.fs.starfarer.combat.ai.missile.MirvAI.advance(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.combat.CombatState.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$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4537 on: May 07, 2019, 02:00:46 PM »

This *may* be caused by a missing "splitSound" from a MIRV missile's behaviorSpec.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4538 on: May 08, 2019, 06:59:47 AM »

Hmm... I know it's possible to make a shipsystem that boosts energy or ballistic


but is it possible to make one that boosts only PD weapons? Or failing that, only small ones?
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4539 on: May 08, 2019, 07:35:40 AM »

Another question:

Sometimes when I mouse over a fleet I get a crash and this in the errorlog. Seems to happen also with fleets that aren't form my mod, so I assume this is a core game issue?

Code
1328127 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.api.plugins.impl.CoreAutofitPlugin.fitFighters(CoreAutofitPlugin.java:907)
at com.fs.starfarer.api.plugins.impl.CoreAutofitPlugin.doFit(CoreAutofitPlugin.java:380)
at com.fs.starfarer.api.impl.campaign.fleets.DefaultFleetInflater.inflate(DefaultFleetInflater.java:395)
at com.fs.starfarer.campaign.fleet.CampaignFleet.inflateIfNeeded(Unknown Source)
at com.fs.starfarer.ui.impl.StandardTooltipV2.createFleetTooltip(Unknown Source)
at com.fs.starfarer.campaign.C.super(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$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4540 on: May 08, 2019, 11:43:02 AM »

Would anyone here know how to get a script reference from a .json? I think all the examples in Starsector vanilla are buried in the obfuscated APIs, or at least, all the ones I thought to check.

Specifically, I want to call whatever script is referenced in a string in a .json file. Like how shipsystem JSONs have
Code: java
"aiScript":"data.shipsystems.scripts.ai.VayraFluxOverdriveAI",
How do I write java to call the script at a dynamic string address? I can load values, lists, and maps from a JSON fine but I have no idea how to load a script from one.  :-\


EDIT: LazyWizard, that beautiful titan of intellect, answered my question on the Discord. For anyone else struggling with this who finds this post, they linked their Console Commands source as an example: https://bitbucket.org/LazyWizard/console-commands/src/ca2384da59e8508b6dd8914fe8f0a62da32ce349/src/main/java/org/lazywizard/console/CommandStore.java#lines-76
« Last Edit: May 08, 2019, 11:46:19 AM by Vayra »
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4541 on: May 08, 2019, 12:07:30 PM »

An alternate, simpler but more limited solution:

1) Put plugin in the "plugins" section in settings.json, i.e.:
"plugins":{
    "aiScript":"data.shipsystems.scripts.ai.VayraFluxOverdriveAI",
}
2) Call Global.getSettings().getNewPluginInstance("aiScript");

Under the hood this does much the same thing as LW's code. The limitation is, of course, that for this to work, the config needs to be in the "plugins" section of the settings file.


Hmm... I know it's possible to make a shipsystem that boosts energy or ballistic

but is it possible to make one that boosts only PD weapons? Or failing that, only small ones?

Stats-wise, yeah. As far as the visual glow, I don't think so - the current "make it glow" code is limited to weapon mount types, i.e. energy/ballistic/missile.

Sometimes when I mouse over a fleet I get a crash and this in the errorlog. Seems to happen also with fleets that aren't form my mod, so I assume this is a core game issue?

Fairly sure this is an issue with invalid fighter wing ids being available to a faction, but not 100%. If you want to make dig in a bit, you can open up:

com.fs.starfarer.api.plugins.impl.CoreAutofitPlugin.fitFighters(CoreAutofitPlugin.java:907)

To line 907 and see what it says; might help point us in the right direction.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4542 on: May 08, 2019, 09:47:27 PM »

How do you make a fleet drop extra credits during salvage?
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4543 on: May 08, 2019, 10:37:18 PM »

How do you make a fleet drop extra credits during salvage?
I know it's possible to do that by overriding com.fs.starfarer.api.impl.campaign.FleetEncounterContextPlugin.getCreditsLooted(), but that has a lot of downsides.

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4544 on: May 08, 2019, 10:43:54 PM »

How do you make a fleet drop extra credits during salvage?

I am also interested in the answer to this
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it
Pages: 1 ... 301 302 [303] 304 305 ... 710