Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 479 480 [481] 482 483 ... 710

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

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7200 on: April 03, 2021, 12:37:10 AM »

So what if, for example, I want to modify the XIV variant of the onslaught only (not the regular one), for example I want to add a built in mode for the xiv variant only, how can I do that?

I checked the .ship files and I only found the base versions of said ships, I couldn't find the xiv variants in . ship files.
cuz they are a .skin file

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7201 on: April 03, 2021, 08:28:21 PM »

Great, thanks Alex!

Now I'm trying to make a custom bounty where the target is an existing route-spawned fleet.

- How do I get the instance of MilitaryCustomBounty, to call setTestMode on it?
(edit: oh, right, I can just wipe the existing creator list and leave only my own)

- To make this work, I'm forcing the route to spawn the fleet, via route.getSpawner().spawnFleet(route) and route.getActiveFleet().setNoAutoDespawn(true).
I set noAutoDespawn back to null in notifyCompleted and notifyFailed.
But what if I never take the mission, does the fleet stick around forever? Hmm, I'll try not setting the auto despawn until the mission is actually accepted.

EDIT: RIP, spawnFleet doesn't actually set the route's active fleet and there's no way to manually assign it...
Guess this idea goes back on the shelf.
« Last Edit: April 03, 2021, 09:28:50 PM by Histidine »
Logged

boeduur

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7202 on: April 04, 2021, 06:53:13 AM »

Hi all,

Had a comb through the settings.json to see where the Range is set on a tracking fleet's interference with the Players interactions (salvage and survey, etc). Couldn't find it in there.

Any ideas?

Thanks
Logged

Golde

  • Lieutenant
  • **
  • Posts: 61
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7203 on: April 04, 2021, 05:00:50 PM »

There is now a jitter / glow effect on energy weapon offsets related to the EW mastery skill (at high flux levels) that could be useful for creating other effects. I dissected the skill.java but there doesn't seem to be anything responsible for triggering the effect.

Has anyone else looked into this?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7204 on: April 04, 2021, 06:03:28 PM »

Great, thanks Alex!

Now I'm trying to make a custom bounty where the target is an existing route-spawned fleet.

- How do I get the instance of MilitaryCustomBounty, to call setTestMode on it?
(edit: oh, right, I can just wipe the existing creator list and leave only my own)

- To make this work, I'm forcing the route to spawn the fleet, via route.getSpawner().spawnFleet(route) and route.getActiveFleet().setNoAutoDespawn(true).
I set noAutoDespawn back to null in notifyCompleted and notifyFailed.
But what if I never take the mission, does the fleet stick around forever? Hmm, I'll try not setting the auto despawn until the mission is actually accepted.

EDIT: RIP, spawnFleet doesn't actually set the route's active fleet and there's no way to manually assign it...
Guess this idea goes back on the shelf.

Ah - let me make a note to make force-spawning things like this possible.



Hi all,

Had a comb through the settings.json to see where the Range is set on a tracking fleet's interference with the Players interactions (salvage and survey, etc). Couldn't find it in there.

Any ideas?

Thanks

That's actually hardcoded in a few places. Good news is I've got a TODO item to make tiny fleets not interfere with these kinds of operations!
Logged

boeduur

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7205 on: April 04, 2021, 08:45:55 PM »

Ah! Awesome. Thanks, Alex
Logged

Ithiloneth

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7206 on: April 05, 2021, 06:42:21 AM »

Update 2:

We have a winner and some wisdom!
When testing the behavior of a .child script, deploy the entire ship.

Working code:
Code
if (child.getFluxTracker().getFluxLevel() >= 0.75) {
            child.giveCommand(ShipCommand.VENT_FLUX, null, 0);
        }

Update:
Turns out my testing methodology might have been a factor here; I launched the simluator with just the module and not the entire ship. I am now able to get it to vent; but it seems to do so much too frequently...

