Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 24 25 [26] 27 28 ... 42

Author Topic: API request thread (please read OP before posting!)  (Read 219076 times)

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #375 on: July 04, 2019, 12:16:29 AM »

A method, of some sort, to adjust built-in weapons on a ship post-generation...

Oh my goodness all of my yes.  :D
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #376 on: July 12, 2019, 11:15:59 PM »

DamagingProjectileAPIs should always return their ShipAPIs via getSource().   They don't when they have certain values enabled, like BALLISTIC_AS_BEAM, RAY_FIGHTER (not sure which interferes). 

Took me forever to backtrack through "this old stuff worked fine, why doesn't it work now" things to finally find this.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #377 on: July 13, 2019, 01:37:27 PM »

DamagingProjectileAPI setDamageAmount() doesn't appear to function as expected.  The values I'm getting are absurdly high.  Like, order-of-magnitude larger than I'm expecting. 

This also appears to happen with spawned projectiles who've had it set via MIRV splits; when we get their damage values through code, it's wrong.  The expected in-game behaviors (vs. shields, Armor, etc.) all work correctly, though.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #378 on: July 13, 2019, 04:39:17 PM »

The above appears to be related. 

Also, MIRV'd projectiles get their hitpoint variable from their parents; there's no such thing as an "armored MIRV" with weak, PD-able shots.  I guess it's time to (finally) rewrite my old custom MIRV stuff into a generic system, lol.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #379 on: July 13, 2019, 07:39:17 PM »

Also, MIRV'd projectiles get their hitpoint variable from their parents; there's no such thing as an "armored MIRV" with weak, PD-able shots.

Umm. What?

From Hurricane MIRV projectile file:

Code
...
"behaviorSpec":{"behavior":"MIRV",
   "splitRange":1000,
   "minTimeToSplit":2,
   "canSplitEarly":true,
   "splitSound":"hurricane_mirv_fire",
   "numShots":11,
   "damage":500,
   "impact":5,
   "emp":0,
   "damageType":HIGH_EXPLOSIVE,
-->"hitpoints":250,
   "arc":180,
   "arcOffset":180,
   "evenSpread":true,
   "spreadSpeed":200,
   "spreadSpeedRange":50,
   "projectileSpec":"mirv_warhead",
   ...
"hitpoints":250
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #380 on: July 14, 2019, 12:18:30 AM »

Oh, dear, I wasn't using that version of it, figures ::)

I'll have to test whether populating that field in the JSON fixes the other observed oddness, too.

[EDIT]Hitpoints appears to work, damage, nope.[/EDIT]
« Last Edit: July 14, 2019, 12:20:50 AM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #381 on: July 19, 2019, 06:29:28 PM »

Just a couple of quick responses to a few cherry-picked items:

ShipEngineAPI:
  • float getAngle()
  • float getBaseLength()

You can use ShipEngineAPI.getEngineSlot() to get access to this data.


int FleetParamsV3.maxSize

More control over max AI fleet size, so it doesn't have to be either "config value" (i.e. 30) or "unlimited" (which with a sufficiently large fleet can lead to the bad old days of having to kill 100 frigates).

Added this in.


[EDIT]Hitpoints appears to work, damage, nope.[/EDIT]

Damage seems to work for me, but that's getting a bit off-topic to this thread.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #382 on: July 21, 2019, 12:50:18 PM »

Request: a way to get a collection of the FleetMembers selected for deployment in the deployment window. Something like one of these:
Code
Global.getCombatEngine().getSelectedForDeployment()
myCombatFleetManager.getSelectedForDeployment()
Admittedly the use cases are limited, but this information is currently very difficult to obtain.

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #383 on: August 15, 2019, 08:29:45 PM »

I'd like to disable the player's ability to construct/upgrade/downgrade/scrap structures/industries in certain circumstances. I think I really just need it to disable the UIs. I guess that would go in MarketAPI?

Code: java
boolean canBuildUpgrade()
setCanBuildUpgrade(boolean)

boolean canDowngradeShutDown()
setCanDowngradeShutDown(boolean)
EDIT
Realized build/upgrade and downgrade/shut down should be separate toggles.
« Last Edit: August 15, 2019, 09:32:14 PM by SafariJohn »
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #384 on: September 11, 2019, 01:40:15 PM »

I could really use something along the lines of
public SoundAPI playSound(String id, float pitch, float volume, Vector2f loc, Vector2f vel, float fadeIn, float fadeOut)
when making miniguns for example, because the current full second fade in and out are quite disrupting.
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #385 on: September 11, 2019, 02:15:41 PM »

I could really use something along the lines of
public SoundAPI playSound(String id, float pitch, float volume, Vector2f loc, Vector2f vel, float fadeIn, float fadeOut)
when making miniguns for example, because the current full second fade in and out are quite disrupting.

Hmm? That seems strange, afaik there's no fade in/out for playSound() sounds, though there's a half-second fade in/out for playLoop(). playSound() also returns a SoundAPI, so you can manage the volume directly via SoundAPI.setVolume().
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #386 on: September 11, 2019, 02:23:24 PM »

my bad, copied the wrong line, I was indeed talking about the loop
public void playLoop(String id, Object playingEntity, float pitch, float volume, Vector2f loc, Vector2f vel, float fadeIn, float fadeOut)
I'll try cutting the sound if that works for loops too.
[edit]
Yeah that doesn't seems to be possible. I tried to lower the volume, to move the loop, to replace it with a silence without success
[edit2]
HA! I found a way to cut a loop using a "SimpleEntity" from LazyLib as a source. Still, a custom fadeIn and Fadeout would be best. I'm also noticing that playSound and playLoop have very different spatialisation while using the same location.
« Last Edit: September 11, 2019, 02:51:40 PM by Tartiflette »
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #387 on: September 11, 2019, 02:51:01 PM »

Yeah, the loop will always take a half a second to fade in/out...

Added to SoundPlayerAPI:
void playLoop(String id, Object playingEntity, float pitch, float volume, Vector2f loc, Vector2f vel, float fadeIn, float fadeOut);


The vanilla approach is to play the loop in combination with another sound so there's a "hit" in response to whatever in-game action starting, and then the loop takes over. That generally seems like it might work better? Since it seems like it'd be trickier to have a loop that 1) loops nicely and 2) has a nice-feeling "hit" on startup, but, in any case, adding the above method wasn't particularly involved.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #388 on: September 13, 2019, 07:45:38 AM »

CargoPickerListener:
  • isIllegal(CargoStackAPI stack)
  • getIllegalText(CargoStackAPI stack)
I want to be able to disable items in a cargo picker listener, while still showing them with an explanation.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #389 on: September 13, 2019, 11:23:33 AM »

MutableShipStatsAPI:
  • MutableStat getBeamSpeedMult();

Dunno if this is already a planned thing or not, but it'd be real useful.  :)
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 ... 24 25 [26] 27 28 ... 42