Bugs encountered so far

General help and technical troubleshooting. Ask for help here if you can't find an answer in the FAQ.
Post Reply
zordard
Posts: 6
Joined: Mon Feb 24, 2020 11:26 am

Re: Bugs encountered so far

Post by zordard » Wed Aug 03, 2022 9:40 am

Code: Select all

scn GenericDoorOpenedElsewhereSCRIPT

; Don't pass a '1' parameter in your terminal's activate script
; This script will not allow NPCs to use the door.
; It's intended for sneaky/hacky players to be able to use the door for gameplay purposes

ref linkedRef

;**********************

Begin onLoad

	lock 255									;in case someone forgets to lock the door in the editor

End

;**********************

Begin onActivate

	set linkedRef to getLinkedRef

	if (IsActionRef player == 1 && GetLocked == 1)
		ShowMessage GenericDoorActivatedElsewhereMsg
	elseif (IsActionRef LinkedRef == 1 && GetLocked == 1)
		unlock
		activate
	else
		activate
	endif
End
The switch is only needed once to unlock the door. After that it may be opened and closed directly. But the switch ref needs to be added to the door ref for this script.

Post Reply