I am trying to make a ship with modules force the modules to vent their flux when the modules reach a certain level of flux (preferred if the value is a percentage of MaxFlux rather than a static value of current flux.
E.x 0.5 vs 350.

I have tried a few options but so far no luck.
This is my first edit to a mod where I am actively adding code; I don't really know Java so likely that is the problem here.
Been trying to use the API to the best of my ability ^^

Based on what's in there getFluxLevel seems the best option but I can't get it to work.

Code
getFluxLevel
float getFluxLevel()
Returns:
    flux level, from 0 to 1


Code
if (child.getFluxTracker().getCurrFlux() > 0.75f) {
            child.giveCommand(ShipCommand.VENT_FLUX, null, 0);
        }

Code
if (child.getFluxTracker().getFluxLevel() >= 0.75) {
            child.giveCommand(ShipCommand.VENT_FLUX, null, 0);
        }

Thoughts?

My reason for doing this is that I've found that the modules will not, generally speaking, vent flux when they need to - if an enemy ship has the module under it's guns. Since the module is not providing a shield it venting is however not a problem - it should vent so it can keep firing.
« Last Edit: April 05, 2021, 07:13:36 AM by Ithiloneth »
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7207 on: April 05, 2021, 09:57:29 PM »

Code
market.getPlanetEntity().getTypeId();
and
Code
market.getPlanetEntity().setTypeId("water");
seems to be doing nothing for me. Everytime I run the code on any of the planets down. The planet still returns whatever it was instead of making it identify as a water planet (just the tooltip itself doesn't seem to show). I have called market.getPlanetEntity().applySpecChanges() after doing my code which updates the graphic change perfectly.

For example this is my code
Code
    @Override
    public void onNewGameAfterEconomyLoad() {
    MarketAPI market = Global.getSector().getEconomy().getMarket("chitagupta");
    market.getPlanetEntity().setTypeId("water");
}
All it has to do is just make Chiptagupta see itself as a water world... but instead (there are other code at work that are changing its visuals, but I care more about why is it still identifying itself as a barren type)

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7208 on: April 06, 2021, 10:34:16 AM »

Is there any way to set Ship AI to a fighter or frigate? I see there is a setShipAI method but I am unsure of what I should pass in as a parameter, if any.
Also, is there any way to check if the player ship is being autopiloted but not with the UI up? (I'm assuming    isUIAutopilotOn() is explicitly when the command UI is visible?)
« Last Edit: April 07, 2021, 12:41:33 AM by shoi »
Logged

Reviire

  • Ensign
  • *
  • Posts: 12
  • Remi, Remi, my Kingdom for Remi
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7209 on: April 06, 2021, 05:43:36 PM »

Hi there. I want to replace the behaviour in the BattleCreationPluginImpl class, but I'm not sure how to do that (in a way that'll work when giving people the mod to put in their mod folder). I need help figuring out how to override or replace a vanilla class.
Logged

Quote from: Gizogin on 17-03-2012, 14:59:01
Quote
I think I've been sigged more times as a result of my comments in this thread than I have in most of my other activity on these forums. 

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7210 on: April 06, 2021, 09:44:16 PM »

@Reviire:  Unfortunately, you can only replace that class via CoreCampaignPluginImpl... which you can replace via SectorGen.  In short, it will work, but it will basically break compatibility with anything else that depends on either thing being <some special way>.



Meanwhile... I'm having a very odd problem with DamageDealtModifier.modifyDamageDealt().  I've been converting an EveryFrameScript over to a DamageListener and the behavior's just kind of odd; I'm wondering if there's something special going on under the hood here.

The issue is with Burst Beams; they're behaving like they're doing the full damage every frame, rather than the full damage * the amount of time every frame.

However, I'm also having problems with the DamageAPI setDamage() function; when I give it a number, and the param is instanceof BeamAPI... it seems to set the final damage to zero. Sooooo... yeah.  Can't get Burst Beams to behave themselves, lol.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7211 on: April 06, 2021, 11:47:45 PM »

OK, I think I figured this Beam thing out. 

Beams... are weird. 

They give a "correct" result to the DamageListener on the first frame, but after that, zero! 

So... Burst Beams, because they're doing that first-frame behavior a lot, are giving one value, and it's really high (the way I'm computing it right now); continuous beams are doing something entirely else.  I'll post code when I have something that actually works correctly; the head-scratching behavior finally makes some sense now that I've tested a few things.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Reviire

  • Ensign
  • *
  • Posts: 12
  • Remi, Remi, my Kingdom for Remi
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7212 on: April 07, 2021, 12:48:39 AM »

@Reviire:  Unfortunately, you can only replace that class via CoreCampaignPluginImpl... which you can replace via SectorGen.  In short, it will work, but it will basically break compatibility with anything else that depends on either thing being <some special way>.
How do I do that exactly? That's another thing I'm not entirely clear on.
Logged

Quote from: Gizogin on 17-03-2012, 14:59:01
Quote
I think I've been sigged more times as a result of my comments in this thread than I have in most of my other activity on these forums. 

Venomfx

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7213 on: April 07, 2021, 03:31:18 AM »

Where does getAllowZeroFluxAtAnyLevel get checked for zero flux boost? I'm trying to understand and tinker with the helmsmanship elite bonus.
Logged

Twogs

  • Lieutenant
  • **
  • Posts: 76
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7214 on: April 07, 2021, 07:05:44 AM »

How do you make fighters spawn from defined launch bays instead of just in the middle of the ship?

I defined two launchbays, yet the fighter wings just spawn at the center of the ship and ignore them completely
Logged
Pages: 1 ... 479 480 [481] 482 483 ... 710