Scripts / Auto Door

Author
Message
Tingalls
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 5th Nov 2013
Location: Great Northwest, USA
Posted: 29th Jul 2014 12:40 Edited at: 29th Jul 2014 16:40
I don\'t know if anyone has created a script to open a door automatically so I made one.

No key needed - when player gets close enough - the door will open and close when player

moves away from the door.







Copy the code to a text editor such as Notepad and then save the file as doorauto.lua and place it in your scriptbank folder.

In your door .fpe file, change the aimain = door.lua to aimain = doorauto.lua



enjoy - let me know if you have any problems

Experiencing a cool Game --> Tingalls



Win 7 Home Premium, 64bit(srvPack 1),AMD FX 4100 Quad-core 3.8Ghz @ 8Gb Ram - NVIDIA GeForce GT 610 @ 1GB Ram

Attachments

Login to view attachments
Bisella
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 30th Apr 2014
Location: Verona - Italy
Posted: 29th Jul 2014 12:47
Great works!!!!

The software I use? ... Autocad, sketchup, Spazio3D, pconplanner, Kerkythea, wing3d, paint.net.
PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 12th Mar 2015 17:26 Edited at: 12th Mar 2015 18:31
Tingalls wrote: "I don\'t know if anyone has created a script to open a door automatically so I made one.
No key needed - when player gets close enough - the door will open and close when player
moves away from the door."

In the GG v1018 don't work your script. The autodoor.lua script it just opens then it closes in my nose.
So I've tried to shoot it
Any help for this script to work, will be welcome

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 14th Mar 2015 19:12 Edited at: 14th Mar 2015 19:13
Old Larry :

Look for 'One Use Only Door Script' . You can modify it to get what you want the door to do .
Comment these lines out

else
if PlayerDist < 100 and SwitchFlicked == 2 then
Prompt("This door is now sealed forever")
end

and change SwitchFlicked = 2 to SwitchFlicked = 1

I have been using this to work an up/down door in one of my test projects .
Lance
PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 14th Mar 2015 19:43
Looool
Now to be serious, I still need one working script for autodoor
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Devcore35
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 15th Mar 2015 10:34
Hello,

Thank you
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 16th Mar 2015 16:20
Thanks for posting this.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Mar 2015 21:21
here you go

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
code crusher
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: vienna , AT
Posted: 16th Mar 2015 23:18
don't forget in the fpe file to define the animation lenght

;anim
animmax = 2
anim0 = 0,100
anim1 = 101,200

just look on your animation how many frames you have
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 17th Mar 2015 10:48 Edited at: 17th Mar 2015 10:50
Awesome, smallg. Finally the auto door script work !
Like usual you are the most helpful scriptwriter of all
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 17th Mar 2015 14:45
Auto door working example
This video example is from my new game level (wip)...

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 17th Mar 2015 16:06
Looks like it is working great. Thanks for the video post.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Jack T
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Feb 2015
Location: Nowhere Land
Posted: 19th Mar 2015 11:08
hi guys,
I tried the script but it doesn't work. A error message shows up during the test loading screen about the .lua file - I haven't done anything more or less than you said above.
Anyone has an idea why I have this issue?
PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 19th Mar 2015 11:49 Edited at: 19th Mar 2015 12:15
Jack T, In my video I've used this script from smallg:



Try with the gate fenced and use this script at "Main" (change door.lua with this doorauto2.lua), also in the gate (or door) option must have:
IsImmobile = Yes (already have and the door too) , and on the
Static Mode = No
IMPORTANT: DO NOT CHANGE GATE OR DOOR ANIMATION IN TO ORIGINAL FPE FILES OF ENTITY YOU USE IT
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Jack T
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Feb 2015
Location: Nowhere Land
Posted: 19th Mar 2015 12:14
Doesn't work, still the same message and the software crashes. Plus there's no static mode in my fenced gate proprieties.
PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 19th Mar 2015 12:45
Jack T wrote: "Doesn't work, still the same message and the software crashes."

Can you attach a picture jpg with your crash message ?
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Jack T
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Feb 2015
Location: Nowhere Land
Posted: 19th Mar 2015 13:29
No need: during the test mode loading screen the window appeared and said:
"LUA ERROR
scriptbank\doorauto.lua:2: unexpected symbol near char(160)"

That's it.
PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 19th Mar 2015 20:39 Edited at: 19th Mar 2015 20:40
Do you copy and save it script name exactly as "doorauto2.lua" name script (without quotes) THIS script ?
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Jack T
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Feb 2015
Location: Nowhere Land
Posted: 20th Mar 2015 07:35
Yes, everything should be fine. I copy/paste the code... I did everything that was told here. I will begin to think my Game Guru has a problem because everytime I try to use a new script or import 3d models following the same steps as everyone it doesn't work. I'll see what I can do.
Thanks for you time Old Larry,

See ya
PM

Login to post a reply

Server time is: 2024-12-21 15:09:09
Your offset time is: 2024-12-21 15:09:09