faffman Posted June 14, 2017 Share Posted June 14, 2017 So first of all, I'm not a modder myself, and certainly no scripter. I received this script from ymf331 after a little request on the Mod Requests forum, but there's something amiss in it, and he told me to ask if anyone here could tell what it is. With Ordinator, you can place bear traps, which is kind of what my current build centers around. But even if you have the Light Foot perk, which appears to be same as in vanilla, you can still take damage from your own bear traps (and in my case die everytime it happens, because I haven't invested in much health). So this script he made was supposed to make the player safe from their own bear traps, if they have the Light Foot perk, which I do, but it didn't work, and ymf331 couldn't try it out himself for reasons. So can anyone tell where the issue is? Many thanks. Scriptname ORD_BearTrap_Activator_Script extends ObjectReference; -----ORD_TrapHitBase_Script HitBaseBool Property ORD_StartOpen = true AutoFloat Property ORD_LockpickingDamageMult AutoPerk Property ORD_Loc50_BigGameHunter_Perk_50_OrdASISExclude AutoPerk Property ORD_Sne50_LightFoot_Perk_50_WasLightFoot_OrdASISExclude AutoActor Property PlayerRef Auto; -----Event onReset()GoToState("Closed")Self.Reset()EndEvent; -----Event OnLoad()HitBase = (Self as objectReference) as ORD_TrapHitBase_ScriptHitBase.ORD_Damage = Math.Ceiling(Game.GetPlayer().GetActorValue("Lockpicking") * ORD_LockpickingDamageMult)Utility.Wait(0.50)If ORD_StartOpen; PlayAnimation("StartOpen")PlayAnimationAndWait("Reset01","Trans02")GoToState("Open")EndIfEndEvent; -----Auto State ClosedEvent OnBeginState()If PlayerRef.HasPerk(ORD_Loc50_BigGameHunter_Perk_50_OrdASISExclude)BlockActivation(true)RegisterForSingleUpdate(2.5)EndIfEndEventEvent OnEndState()UnregisterForUpdate()EndEventEvent OnTriggerEnter(objectReference TriggerRef)EndEventEvent OnActivate(objectReference akTriggerRef)PlayAnimationAndWait("Reset01","Trans02")GoToState("Open")EndEventEvent OnUpdate()PlayAnimationAndWait("Reset01","Trans02")BlockActivation(false)GoToState("Open")EndEventEndState; -----State OpenEvent OnBeginState()HitBase.GoToState("CanHit")EndEventEvent OnTriggerEnter(objectReference TriggerRef)If (TriggerRef as Actor).HasPerk(ORD_Sne50_LightFoot_Perk_50_WasLightFoot_OrdASISExclude) Return ElsePlayAnimation("Trigger01")HitBase.GoToState("CanHit")GoToState("Busy")WaitForAnimationEvent("Trans01")HitBase.GoToState("CannotHit")GoToState("Closed")EndIfEndEventEvent OnActivate(objectReference TriggerRef)GoToState("Busy")HitBase.GoToState("CannotHit")PlayAnimationAndWait("Trigger01","Trans01")GoToState("Closed")EndEventEndState; -----State BusyEvent OnBeginState()EndEventEndState; -----Event OnTriggerEnter(objectReference akTriggerRef)EndEventEvent OnActivate(objectReference akTriggerRef)EndEvent; ----- Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 15, 2017 Share Posted June 15, 2017 Make sure you fill the property for the light foot perk with the correct data. Without assigning any data the property will return with a null value and the HasPerk function will fail thus passing on into triggering the trap. Link to comment Share on other sites More sharing options...
ymf331 Posted June 15, 2017 Share Posted June 15, 2017 (edited) i had the activators in a new plugin with the property added, but it looked like the mod author changed this from the vanilla script. Event OnBeginState() HitBase.GoToState("CanHit") <---- added this EndEvent so i just took it out. i figure there's probably a reason, so maybe now something else don't work but idk. hopefully it's gravy. Edited June 15, 2017 by ymf331 Link to comment Share on other sites More sharing options...
Recommended Posts