How to create a basic lock door script?

Post » Fri Dec 30, 2016 4:09 am

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();

endif

endfunction


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.

User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Return to V - Skyrim