Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: Trylobot on February 11, 2013, 12:29:23 AM

Title: [SOLVED] Disabling the Zero-Flux Speed Bonus
Post by: Trylobot on February 11, 2013, 12:29:23 AM

UPDATE 2013-2-15: Alex has stated that the following code can apply a "piloted ship" bonus to a ship:

FleetMemberAPI fm = api.addToFleet(FleetSide.PLAYER, "hammerhead_Balanced", FleetMemberType.SHIP, "ISS Black Star", true, CrewXPLevel.VETERAN);
fm.getCaptain().getStats().setSkillLevel("helmsmanship", 10);


This closes my question. Thanks Alex!



Is it possible to disable the zero-flux speed bonus? I don't care whether it would have to be per-ship or globally (for a total conversion mod) because this bonus ruins my target balance numbers. My previous solution was to cover the landscape in nebulae, but that has the now-unwanted side effect of causing a friction against my ships' velocities, so that solution is suddenly untenable.

Anyone got ideas on this?
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: silentstormpt on February 11, 2013, 06:48:19 AM
I know you can check if the boost is on, maybe using a plugin and reduce the max speed when the boost activates?

Besides that, i cant see a way to deactivate it
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: Alex on February 11, 2013, 07:12:41 PM
If you have an EveryFrameCombatPlugin iterate through every ship and getFluxTracker().increaseFlux(0.001f, false); on each, that ought to do it. Or some number small enough to be otherwise irrelevant.
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: K-64 on February 11, 2013, 07:18:59 PM
Won't that still apply the bonus if the perk is chosen? Although I'm assuming that Trylo is wanting it removed entirely for all circumstances here, so could be entirely irrelevant.
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: Alex on February 11, 2013, 07:24:30 PM
Won't that still apply the bonus if the perk is chosen? Although I'm assuming that Trylo is wanting it removed entirely for all circumstances here, so could be entirely irrelevant.

Yeah, good point as far as that being something to watch out for. But I would imagine that perk would get removed, with it being a TC, assuming skills are anywhere near like they are in vanilla in the first place.
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: zakastra on February 12, 2013, 02:00:49 AM
I'm working on a concept of a space station that exists mostly in P space with a heavily shielded and armed "anchor" that exists in real space (Essentialy a gunned up turret) the station is supposed to immobile, with an unlimited range teleport on a several minute cooldown, but of course the 0 flux boost breaks this
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: Wyvern on February 14, 2013, 10:03:25 AM
Actually... given that there's a skill perk that increases the zero flux speed bonus (and turn bonus) - might it be possible to give out a sort of anti-perk that simply reduced the bonus to zero?

If necessary, you could invent a "placeholder campaign effects" skill, that simply granted such an anti-perk at level one - and then make sure that character creation always gave you one point in that skill.  A bit clunky, but certainly doable.
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: EnderNerdcore on February 14, 2013, 11:06:19 AM
I'm working on a concept of a space station that exists mostly in P space with a heavily shielded and armed "anchor" that exists in real space (Essentialy a gunned up turret) the station is supposed to immobile, with an unlimited range teleport on a several minute cooldown, but of course the 0 flux boost breaks this
Wouldn't an acceleration of 0 make it so it is unable to move despite any flux bonus?
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: zakastra on February 14, 2013, 01:43:57 PM
Would that nullify its ability to turn or is that separate? if so that would be great, although it would mean that if nudged you would drift endlessly
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: EnderNerdcore on February 14, 2013, 02:33:59 PM
Would that nullify its ability to turn or is that separate? if so that would be great, although it would mean that if nudged you would drift endlessly
There is a separate turn acceleration variable.

That said, wouldn't you want it to move if "nudged" hard enough? Just set the mass extremely high, and then only fast-moving capital ships would make it move (in a noticeable amount)
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: Trylobot on February 14, 2013, 04:38:27 PM
Do any perks apply during missions? Or, can they be made to?
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: Alex on February 14, 2013, 10:48:46 PM
Do any perks apply during missions? Or, can they be made to?

Yep. Something like this:

Code
FleetMemberAPI fm = api.addToFleet(FleetSide.PLAYER, "hammerhead_Balanced", FleetMemberType.SHIP, "ISS Black Star", true, CrewXPLevel.VETERAN);
fm.getCaptain().getStats().setSkillLevel("helmsmanship", 10);

Just verified that this works, rather than just looking like it should work but actually resulting in an NPE :)

This should work for any ship, not just the flagship, and not just on the player's side.
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: Wyvern on February 15, 2013, 12:05:47 PM
Oh hey.  That's an interesting example.  Does it work for skill benefits like +ordnance points?  I'd like to make some missions match up a bit better with the game experience, and being able to say "This mission has hull mods & available ordnance points as if the admiral had XYZ aptitudes & skills" would be nice.
Title: Re: Disabling the Zero-Flux Speed Bonus
Post by: Alex on February 15, 2013, 12:18:31 PM
No, that doesn't work. There's no concept of "admiral" in the mission fleets. ... maybe there should be. I'll see if I can make some time to take a look at that at some point :)

So, as of now, any skill with "fleetwide" effects won't work like this, either, since those only work for the admiral. Only "piloted ship" effects will apply.