Controlling Doors using Switches
From FleshWorks
by Rantako
Some doors are opened and closed by a frobbing a switch, rather than by frobbing the door itself (secret doors, for example). This is very easy to set up.
First place a door (found under Actor -> WorldObj -> Moving) and a switch (found under Actor -> WorldObj -> Environmental -> Switch. Actually, it doesn’t have to be a switch; anything frobbable will work, but for now just use a switch)
Now open the door's properties and give it the properties Highlight -> HighlightDist: 0, Lock -> bIsLocked: True, and Scripts -> TriggerScripts. Give it the scripts ToggleLocked, OpenDoor, and CloseDoor, all of which can be found in the GameObjects folder.
Finally, create a TriggerScript link from the switch to the door. And that’s all there is to it – the switch will now open and close the door.
Back to Doors, Locks and Keys Tutorials Page
Back to Mission Design: World Objects Tutorials Page
