![]()
|
|
Related Issues: 29132
And only now do I remember that I don't have permission to edit my own tasks, when I see that I forgot to set the category, and made no fewer than three typos. Oh well.
Been a few years, but I did work out a good way to conditionalize effects to take place while actively taking radiation damage (since this isn't a conditionalizable effect at the engine level):
Importantly it's event-driven, and keeps external calls to the actor the effect is on to an absolute minimum. Before I'd made that, the best way I found anyone else doing it (or discussing it, I don't remember) was by polling accumulated rad damage, which is a poor implementation.
Anyway you'd put that on a scripted magic effect, which toggles an AV based on whether radiation damage has been taken in the last second, and that AV can be conditionalized in another magic effect to turn on an AP speed buff or whatever.
I think I was using it for an effect that increased movement speed and AP regen while taking radiation in an unfinished/unreleased mod, and it the effect toggle was accurate and felt responsive in my testing.
If anyone wants to take a crack at it, that script with some very minor modification (e.g. to script name) and a few minutes worth of CK work could be used to fix the effect to match the in-game description. It took me an embarrassingly long time to come to a solution for this that didn't totally suck, so that's the hard part done, really.
ScriptName idek:ipa:RadDamageMonitor extends ActiveMagicEffect Actor Property thisActor Auto Hidden ActorValue Property AVtoSet Auto Const bool active Event OnInit() thisActor = GetTargetActor() RegisterForRadiationDamageEvent(thisActor) EndEvent Event OnRadiationDamage(ObjectReference akTarget, bool abIngested) StartTimer(1.0, 0) StartTimer(1.25, 1) if (active == false) EnableAV() endif EndEvent Event OnTimer(int aiTimerID) if (aiTimerID == 1) ; timeout, probably not taking rad damage anymore DisableAV() endif RegisterForRadiationDamageEvent(thisActor) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) DisableAV() EndEvent Function EnableAV() active = true thisActor.SetValue(AVtoSet, 1) ; Util.Trace(self + " Toggled Rad Damage AV " + AVtoSet + " ON." ) EndFunction Function DisableAV() active = false thisActor.SetValue(AVtoSet, 0) ; Util.Trace(self + " Toggled Rad Damage AV " + AVtoSet + " OFF." ) EndFunction
Importantly it's event-driven, and keeps external calls to the actor the effect is on to an absolute minimum. Before I'd made that, the best way I found anyone else doing it (or discussing it, I don't remember) was by polling accumulated rad damage, which is a poor implementation.
Anyway you'd put that on a scripted magic effect, which toggles an AV based on whether radiation damage has been taken in the last second, and that AV can be conditionalized in another magic effect to turn on an AP speed buff or whatever.
I think I was using it for an effect that increased movement speed and AP regen while taking radiation in an unfinished/unreleased mod, and it the effect toggle was accurate and felt responsive in my testing.
If anyone wants to take a crack at it, that script with some very minor modification (e.g. to script name) and a few minutes worth of CK work could be used to fix the effect to match the in-game description. It took me an embarrassingly long time to come to a solution for this that didn't totally suck, so that's the hard part done, really.
thanks, I was wondering this is not your mod, correct?
https://www.nexusmods.com/fallout4/mods/45952?tab=description
https://www.nexusmods.com/fallout4/mods/45952?tab=description
Not mine, no.
If that works it's a (much) better solution than what I described, but I swear I tried it and it only seemed to work for damage from food, weapons, etc, and not radiation hazards. Was about 3 years ago though, so memory isn't clear anymore. Quite likely it does work and I'd made an oversight (not that it really mattered since my implementation was only ever used in a half-finished, unreleased mod).
A condition is used, which checks if a magic effect applied to the character has the keyword DamageTypeRadiation.
If that works it's a (much) better solution than what I described, but I swear I tried it and it only seemed to work for damage from food, weapons, etc, and not radiation hazards. Was about 3 years ago though, so memory isn't clear anymore. Quite likely it does work and I'd made an oversight (not that it really mattered since my implementation was only ever used in a half-finished, unreleased mod).
Comment #5 Feb 14, 2023 9:58 pm
Edited by EyeDeck on Feb 14, 2023 10:02 pm
Showing Comments 1 - 5 of 5