Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / how to open a door with a switch and then after entering close the door automatically?

Author
Message
Protokhn
12
Years of Service
User Offline
Joined: 19th May 2012
Location:
Posted: 2nd Nov 2012 15:00
I am making a game and i need a little help, how to open a door with a switch and then after entering close the door automatically but still can be opened again by another switch....

please help me on how to do this.

Khn
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 2nd Nov 2012 18:01 Edited at: 2nd Nov 2012 18:02
I have an example for you. In this demo, I used the following:

* scifi segments
* scifi door (remote)
* switch4 (scifi wall furniture)

I construct the level, placing the door and a switch on each side of the door.



I move the mouse over the door and right click to access the properties. Here I put the name of the door and set the main script to "doorremote_autoclose.fpi".



The script for the door:

doorremote_autoclose.fpi


I place my switches, one on each side of the door. I keep the switches within the one segment square from where the door is placed. I right click on the switch properties and set the main script to "switch_dualuse.fpi". Also ensure the If Used field for the switch contains the exact name you used for the door.



The script I use for the switch:

switch_dualuse.fpi



Repeat the step for the switch with the second switch. Same script is used as the first switch.

The result- player walks up to the door, which remains closed. They activate the switch, door opens, and the player passes through. At a set distance away, the door closes. To return, the player activates the switch on the side they are on.

Video Demonstration:




There's no problem that can't be solved without applying a little scripting.

Login to post a reply

Server time is: 2024-11-23 19:56:52
Your offset time is: 2024-11-23 19:56:52