Product Chat (Early Access) / Opening A Door With A Key

Author
Message
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 26th Mar 2022 09:57
Hi All,

If you are interested in opening a door with a key, here are the steps. I have used the door and key from the "Escape from the Zombie Cellar" as an example:



1. Once you have dropped in a door and a key, select the Shooter Game icon in the top right
2. Then click and hold the key and drag the line to the door and then release
3. A connection will be made. The key will now be able to unlock and open the door

You can also change the behavior of the door by clicking it and opening the Behavior component and clicking the behavior. There you can choose whether the door should be regular, or rotating or a sliding door. Hope this helps!
GameGuru Classic will continue to be supported with bug fixes and functionality additions.

Attachments

Login to view attachments
Dara52
8
Years of Service
User Offline
Joined: 16th Feb 2016
Location: Sweden
Posted: 27th Mar 2022 13:14
Hello, this seams not to work here, i got: door.lua:74: attempt to compare nil with number. (Called the key --> Key1) (Door same as here)

BR // Dara
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 27th Mar 2022 16:43
@ Dara52
It works for me. did you try unticking unlock tickbox in the door settings?
I don't change the key name, but I add the door name to the key IfUsed field.
Anyway, it works for me once, then remains close, and CollisionOFF.

Most likely we are going to have door issues, until the navmesh check is fully integrated, though.

notice this chunk of code in the very bottom of the body script (door.lua) :

Quote: "-- navmesh blocker system
if g_door[e]['blocking'] ~= 0 then
local blockmode = 0
if g_door[e]['blocking'] == 1 then blockmode = 1 end
if g_door[e]['blocking'] == 2 then blockmode = 0 end
RDBlockNavMesh(g_Entity[e]['x'],g_Entity[e]['y'],g_Entity[e]['z'],20,blockmode)
g_door[e]['blocking'] = 0
end"


This chunk of code will come in handy for many uses when done.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 29th Mar 2022 03:17
"Most likely we are going to have door issues,..."
Yes, as well as everything we want to move.

It seems that they must have hard coded EVERYTHING that moves to NOT have any collision.
As least in my quick tests with behaviors + all kinds of collision types.
And that seems to go past the lua script also. So bummer until they get that sorted.
PM
Monkey Frog
4
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 29th Mar 2022 04:37
Quote: "It seems that they must have hard coded EVERYTHING that moves to NOT have any collision."


Not the Slider Door Behavior. It has collision. You can't walk through the door, even when it's sliding upward ... until the door is higher than you. I use it on my custom doors with box collision set for my doors.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 29th Mar 2022 12:01
That is mealy done to avoid calculating navmesh for let's say home, which is completely blocked by a closed-door, since it does not make sense and save resources.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Dara52
8
Years of Service
User Offline
Joined: 16th Feb 2016
Location: Sweden
Posted: 31st Mar 2022 13:23
Hello, if you comment out line 74,78,89,94 in door.lua (in map Files\scriptbank\objects) it works very good! You only lose delay of 1sec.

BR // Dara
PM
nan0
2
Years of Service
User Offline
Joined: 23rd Apr 2022
Location:
Posted: 25th Apr 2022 03:36
Thanks...I had forgotten that the Shooter Game Icon existed. I'm such a noob
PM

Login to post a reply

Server time is: 2024-12-21 18:34:49
Your offset time is: 2024-12-21 18:34:49