Scripts / Help Wanted

Author
Message
Sergg
9
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Posted: 7th Dec 2015 18:07
English :

Hello! My name is Sergey. This is not interesting, so closer to the subject. I had a problem when writing the script. I wanted to make sure that when standing up to the platform opens the door. And at the gathering with her - it closed. A kind of puzzle. But I have not the slightest idea how to do it. I hope that you will help me in the making. Ready the same script can be, but to have an explanation, please.

Русский :

Привет! Моё имя Сергей. Это не интересно, поэтому перейдём к сути. У меня возникла проблема при написании сценария. Я хотел сделать так, чтобы при вставании на платформу открывалась дверь. А при сходе с неё - закрывалась. Некая головоломка. Но я не имею ни малейшего представления о том, как это сделать. Я надеюсь, что вы мне поможете в СОЗДАНИИ. Готовый скрипт то же можно, но чтобы были объяснения, пожалуйста.

PM
SounDesign
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 30th Dec 2015 14:44
Hi Sergey,

Sorry but I think the english translator/translation has lost us a bit.

Maybe you can break it down into simpler 'pieces' as I am sure that the scripts already exist around here - just need to clear up which one or ones are needed??

cheers and good luck

Phil
PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 30th Dec 2015 15:22
do you mean a automatic door?
that opens when close and closes when you enter
Harry
Harry
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 30th Dec 2015 15:31 Edited at: 30th Dec 2015 15:32
Quote: "do you mean a automatic door?
that opens when close and closes when you enter"


It sounds like he wants a door script that opens when you are standing on a pressure pad and then closes after a certain time after stepping off the pad, so you have to run to get through the door. Even if he doesn't want that, I wouldn't mind it
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Dec 2015 19:48
Quote: " It sounds like he wants a door script that opens when you are standing on a pressure pad and then closes after a certain time after stepping off the pad, so you have to run to get through the door. Even if he doesn't want that, I wouldn't mind it "


sounds like it to me too, i know dvader had one on the store but as it's been quite some time now i shall add one to my collection soon as i get around to it
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Sergg
9
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Posted: 30th Dec 2015 20:41
Quote: "Quote: " It sounds like he wants a door script that opens when you are standing on a pressure pad and then closes after a certain time after stepping off the pad, so you have to run to get through the door. Even if he doesn't want that, I wouldn't mind it " "

Yes!
PM
wermer
9
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 31st Dec 2015 05:54 Edited at: 31st Dec 2015 06:14
These scripts should get you started. They will open the door while the player is standing on the "pressure plate". As soon the player steps away a countdown begins. When time runs out the door is closed.

The "plate" will use "pressure_plate.lua" and the door will use "pressure_plate_door.lua"
In "pressure_plate.lua" you MUST set "door_e_number" to the entity number of the door you wish to control(in the init section)
The time before the door closes can be set with "door_delay"(in the init section again)

https://www.youtube.com/watch?v=QYP62MQGWpo

pressure_plate.lua


pressure_plate_door.lua


*You could probably do this better with timers, and possibly with a single script....
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300
PM
Sergg
9
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Posted: 31st Dec 2015 07:55
Quote: "These scripts should get you started. They will open the door while the player is standing on the "pressure plate". As soon the player steps away a countdown begins. When time runs out the door is closed.

The "plate" will use "pressure_plate.lua" and the door will use "pressure_plate_door.lua"
In "pressure_plate.lua" you MUST set "door_e_number" to the entity number of the door you wish to control(in the init section)
The time before the door closes can be set with "door_delay"(in the init section again)

https://www.youtube.com/watch?v=QYP62MQGWpo

pressure_plate.lua
+ Code Snippet


pressure_plate_door.lua
+ Code Snippet


*You could probably do this better with timers, and possibly with a single script....
"


Thanks you!
Happy New Year! Merry Christmas! Yes force be with you !
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st Dec 2015 19:54
thanks wermer, adjusted to allow name setting via the editor (for easier linking between pads and doors) - i.e. name both a pad and a door 'pressure door1' - and automatic handling of the 'e' numbers.
now allows multiple pads and doors using the same script and also added the ability to drop objects onto the pads to trigger them as well as the player
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
wermer
9
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 31st Dec 2015 22:22
@smallg
"*You could probably do this better" - and I knew you would! Awesome work as always!
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300
PM

Login to post a reply

Server time is: 2024-12-22 10:47:15
Your offset time is: 2024-12-22 10:47:15