Scripts / remote door script request.

Author
Message
unfamillia
Forum Support
13
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 3rd Nov 2014 19:48
Good evening all.

I am creating a number of animated switches and have been cheating thus far. I have just been placing the switch close to the door, so, when the player is close enough to activate the switch, they are also close enough to activate the door, so, when they press 'E', they actually activate both. Quite cunning!

However, I have reached the point now, where I am thinking that people might want to place the switch away from the door.

I did a quick search on the forums, but, couldn't find anything about a 'remote door' script. Has anyone created one?

Or could somebody make one? I will pay of course, or I will give the person that can help me a few models of the switches in return.

Cheers

Jay.





smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Nov 2014 21:08 Edited at: 4th Dec 2014 18:49
updated: here you go, apply remote_door_trigger.lua to the trigger and remote_door.lua to the actual door, simple \r\nthere\'s not really a simple way to link 2 objects (at least not more than 1 pair anyway - \"collected\" kinda works but wouldnt let me close the door again)\r\ni havent commented the script but if you need any help adjusting it just let me know.\r\nthe first trigger placed in the editor will automatically link to the first door placed (if there is no door the trigger will simply not do anything but it wont cause an error) obviously both (all) entities need to be dynamic (as they have scripts) and also set to always on if the door and trigger are a long way away from each other.\r\n\r\n


life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
unfamillia
Forum Support
13
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 3rd Nov 2014 21:20
Looks great!

Did you place the name of the door in the ifused field?

Also, did you add the script to the post above? I couldn't see it?

Once I get it all working, I will send over the two switches I have so far.

You are an absolute legend! Thanks.

Cheers

Jay.





smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Nov 2014 22:32
yh but currently the ifused only works for spawning (i think eventually it will get more options but currently it doesnt)
also not sure why the files didnt upload last time as im sure it said they were but they seem to be there now (after an edit)

also meant to say there's no animation in the code for the actual trigger/switch itself but you can add that in with the door animation code pretty easy

just use
PlayAnimation(e) alongside the PlayAnimation() that are already in the code, that should be enough (so long as you have the animations set in the fpe like the doors)

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 4th Dec 2014 16:11 Edited at: 4th Dec 2014 17:11
Your script "remote_door.lua" is OK @smallg, but when I want to use the remote to enter the opened door I can't do it.

With same door, if I use the script "door.lua" I can open and close the door, and I can also pass through the door.

I have no clue why I can't pass trough the open door when I use the "remote_door.lua" script.

Any idea ? Thanks in advance smallg

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 options 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: 4th Dec 2014 17:12 Edited at: 4th Dec 2014 18:02
And a video with the remote problem here





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 options and speed, not just amazing graphics."
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Dec 2014 18:50
oops, thanks for that larry, updated the files in my previous post to include the collision... obviously it might be handy to be able to walk through those doors

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 4th Dec 2014 21:34 Edited at: 4th Dec 2014 22:01
Now all remote doors & switches work very fine !

You @smallg are the best, indeed !!! Full thanks !

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 options 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: 4th Dec 2014 22:00
Your script working verry verry good. Thanks again !


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 options and speed, not just amazing graphics."

Login to post a reply

Server time is: 2024-05-02 00:21:50
Your offset time is: 2024-05-02 00:21:50