Jump to content

Switch/Door issue but not really XD


DaemonGrin

Recommended Posts

Ok so I generally do a setopenstate script for opening doors from other locations but I recently saw a video (Seddons) where he setup a door and switch no scripting just the door is linked to the switch with the switch as an activate parent. Now I have set this up with an electrical switch and my jaildoor. It doesn't work...Does this work?? Seddon never showed it ingame working so I have no clue. If it does work why doesn't mine? does it hate me? how can I make it like it? XD

 

Thanks,

Geoff

Link to comment
Share on other sites

I liked this and hoped I could get it working because the animation on the electrical switch would play (the lever would go up and down when activated) but with a script it doesn't. If this door with activate parent switch setup doesn't work how can I get the scripted switch to play the animations when activated?

 

Thanks,

Geoff

Link to comment
Share on other sites

I've used activate parent for traps, but never to open a door so I don't know if there's a way to make it work or not. For opening, enabling, etc., I make the object to be activated the linked ref of the switch. For the switch to open a door and play the switch animation, just make sure you call Activate on the switch itself at the end of the OnActivate block. If it's a one-time-only switch, put a doOnce variable in the script and call SetOpenState on the first activation. Making it reusable is a tiny bit more complicated, mainly because the values for GetOpenState and SetOpenState are different. This example won't let you use the switch while the door is in the middle of opening or closing, only when it is actually open or closed:

SCN SwitchOpenDoorSCRIPT

REF TheDoorREF

BEGIN OnActivate

    set TheDoorREF to GetLinkedRef
    if TheDoorREF.GetOpenState == 3 ; closed
        TheDoorREF.setOpenState 1
    elseif TheDoorREF.GetOpenState == 1 ; open
        TheDoorREF.setOpenState 0
    endif ; ignore 2 (opening) and 4 (closing)
    activate

END
Link to comment
Share on other sites

 

I've used activate parent for traps, but never to open a door so I don't know if there's a way to make it work or not. For opening, enabling, etc., I make the object to be activated the linked ref of the switch. For the switch to open a door and play the switch animation, just make sure you call Activate on the switch itself at the end of the OnActivate block. If it's a one-time-only switch, put a doOnce variable in the script and call SetOpenState on the first activation. Making it reusable is a tiny bit more complicated, mainly because the values for GetOpenState and SetOpenState are different. This example won't let you use the switch while the door is in the middle of opening or closing, only when it is actually open or closed:

SCN SwitchOpenDoorSCRIPT

REF TheDoorREF

BEGIN OnActivate

    set TheDoorREF to GetLinkedRef
    if TheDoorREF.GetOpenState == 3 ; closed
        TheDoorREF.setOpenState 1
    elseif TheDoorREF.GetOpenState == 1 ; open
        TheDoorREF.setOpenState 0
    endif ; ignore 2 (opening) and 4 (closing)
    activate

END

 

THAT WHAT IT IS!! I always forget to call activate at the end UGH!

 

Thanks a ton!!

Geoff

Link to comment
Share on other sites

  • Recently Browsing   0 members

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