Scripts / Inverted door and multiple switches

Author
Message
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 22nd Jul 2017 13:32 Edited at: 22nd Jul 2017 15:45
I'm trying to make a puzzle with several doors. How can I 'invert' doorremote.lua so that a door is open by default but closes once the player activates it? What I have so far sort of works, but not quite (the animation doesn't seem to be quite calling correctly and the collision doesn't want to work when the door is closed)



Secondly, is there a way to use multiple switches to open multiple doors? (e.g. switch A activates doors A and B, switch B activates doors B and C, switch C activates doors A and C?)

AE
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 23rd Jul 2017 14:35
I've coded differents scripts to ge it.

I'm using 4 doors in the vid, door 1/4 and switches 1/4 (barrels).

In the vid, switch 1 open doors 1/3, and switch 4 open doors 2/4



Attach script "door_switch1.lua" to switch1 and "close_doors1.lua" to door1, and so on.

door_switch1.lua


close_doors1.lua



All the scripts are in the zip attached below.
hth.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

Attachments

Login to view attachments
PM
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 24th Jul 2017 21:24
Wow, 3com, that's really helpful! Thanks!

AE

Login to post a reply

Server time is: 2024-03-28 18:31:49
Your offset time is: 2024-03-28 18:31:49