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 ... 299 300 [301] 302 303 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4500 on: April 11, 2019, 10:46:28 AM »

Rarity is just for drops - it doesn't affect fleet composition or weapon/fighter selection at all.

For weapons, higher tier means a lower chance of being available. For fighters, this isn't the case - there aren't enough fighters, i.e. there's no "Talon, but worse" and "Talon, but better" etc progression for each kind of fighter, so that didn't work very well. Instead, it just picks a couple of the available fighters for each autofit category.

com.fs.starfarer.api.impl.campaign.fleets.DefaultFleetInflater.java is a good place to look for the details; if you want specific behavior with regard to rarity etc, writing a custom one is probably the way to go. See also: CampaignPlugin.pickFleetInflater().
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4501 on: April 11, 2019, 11:20:27 AM »

Alright, gotcha; thanks for the heads up then.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4502 on: April 12, 2019, 01:50:32 PM »

Is there any way to get weapon Impact via script? I don't see it in any of the methods on WeaponAPI, WeaponSpecAPI, DamagingProjectileAPI, or DamageAPI, but I might just have missed it.

Also curious about weapon spread stats -- the only one that seems accessible is current spread via getCurrSpread() but it'd be nice to be able to get min, max, per shot, and decay from the WeaponAPI as well.
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: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4503 on: April 12, 2019, 04:20:44 PM »

Is there any way to get weapon Impact via script? I don't see it in any of the methods on WeaponAPI, WeaponSpecAPI, DamagingProjectileAPI, or DamageAPI, but I might just have missed it.

There isn't, no. (And it's somewhat non-trivial to expose as it's part of an internal ProjectileSpec class that's not currently exposed in the API at all. Like, it's not hard, but it's also not just me adding a method to an existing interface.)

Also curious about weapon spread stats -- the only one that seems accessible is current spread via getCurrSpread() but it'd be nice to be able to get min, max, per shot, and decay from the WeaponAPI as well.

Ah, let me add methods for these to WeaponSpecAPI - done.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4504 on: April 12, 2019, 06:07:43 PM »

Is there any way to get weapon Impact via script? I don't see it in any of the methods on WeaponAPI, WeaponSpecAPI, DamagingProjectileAPI, or DamageAPI, but I might just have missed it.

There isn't, no. (And it's somewhat non-trivial to expose as it's part of an internal ProjectileSpec class that's not currently exposed in the API at all. Like, it's not hard, but it's also not just me adding a method to an existing interface.)

Also curious about weapon spread stats -- the only one that seems accessible is current spread via getCurrSpread() but it'd be nice to be able to get min, max, per shot, and decay from the WeaponAPI as well.

Ah, let me add methods for these to WeaponSpecAPI - done.

Ah, I see. Thanks for adding the spread methods! Out of curiosity, will those values just be readable, or did you add .set methods too?  :D
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: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4505 on: April 12, 2019, 06:13:45 PM »

With the set methods, yes.

I'm curious - is anyone actually using setXXX() methods in WeaponSpecAPI? Those change the values for all weapons of that type, not just the weapon in question. ... ahhh, right, there's WeaponAPI.ensureClonedSpec() for this; never mind.
Logged

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4506 on: April 15, 2019, 07:08:44 AM »

Are there schematics for projectile trail plugins? What do I need to make one besides graphics of trails, vector utis.
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4507 on: April 15, 2019, 09:14:25 AM »

For basic projectile trails you just need to load the texture in your settings.json and duplicate trail_data.csv from MagicLib to your mod with your projectile entry. There are more detailed instructions in the original file.

For advanced stuff, you can take a look at the Trail manager script in MagicLib for pointers.
Logged
 

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4508 on: April 17, 2019, 12:50:00 AM »

On the topic of weapon-related API methods, is there a way to get the burst duration of a beam? Either the "burst size" value or the actual burst duration including chargedown. WeaponSpecAPI.getBurstSize() returns an int, and DamageAPI.getDpsDuration() seems to be a dynamic counter for the actual amount of time since the last damage tick or something to that effect, and neither of those seem to work.

EDIT: Wait, I found it! DerivedWeaponStatsAPI.getBurstFireDuration() works. I'll leave this here so others might see it if they're likewise confused.
« Last Edit: April 17, 2019, 02:07:50 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: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4509 on: April 17, 2019, 09:23:10 AM »

Let me add getBurstDuration() to WeaponSpecAPI, all the same.
Logged

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4510 on: April 17, 2019, 11:21:53 AM »

Where/how do I control if a faction requires a commission to access military markets?
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4511 on: April 21, 2019, 01:21:51 PM »

As a bit of a followup to my earlier question are there any particular steps I would need to do in order to get an extension of the DefaultFleetInflater set up, or is it more likely that I'll just have to put in a complete replacement of the class?

E: To be more clear I currently have an extension of the DefaultFleetInflater written as a plugin, which I decided on because I was hoping to avoid having to replace the entire Inflater. It replaces the public void inflate section with some modifications to try and adjust the fighter spawning. However, as it currently doesn't seem to be doing anything and trying to directly load the plugin causes a crash, I figure I've gotten things mixed up somewhere.
« Last Edit: April 21, 2019, 01:51:38 PM by MShadowy »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4512 on: April 21, 2019, 03:56:36 PM »

Once you've got your inflater written, you'll want to either:

1)

YourInflater inflater = new YourInflater();
// do whatever config is necessary
fleet.setInflater(inflater);

or

2)

Override this method:
public PluginPick<FleetInflater> pickFleetInflater(CampaignFleetAPI fleet, Object params)

In a CampaignPlugin.

Either one will ultimately assign your inflater to the fleet. The first method works if you're spawning the fleet yourself; the second method can work then too, but would also work if you wanted to change the inflater for a fleet being spawned by, say, core vanilla code - without changing said code to set the inflater directly. Does this make sense/clear things up?
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4513 on: April 21, 2019, 04:28:59 PM »

so presumably something like this then?

Code: java
    @Override
    public PluginPick<FleetInflater> pickFleetInflater(CampaignFleetAPI fleet, Object params) {
        DefaultFleetInflaterParams p = null;
        return new PluginPick<FleetInflater>(new MS_FleetInflaterPlugin(p), CampaignPlugin.PickPriority.MOD_SET);
    }
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4514 on: April 21, 2019, 04:45:05 PM »

This would set your inflater to be used for all fleets - so, if that's what you want, yes.

Also "params" is going to be an instance DefaultFleetInflaterParams, so you probably want to cast that and pass that in, like so:

Code: java
if (params instanceof DefaultFleetInflaterParams) {
    DefaultFleetInflaterParams p = (DefaultFleetInflaterParams) params; 
    return new PluginPick<FleetInflater>(new MS_FleetInflaterPlugin(p), CampaignPlugin.PickPriority.MOD_SET); 
}
return null;

The "instanceof" check being necessary just in case a mod uses a different kind of inflater with a different params class.
Logged
Pages: 1 ... 299 300 [301] 302 303 ... 706