Randomized buff effects?

This doesn't exist in any of the current ability/buff entities, does anyone know if it's possible to create an ability to use a buff type with several possible effects? For example, AbilityIonBlast calls on BuffIonBlast, which applies 8 modifiers to disable everything - would it be possible to make it disable weapons OR engines OR abilities (33% chance on each)?

My gut tells me no, but you never know :P
4,531 views 9 replies
Reply #1 Top
Off the top of my head

you could make it work by creating individual buffs for each effect and then putting them into the AbilityIonBlast or more likely the BuffIonBlast as bufftypes under an "InstantActionTriggerType" of "OnChance"....

Basically you would just need to fill the BuffIonBlast with varrations on....

buffInstantActionType "ApplyBuffToSelf"
instantActionTriggerType "OnChance"
buffApplyChance
Level:0 0.0100000
Level:1 0.0100000
Level:2 0.0100000
buffType "BuffCaptureNeutralEntity"
effectInfo
effectAttachInfo
attachType "Invalid"
smallEffectName ""
largeEffectName ""
soundID ""

NOTE: thats just an example i took from a planet assaulting troop ship im testing out. but thats the general idea
Reply #2 Top
Thanks for the quick reply, going to have to try it :)
Reply #3 Top
So I looked in the entity file for the Vasari Carrier's fighter phasing ability for the OnChance syntax to double check and the suggested EMPBlast files to see how buffs call over buffs, tried to mimic the Ion Blast to do the same, and Sins doesn't want to launch :P As soon as I remove the 'trigger' entity file for the buff, it starts up fine.

Here's what I got (relevant lines only):

AbilityIonBlast.entity:

buffInstantActionType "ApplyBuffToTargetWithTravel"
instantActionTriggerType "AlwaysPerform"
buffType "BuffIonBlastTrigger"
targetFilter
numOwnerships 1
ownership "Friendly"
numObjects 3
object "CapitalShip"
object "Frigate"
object "PlanetModule"
numConstraints 0
range
Level:0 7000.000000
Level:1 7000.000000
Level:2 7000.000000

BuffIonBlastTrigger.entity:

numInstantActions 1
instantAction
buffInstantActionType "ApplyBuffToTarget"
instantActionTriggerType "OnChance"
buffApplyChance
Level:0 0.330000
Level:1 0.330000
Level:2 0.330000
bufftype "BuffIonBlastEngines"
targetFilter
numOwnerships 1
ownership "Friendly"
numObjects 3
object "CapitalShip"
object "Frigate"
object "PlanetModule"
numConstraints 0
range
Level:0 7000.000000
Level:1 7000.000000
Level:2 7000.000000
effectInfo
effectAttachInfo
attachType "Invalid"
smallEffectName ""
largeEffectName ""
soundID ""
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 1
finishCondition
finishConditionType "TimeElapsed"
time
Level:0 3.000000
Level:1 5.000000
Level:2 7.000000

BuffIonBlastEngines.entity:

numInstantActions 2
instantAction
buffInstantActionType "PlayPersistantAttachedEffect"
instantActionTriggerType "OnDelay"
delayTime 0.000000
effectInfo
effectAttachInfo
attachType "Above"
smallEffectName "CapitalBuff_IonDisableSmall"
largeEffectName "CapitalBuff_IonDisableLarge"
soundID ""
instantAction
buffInstantActionType "DoInterrupt"
instantActionTriggerType "OnDelay"
delayTime 0.000000
numPeriodicActions 0
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 2
entityBoolModifier "DisableLinearEngines"
entityBoolModifier "DisableAngularEngines"
numFinishConditions 0

Nothing jumps out as being way off :( The Ability file calls on the trigget buff (I set it to friendly targets for easier testing), the trigger tells the buff to apply to the target, and 33% of the time to cast the IonBlastEngines buff (syntax borrowed from how EMPBlastSpawn calls sub-buff) and to expire in 3/5/7 seconds. The IonBlastEngines buff calls for the effect to be placed on target, interrupt target's actions, and disable actions.

The trigger file is what's causing the game to crash on launch - I tried setting the chance to 1.000000, tried doing it OnDelay 0, using the same effects as the actual ion blast, nada..

I'm stumped.
Reply #4 Top
Bump

(the great annatar needs your help!)
Reply #5 Top
Well, Craig says it's certainly possible, so gotta figure out why it doesn't like my trigger file so much X-(
Reply #6 Top
At a guess, and something i probably should have pointed out, but its possible that the "OnChance" trigger only works with "PeriodicActions"
Reply #7 Top
Well the weird thing is, at one point I removed OnChance entirely and set it to OnDelay of 0, and it still gave a runtime error on game start :(

PeriodicActions seems like it only works for passives, it basically sounds like for a constantly applied buff, every one in a while it does another buff. So I could make a passive "EMP field" projection that would have a chance to disable something every so often, but that's not quite the same :P
Reply #8 Top
PeriodActions can be used on non-passives, because its literally just a way of repeating actions, ie it uses a "buff" and then X seconds later uses it again, for however many times you have set it to.

something i have just noticed is that there are no finish conditions for BuffIonBlastEngines, which might be causing the crashes (Im not sure i havent tried creating a buff with out finish conditions)
Reply #9 Top
PeriodActions can be used on non-passives, because its literally just a way of repeating actions, ie it uses a "buff" and then X seconds later uses it again, for however many times you have set it to.
End of quote


I realized that after I posted :P I might be able to use it as a workaround, will have to try it when I get home.

something i have just noticed is that there are no finish conditions for BuffIonBlastEngines, which might be causing the crashes (Im not sure i havent tried creating a buff with out finish conditions)
End of quote


I had it with the same finish condition as the default BuffIonBlast at one point, and that didn't do anything. I'll try it again later just to be sure. My logic was that the "trigger" is the main buff that ends in 3/5/7 seconds for the appropriate level, and it just calls a sub-buff to apply the actual effect, but when the trigger expires so does the sub-buff.

Like Foogsie said on IRC last night, it'd be nice to be able to debug a bit to see where it goes wrong :P I don't mind the trial and error approach, but guessing as to what's wrong can be a little frustrating :)