Jump to content

Trouble with a trigger.


Recommended Posts

I have a trigger setup where if the player walks through it.. doors are closed and a boss is enabled. But when I walk through it, nothing happens.

Event OnTriggerEnter(ObjectReference akTriggerRef)
    if GetTriggerObjectCount() == 1
        if akTriggerRef == PlayerRef
            debug.notification("I've enter the trigger.")
            ; The "Front Door" is probably open when the player steps through. So let's close it.
            if GetNthLinkedRef(2).GetOpenState() == 1
                GetNthLinkedRef(2).SetOpen(false)
                ; Have to make it seem urgent by making this door inaccessible.
                GetNthLinkedRef(2).Lock(254)
            else
                GetNthLinkedRef(2).Lock(254)
            endif
            ; The "Back Door" is probably already open. Usually is for me. Let's close it.
            if GetNthLinkedRef(3).GetOpenState() == 1
                GetNthLinkedRef(3).SetOpen(false)
                GetNthLinkedRef(3).Lock(254)
            else
                GetNthLinkedRef(3).Lock(254)
            endif
            ; This is the load door leading to the balcony. The door on the left from the "Front Door"
            GetNthLinkedRef(0).Lock(254)
            ; Now let's enable the boss.
            GetNthLinkedRef(1).Enable()
        endif
    endif
EndEvent

The load door, the only door in this room not open by default(obviously) doesn't lock either.

Edited by TummaSuklaa
Link to comment
Share on other sites

Had Lock confused with SetLockLevel. That didn't solve the problem though.

 

Edit: It all works if I make them objectreference properties, but the whole point of using GetLinkedRef() is to avoid making properties, especially for vanilla forms..

 

Edit: Had the door linked TO the trigger instead of from it.. but the problem here is, You can only link one reference from another. I need to link three doors.

Edited by TummaSuklaa
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...