It depends how the buff type is set up. Best way is to look at an in game file that uses that buff type for reference. Personally I use Zombie's Eclipse plugin that would tell me if I miss a block like that, but that's probably overkill just for basic problem like this.
Hrrm. The buff that I'd copies as a template for the one I'm using didn't have it, which was the reason I didn't include it in the first place. I guess the Dev.exe will probably be what'll help me there, though I might look for Zombie's Eclipse if its updated for Rebellion.
I do not believe you can change Deceleration except the default value in the entity file in the ship. Thus just using the Acceleration modifier (its called linear thrust or something like that) should work.
I had been hoping that there was some way to affect deceleration and acceleration, though independently, and its kinda a shame that the default value is all it will ever be.
I remember looking at the Guardian's repulse ability some time during diplomacy in the entity files, and seeing it as being able to set the minimum and maximum speeds for a ship. If one were to leave the maximum as a positive number, and the minimum as a negative, when decelerating would a ship continue to do so until it hit that negative value, or only until it became stationary?
There is RemoveBuffOfType or AddOrRemoveBuffOfType (I'm not using quotes so they might not be spelled exactly that way). I think RemoveBuffOfType Removes all buffs of a given type though, while AddOrRemoves adds the buff if present and removes it if not, so you could only have 1 stack of it. I know this was a pain to several other modders as well...
Slightly problematic, though since the buffs I'd want to remove would be simple stat editing debuffs I could probably counter that by applying an opposite buff with equivalent stat boosts to what the number of buffs I'd like to 'remove' would add to right?
And just to check, the way Sins works out that sort of stuff for its bonuses/detriments is that the value = (1+[Bonus Percent as Decimal])/(1+Detriment Percent as Decimal]) Correct?
If so, this does mean that were I to apply a 20% debuff, then a 20% buff to said stat, it would end up still being equivalent to its normal value, as opposed to its normal value -20%, then 20% of that new value added on [I.E: 100 - 20% = 80. 20% of 80 = 16. Therefore 80+20% = 96 instead of 100 if a 20% debuff is applied then a 20% buff whilst the debuff is still in effect].
I have made an ability like this, but if its very important it works... imperfectly. I set it up so that a buff is applied to a target on weapons fire. The buffs lasts for a few seconds, and has an "ApplyBuffToLastSpawner" set to trigger OnOwnerDeath, with a stacking limit of 1 and PriortizeNewBuffs. This ensures only the last target to fire on this ship has the buff, and if the ship dies it applies a buff back to the ship that kills it. Problem is, if you have other ships not using the ability, if they fire at the same time the ship with the ability will get the kill, even if the other killed it. Also if the ship was killed by an ability it might also misfire.
Thankfully the system I'll be trying to implement this for isn't too important, so it shouldn't matter if it misfire's occasionally. Thanks for explaining how to make such a system though.
A few more questions I've come up with:
- Is there a way to apply a buff on weapon impact, as opposed to weapon firing? If not, does weapon firing take into account the chance to miss, or does that only end up being a glorified DPS reduction?
- Is there an easy way to have a buff apply different effects to ships of different races, or would I have to take a roundabout route like applying a buff from production factories and construction ships that would place a 'marker' buff that allocates each ship to the race that created it?
- Is there any way to get fighter movement to even remotely work on Capital Ships?
Also, after the 1.04 update I've started to receive a couple of new errors that I'm not entirely sure how to deal with:
[Assert @ C:\Projects\P4\SinsRebellion\main\CodeSource\Engine/String/StringLibrary.h(83)
result == 1]
Which only occurs to the game when I attempt to run it with my mod enabled, or attempt to enable my mod whilst running the game, which rules out my original thoughts that Rebellion might have updated incorrectly [Like it had previously, and deleted several files that I had to copy across from Harpo's reference files to get it working] seeing as it says its an engine error of some sort, or seems to imply such.
The other error is:
[Entity Ref not found: RESEARCHSUBJECT_SHIPBOARD_LABS_2]
Which also only occurs when I attempt to load my mod. The thing is, I cannot think of any files I have that would need to reference it in my mod. I have one TEC capital ship entity file, a bunch of planet files, three abilities, 6 buffs and the entity.manifest.
I would assume that the entity.manifest is where this error will come from, though I'm not sure whether its saying that I don't have that entity referenced in the entity.manifest, or if its in the entity.manifest but not in the game. Some clarification on that would be much appreciated.
Again, thanks for any help.