Aurawhisperer Posted December 29, 2016 Share Posted December 29, 2016 So I just hoped back into modding again with some programming experience between java, c#, and c++. It's time for me to start scripting.So I glanced at the logic that the Bethesda wiki provided for the Skyrim language. I understand, and possibly know exactly what to use; however, I am unsure how to execute it. The objective is simple: When the Player opens this door that I named as a reference: lustTrickDoor, when the player insides the house the door locks, forcing the player to kill one or all the bandits in the house to escape. Doing this requires a script triggering this event. Here's what I have planned: Scriptname LustTrap extends Objectreference function ActorOpenDoor(Actor PlayerRef)if Player == (Need to figure out the code for door) lustTrickDoor.locked();else lustTrickDoor.unlocked();endifendfunction Pretty self explanatory. Catch is, how can I implement this? Under the quest database? Or should I create a triggerbox and change the format of the script to where the player must be present? That's my issue is where to put the script, and putting it to where it can be used. Link to comment Share on other sites More sharing options...
aldwyn1111 Posted December 31, 2016 Share Posted December 31, 2016 (edited) You could use a triggerbox, but it is easier to just attach this script to the Door. Scriptname MODINITIALS_DoorScript extends ObjectReference Actor Property PlayerRef Auto ObjectReference Property lustTrickDoor Auto bool done Event OnInit() done = false EndEvent Event OnOpen(ObjectReference akActionRef) if (akActor == PlayerRef) && (done == false) lustTrickDoor.lock(true) done = true EndIf EndEvent PlayerRef defines itself automatically. lustTrickDoor is an Object Reference of the door you placed.( do NOT make a door reference type).The bool done is there so the script doesn't launch multiple times.You then need to attach a script to the bandits: Scriptname MODINITIALS_BanditScript extends ObjectReference ObjectReference Property lustTrickDoor Auto Event OnDeath(Actor akKiller) lustTrickDoor.lock(False) EndEvent Edited January 7, 2017 by aldwyn1111 Link to comment Share on other sites More sharing options...
Recommended Posts