Scripts / Door script and a problem

Author
Message
Fane
12
Years of Service
User Offline
Joined: 9th May 2012
Location: Deutschland
Posted: 24th Jan 2014 14:09
Hello I just wirte a script to open a door without a key.







The script is working very well but I have a question. If I change the script I have to restart FPSC:R so it can be loaded. If I donĀ“t restart then FPSC:R not load the new script.



How can I avoid this problem?
PM
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 24th Jan 2014 15:31
Fane@

I have just tried a little test and I can't get to change to a newer script than the ones already in the scriptbank..

I did not think you would be able to use then same script name so I tried this

I started my test level and checked my gate/door script was working.

Exit the test level back to the Editor.

Try to copy my new Name and updated script to the scriptbank folder.

and FPSC editor immediately closed itself down.. (i'm using vista).



So yes you have to exit out of FPSC and then re-start it to use a new updated script.

If you save your level then this new change will still be there when you reload the level.





but You can swap between two diff scripts if they are already in the script bank in the editor

if you right click on the gate/door to get its property dialog on the left



In the AI Scripts - Main section you can change the script on the fly

Just click in the box with script name shown then press the little [..] button.

This will show a Select file dialog showing all the scripts in the script bank folder.

Just select the script you want and press Open button.

Also Remember if you are switching between use key and not use key type scripts

to change the AI Automated [ Use Key : Key ] entry to [Use Key : ] empty.



Important - now press the Apply changes button at bottom of the dialog.



Now run you test level - your diff script will now be used by the gate/door.



If you Save the level the new change will still be in the level when you reload it.

Hope this helps..
PM
Fane
12
Years of Service
User Offline
Joined: 9th May 2012
Location: Deutschland
Posted: 24th Jan 2014 18:30
I think a "reload scriptbank" button would be a good solution. Maybe it will come soon.
PM
MadLad Designs
GameGuru Master
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside......
Posted: 16th May 2014 20:38 Edited at: 16th May 2014 20:40
I'm trying to use this script (from the wiki) for the 'Wall Gates' from the horror pack but keep getting the attached error when it gets to 'Initializing Physics' for the test game. Anyone have any ideas?

Check out the [FPSC Reloaded FAQ]!



Also check out my YouTube Gaming Channel: /user/MadLadDesigns
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 16th May 2014 20:59 Edited at: 16th May 2014 21:13
there is a door no key script somewhere in 1 of the threads i used it with the horror pack in the winter asylum video thread.. wheni am home and on my dev comp i will of course copy it and paste it here for you guys to use if i cant find it on forums quickly.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 16th May 2014 21:12






the above script is for a door with no lock, it was given freely on the forums but i forget who and where in the forums.. sorry to the original scripter if you reconise it then please pm me lol so credit can be given to you

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 18th May 2014 15:10 Edited at: 18th May 2014 15:11
Removed post

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 19th May 2014 02:16
Quote: "the above script is for a door with no lock, it was given freely on the forums "




I cant get it to work on any doors for what ever reason. What am I missing? The file name is the same Ive assigned it to a door. . . . . .



Now what?

Case: Antec 900, Mobo: Asus Sabertooth 990FX, CPU: AMD T1100 Thuban 6 core @3300 ghz stock settings, COOLER: Thermaltake Frio, MEM: G Skill Ripjaws X series DDR 3 @ 1866 9-10-9-28, HDD: 2 Western Digital caviar Black 750 Gb set in RAID 0, GPU: Saphire HD 6950 flashed with 6970 bios, PSU: Corsair CX750M, MS: Cyborg Rat 7, KB: Logitec G510, OS: Windows 7 home premium 64 bit.
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th May 2014 02:22
what door you trying to use it with?, there are some fake doors from the horror pack maybe you used 1 of these?, but it should work fine. I tested it with the horror pack gate for church and church door and all other doors in the video without issue.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 19th May 2014 03:05 Edited at: 19th May 2014 03:05
Ive used the same doors, One is the crypt gate, the other is the doors for the sanitarium buildings. They work just fine with the regular door script, when i try the no key script, I go to test level and hang up in the lighting and the error is something to do with an error near 'end'



scriptbank\door_no_lock.lua:122: <eof> expected near 'end'

Case: Antec 900, Mobo: Asus Sabertooth 990FX, CPU: AMD T1100 Thuban 6 core @3300 ghz stock settings, COOLER: Thermaltake Frio, MEM: G Skill Ripjaws X series DDR 3 @ 1866 9-10-9-28, HDD: 2 Western Digital caviar Black 750 Gb set in RAID 0, GPU: Saphire HD 6950 flashed with 6970 bios, PSU: Corsair CX750M, MS: Cyborg Rat 7, KB: Logitec G510, OS: Windows 7 home premium 64 bit.
PM
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 19th May 2014 03:12 Edited at: 19th May 2014 03:21
Just to reiterate, my file name is the same as what the lua file is inside the script. I actually copied pasted it from the script.





Here is the script





And a pic of my script folder.

[img]http://files.enjin.com/191696/FPSC-R/script folder.bmp[/img]



Does this rely on anything in the global file by chance?

Case: Antec 900, Mobo: Asus Sabertooth 990FX, CPU: AMD T1100 Thuban 6 core @3300 ghz stock settings, COOLER: Thermaltake Frio, MEM: G Skill Ripjaws X series DDR 3 @ 1866 9-10-9-28, HDD: 2 Western Digital caviar Black 750 Gb set in RAID 0, GPU: Saphire HD 6950 flashed with 6970 bios, PSU: Corsair CX750M, MS: Cyborg Rat 7, KB: Logitec G510, OS: Windows 7 home premium 64 bit.
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th May 2014 03:12
weird, I will get back to you I only used it the other day and never changed anything maybe I didn't copy it all?

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th May 2014 03:21
no to the global variables it runs without any addons to those.

I just tested it and it runs fine for me :S. but the fiorst script was taken from a memstick the following script is direct from reloaded script bank which I just now tested... maybe something got messed up on the memstick I don't know?!.



here is the tested working script again



evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 19th May 2014 03:27
Well, I dunno what was different other than it was a smaller file by 30 lines and it works now. . . . . Thanks for the help. Would you mind adding me on steam? Gen Imchasinyou. I always like to have more knowledgable friends than myself

Case: Antec 900, Mobo: Asus Sabertooth 990FX, CPU: AMD T1100 Thuban 6 core @3300 ghz stock settings, COOLER: Thermaltake Frio, MEM: G Skill Ripjaws X series DDR 3 @ 1866 9-10-9-28, HDD: 2 Western Digital caviar Black 750 Gb set in RAID 0, GPU: Saphire HD 6950 flashed with 6970 bios, PSU: Corsair CX750M, MS: Cyborg Rat 7, KB: Logitec G510, OS: Windows 7 home premium 64 bit.
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th May 2014 03:33
yes I have indeed just read over the 2 I posted 1 is 104 lines or so of written code the other 83 lines.. no idea where the extra went or came from :/.

glad its now working for you . and im not knowledgeable lol some1 else wrote these scripts and all the scripts I use lol for the most part I can mod a script abit but that's about it, and that's trial and error lmao.. still add me if you like .

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th May 2014 18:46 Edited at: 19th May 2014 18:49
first code imchasingyou gave has some extra code that isn't really needed (from the looks of it, i havent tested but the rest of the code looks good) right at the end







seems like that was causing the issue because you had too many 'end' statements

and the code already has a "close the door" script anyway so i'm not sure why you are trying to add one, is it not working as you want?





@almighthood that's a very nice script, i especially like the turn key required on/off part... i missed that post too so nice catch

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th May 2014 18:52
well im wondering now, as the script on my memory stick drive changed on its own just how many other scripts on there are doing the same thing?!..



I now have to go through them all making sure they all work the same as before :/...



but then im having a lot of strange issues with reloaded or related reloaded items it would seem. quite odd quite odd indeed...

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th May 2014 19:22
the 2 scripts you posted are exactly the same, it's imchasingyou who has the different script

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th May 2014 19:24
ha ok thanks m8 for the info lol saves me some time and work I guess lol..

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 19th May 2014 21:53
I got that script here or the wiki page, copy paste! I'm not sure what happened but I got the right one now. I mean, I can't script and the engine is so lacking, you know it's not from anywhere else.

Case: Antec 900, Mobo: Asus Sabertooth 990FX, CPU: AMD T1100 Thuban 6 core @3300 ghz stock settings, COOLER: Thermaltake Frio, MEM: G Skill Ripjaws X series DDR 3 @ 1866 9-10-9-28, HDD: 2 Western Digital caviar Black 750 Gb set in RAID 0, GPU: Saphire HD 6950 flashed with 6970 bios, PSU: Corsair CX750M, MS: Cyborg Rat 7, KB: Logitec G510, OS: Windows 7 home premium 64 bit.
PM
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 19th May 2014 21:56
well all is well that ends well glad it works and you can continue onwards m8

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 23rd May 2014 16:13
hello i tried your script but it lock fpsc:r with the error: ATTEMPT TO CALL A NIL VALUE



why?

almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 23rd May 2014 16:27
which script?, by which poster? obviously the door, but there are a couple of different scripts for that here.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 23rd May 2014 16:42
i tried all scripts found in this thread.. and i tried in "church doors animated" entity

AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 23rd May 2014 17:01
i see no reason the first script shouldn't work but ill be going through a few scripts after 1.007 is released and will post confirmed working 1.007 scripts in a thread here, will also get around to updating the wiki one day too

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 23rd May 2014 17:24
great!

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd May 2014 20:41
if you use the first script you MUST call the file

door_unlock.lua

note the _ MUST be in the name - this is not a space

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 24th May 2014 14:31 Edited at: 24th May 2014 15:15
oh god.. now i understand a lot of things... now i remember that thing about the filenames and my test scripts are ALL working now!! included the one in this thread

may someone please post here the original door.lua script? i edited, edited, edited and finally was able to save modification to the original door.lua script and lose it forever!!! (ofcourse i could reinstall all from scratch, but why?)

thanks

Juri



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 24th May 2014 15:11 Edited at: 24th May 2014 15:13






use note pad, copy paste and name. make sure you save it as a lua, and its not in text file format.



also you should always only copy and paste the original files, then modify in notepad or something, not the actual original. this will stop that from happening as you always have it there the way it was ment to be .





side note, I mailed lee and asked him to add a doornokey script in the engine, he agreed and has done that for 07 I think.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 24th May 2014 15:17
thank you almightyhood for your help,

one little question it's my pc or your "snippet" is only a part of the door.lua script?

thanks again

Juri



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 24th May 2014 15:23 Edited at: 24th May 2014 15:23




didn't notice that nice spot ..sorry

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 24th May 2014 15:34
no worry,

thank you again for the code



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 24th May 2014 16:05 Edited at: 24th May 2014 16:20




here's my automatic door open/close lua script,

give it a try: filename MUST be "door_auto.lua"



Juri



EDIT: updated now check if animating before doing next animation



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th May 2014 20:44 Edited at: 24th May 2014 20:45
Quote: "here's my automatic door open/close lua script,

give it a try: filename MUST be "door_auto.lua"



Juri



EDIT: updated now check if animating before doing next animation"




hah, that's a really nice idea!

if i may clean it up a little i think this will still work fine



life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Auger
13
Years of Service
User Offline
Joined: 21st Aug 2011
Location: Out There
Posted: 24th May 2014 21:39
Just tried your script Juri, works great thanks.



Auger
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 25th May 2014 12:17 Edited at: 25th May 2014 12:18
Hello,

does anyone know if is possible to pass values from fpscr to script?

i'm trying to do a multi key door (actually 3 keys (or triggers) needed to open a door)

whitout success

Juri



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th May 2014 14:51
you can set a varible in a script which increases each time you pick up a key and then have the door check for the required number before it'll open



http://fpscrforum.thegamecreators.com/?m=forum_view&t=207801&b=2&msg=2479693#m2479693



one of my first scripts but the basic idea is the same

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Yurif74
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 1st Aug 2013
Location: italy
Posted: 26th May 2014 20:37
thank you smallg, that code is interesting



Amiga 4000 CSMK1 68060@50mhz, 200mb fast, CV64 4mb, Scandoubler, MiniThylacine 4 port USB, FastAta MKVI 4000, DVD+RW, HDD 120gb pio 5.
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 13th Jun 2014 20:55
@smallg

Hi, me again!

I tried your auto door script and it works great, however, I wanted to add the feature so that the player had to press 'E' before the door would open. Then when they are out of distance, it will close behind them.

This is
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Jun 2014 23:44
that's actually yuri's script
but i think you need to move the end to close your added if statment



life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
TattieBoJangle
10
Years of Service
User Offline
Joined: 7th Jan 2014
Location: United Kingdom
Posted: 14th Jun 2014 15:55
@Smallg i was also looking for something like this but i get LUA Error <eof> expected near 'end'

When using the above code





PC SPECS: Windows 8 Pro 64-bit, Intel I7 (PASSM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Jun 2014 20:29
here just tested and this work fine for multiple doors



life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
TattieBoJangle
10
Years of Service
User Offline
Joined: 7th Jan 2014
Location: United Kingdom
Posted: 14th Jun 2014 22:46
Thanks smallg





PC SPECS: Windows 8 Pro 64-bit, Intel I7 (PASSMARK 9529) 4GHz CPU, Asus R9 3GB GPU (PASSMARK 6858) 32GB DDR3 MEM (PASSMARK 2842)

Login to post a reply

Server time is: 2024-09-08 03:41:26
Your offset time is: 2024-09-08 03:41:26