CirnoNeuron Posted November 23, 2023 Share Posted November 23, 2023 I am trying to make a poison that slowly takes health away and at a percentage of health remaining, triggers a secondary effect. I am guessing that I want to look at scripts for this, problem is, I don't know scripting very well. if anyone knows if this is possible and how it is done, I would appreciate a point in the right direction. Link to comment Share on other sites More sharing options...
dylbill Posted November 23, 2023 Share Posted November 23, 2023 Here's a script that will do this: Scriptname SlowPosionEffectScript extends ActiveMagicEffect {Damage the target's' sActorValue by DamageAmount every UpdateInterval while this effect is active} String Property sActorValue Auto Float Property DamageAmount Auto Float Property UpdateInterval Auto Actor Target Event OnEffectStart(Actor akTarget, Actor akCaster) Target = akTarget ;save target actor so it can be used in other events in this script Target.DamageActorValue(sActorValue, DamageAmount) RegisterForSingleUpdate(UpdateInterval) EndEvent Event OnUpdate() Target.DamageActorValue(sActorValue, DamageAmount) RegisterForSingleUpdate(UpdateInterval) ;Update is automatically unregistered when the effect ends. EndEvent Compile the script, attach it to a magic effect then set the properties in the properties tab in the creation kit. Example, if you set sActorValue to "Health", DamageAmount to 2.0 and UpdateInterval to 1.0 it will damage the target's health by 2.0 every second while the effect is active. Link to comment Share on other sites More sharing options...
Recommended Posts