Product Chat (Early Access) / [SOLVED] Unlocking a locked door.

Author
Message
Baldielocks
2
Years of Service
User Offline
Joined: 17th Jun 2022
Location: Grimsby,
Posted: 29th Jun 2022 20:32
I`m having major trouble trying to get this to work.
I create a door in a frame (objects\door_rotate.lua) attached to door. All I want to do is start with the door locked and get a key to unlock it , open it and be on my way. I`ve spent the last two days ploughing the forum / Youtube / Steam forums and I can`t find anything that works. In the behaviour I`ve put "key" in the use key section of the door. I walk up and can just open the door when I haven`t got the key. I`ve tried linking key to door using shooter logic as I`ve seen / read, door just opens . I`ve put "door" in the if used section of the key and when I get the key the door just opens. The key does have key+ script attached from the script files objects. I really don`t think it can be that hard surly. I`ve even got my sons mate from uni to come and have a look as he is doing games design. (I know not using GG Max but thought he may have had a little clue. He didn`t) so I`m getting too my wits end. I`d be pulling my hair out if I could but that`s not possible nowadays. Bit like this door.

The author of this post has marked a post as an answer.

Go to answer
PM
Shadow_Master
3
Years of Service
User Offline
Joined: 7th Oct 2020
Location:
Posted: 29th Jun 2022 22:16 Edited at: 29th Jun 2022 22:22
@Baldielocks, Click on the target icon on the right side of the screen at the top and then drag the yellow dot from the key to the yellow dot on the door to make a link between the two.

Right now, I do not have keys hooked to my door (for testing reasons) but the picture below shows the links between the lights and the wall switch. Same idea but with lights.

Attachments

Login to view attachments
PM
Shadow_Master
3
Years of Service
User Offline
Joined: 7th Oct 2020
Location:
Posted: 29th Jun 2022 22:28 Edited at: 29th Jun 2022 22:44
@@Baldielocks, Okay I re-read your post.

First, in the door behavior, uncheck the unlock box like the screenshot below shows


Second, link the key to the door like the screenshot below shows


and it should work like the video below in your test level
https://screenrec.com/share/rUSHRjtPlW

Attachments

Login to view attachments
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 29th Jun 2022 23:10
Most doors are already setup to open using the door.lua
The door_rotate.lua is really for creating your own door out of anything without animations and i do not think works with a key yet.
No one ever really leaves.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 29th Jun 2022 23:18
as synchromesh says, door_rotate.lua doesn't currently support locking/keys
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Baldielocks
2
Years of Service
User Offline
Joined: 17th Jun 2022
Location: Grimsby,
Posted: 30th Jun 2022 10:55
This post has been marked by the post author as the answer.
Thanks for that guys, all works as it should now. Main problem was I never used the the link between key and door on any door with the "door.lua" on them as the doors I wanted to use all contained "door_rotate.lua" . I changed the"door_rotate.lua" to "door.lua" but that didn`t work either. So I think I`m correct in my assumption that any door asset what I import that has "door.lua" attached to it will work fine. I presume in time the other doors will implement keys/locking in time. Cheers for help, it is much apricated.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Jun 2022 14:01
here's a version that works with keys - link the key via the linking system and it will automatically start locked (does require the key use key.lua)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 30th Jun 2022 17:50
Quote: "here's a version that works with keys - link the key via the linking system and it will automatically start locked (does require the key use key.lua)"

Oh very nice ..
Thank you very much
No one ever really leaves.
PM
Baldielocks
2
Years of Service
User Offline
Joined: 17th Jun 2022
Location: Grimsby,
Posted: 30th Jun 2022 18:29
Fantastic, just what the Doctor ordered, cheers.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 1st Jul 2022 17:22
Works a treat !!
Helps me out a lot thanks

Stab in the dark here but is there any way to get it to open and close via a switch ?
I dont mean lock and unlock i mean open as if you pressed "E"
No one ever really leaves.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Jul 2022 17:48 Edited at: 1st Jul 2022 17:50
Quote: "Stab in the dark here but is there any way to get it to open and close via a switch ?
I dont mean lock and unlock i mean open as if you pressed "E""

yes but i had to make it so that the switch only works if it's a little away from the door otherwise you can't really use the door manually too
- this way the door will automatically go back to the state of the switch after you walk away from the door if you open / close it manually
p.s. still works with / without a key
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 1st Jul 2022 19:09
Quote: "yes but i had to make it so that the switch only works if it's a little away from the door otherwise you can't really use the door manually too
- this way the door will automatically go back to the state of the switch after you walk away from the door if you open / close it manually
p.s. still works with / without a key"

Fantastic Huge thanks !!
Testing it now
No one ever really leaves.
PM
Kraven W
Valued Member
5
Years of Service
User Offline
Joined: 28th Dec 2018
Location: United States
Posted: 3rd Jul 2022 10:04
Thank you @smallg. I sure hope this incredibly useful script will find it's way into the next build for everyone to take advantage of, rather than getting buried and forgotten in the forums.
Once a wolf, always a wolf.

Login to post a reply

Server time is: 2024-09-16 20:41:18
Your offset time is: 2024-09-16 20:41:18