4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
988 B

ScriptName defaultActivateLinkDoOnceSCRIPT extends objectReference
{Default script intended for triggers. When hit, they'll activate their linked reference}
import game
import debug
objectReference property OnlyActor auto
{Set this property if you want to only allow activation from a specific actor, such as the player}
bool property doOnce auto
{by default, this trigger fires once only.}
function ActivateNow(objectReference trigRef)
; Debug.Trace("Activating: " + self + " " + myLink)
objectReference myLink = getLinkedRef()
self.activate(self, true)
if MyLink != NONE
myLink.activate(self as objectReference)
endif
if doOnce == true
gotoState("allDone")
endif
endFunction
auto STATE waiting
EVENT onTriggerEnter(objectReference actronaut)
; Debug.Trace("Trigger Enter: " + actronaut)
if !onlyActor
activateNow(actronaut)
endif
if onlyActor == actronaut
activateNow(actronaut)
endif
endEVENT
endSTATE
STATE allDone
;do nothing
endSTATE