Jump to content
gokitty1199

Universal Door Code Lock

Recommended Posts

 

gokitty199's door Code Lock Script
by
gokitty199/IM SORRY BUFFALO(both me)

 

not sure why the images are so small

code_Lock1.jpg

 

code_Lock2.jpg

 

code_Lock3.jpg

 

 


Description:
Allows you to set a code lock to any door that you placed a tablet next to for your mission.


Features:  
Set Door code
Change Door code
Unlock Door
Lock Door

 

Version:

1.0


Installation:

 

Download: updated 5/28/2018

https://www.dropbox.com/s/8fzzjtyz24iker9/kitty_lockFolder.rar?dl=0

Steam Page:

https://steamcommunity.com/sharedfiles/filedetails/?id=1396624743

 

to do list:

Spoiler

Pass in default parameters so the user can set it if they want the doors locked/unlocked by default on mission start as well as setting a default code

 

  • Like 4
  • Thanks 4

Share this post


Link to post
Share on other sites
14 minutes ago, gokitty1199 said:

--- too much to quote

Can this prevent AI from entering in it as well? 

Share this post


Link to post
Share on other sites
2 minutes ago, socs said:

Can this prevent AI from entering in it as well? 

yes, just tested with AI and a move waypoint, while unlocked he could walk up and open the door, while locked he stopped at the door

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, gokitty1199 said:

yes, just tested with AI and a move waypoint, while unlocked he could walk up and open the door, while locked he stopped at the door

Perfect! Great work.. And great tutorial as well ! Also while looking through those, you ever considered starting a thread with all of your tutorials? Wasn't sure if there was one already but yours are pretty helpful... 

  • Thanks 1

Share this post


Link to post
Share on other sites
2 minutes ago, socs said:

Perfect! Great work.. And great tutorial as well ! Also while looking through those, you ever considered starting a thread with all of your tutorials? Wasn't sure if there was one already but yours are pretty helpful... 

Thanks man i appreciate it. Ive thought about it but thats alot of typing for each video lol, heck my last GUI video took up 38 minutes of me talking alone haha so image that in typing form. Thats called carpal tunnel lol.

Share this post


Link to post
Share on other sites
10 minutes ago, gokitty1199 said:

Thanks man i appreciate it. Ive thought about it but thats alot of typing for each video lol, heck my last GUI video took up 38 minutes of me talking alone haha so image that in typing form. Thats called carpal tunnel lol.

Well, if you think about it, some beginners really need the extra time... Granted if you didn't want to you wouldn't have to but based on the tutorials you have, a lot of people besides me could find them useful as well... Especially ones that are in the forums basically every day (me) who know 0 about scripting (also me), could gather information through a video such as yours... You don't necessarily have to make a video specifically as a tutorial purpose, but maybe if you catch yourself in the act of doing something already that maybe somebody wouldn't know how to do, it'd be pretty cool if you turned it into a video.. :D Not bossing you around or anything and not intending to either, rather pitching ideas your ways to improve your overall channel activity! Please don't think that i'm downgrading you or anything or trying to be rude at all because that's not my intention! Cheers mate!

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
3 minutes ago, socs said:

Well, if you think about it, some beginners really need the extra time... Granted if you didn't want to you wouldn't have to but based on the tutorials you have, a lot of people besides me could find them useful as well... Especially ones that are in the forums basically every day (me) who know 0 about scripting (also me), could gather information through a video such as yours... You don't necessarily have to make a video specifically as a tutorial purpose, but maybe if you catch yourself in the act of doing something already that maybe somebody wouldn't know how to do, it'd be pretty cool if you turned it into a video.. :D Not bossing you around or anything and not intending to either, rather pitching ideas your ways to improve your overall channel activity! Please don't think that i'm downgrading you or anything or trying to be rude at all because that's not my intention! Cheers mate!

Thats not a bad idea to have like a general overview on how to do something such as make a gui, then make that gui do stuff, read from config files to get the data you want. this code lock would actually be a good example of that, the first part could be useful for alot of people. its able to find the building the object is closest to, then count the amount of doors that building has, then find the doors and their position thats relative to the buildings position, then convert that position with modelToWorld to get the true position of the door itself and store both the name of that door and the position in a nested array so people can do whatever they want with it for something like a breaching script and what not. Ill give something like that a shot in the next few days :)

  • Like 2

Share this post


Link to post
Share on other sites
12 minutes ago, gokitty1199 said:

Thats not a bad idea to have like a general overview on how to do something such as make a gui, then make that gui do stuff, read from config files to get the data you want. this code lock would actually be a good example of that, the first part could be useful for alot of people. its able to find the building the object is closest to, then count the amount of doors that building has, then find the doors and their position thats relative to the buildings position, then convert that position with modelToWorld to get the true position of the door itself and store both the name of that door and the position in a nested array so people can do whatever they want with it for something like a breaching script and what not. Ill give something like that a shot in the next few days :)

Cool stuff man! Look forward to it! Good luck!

Share this post


Link to post
Share on other sites

Cody you nailed it again bro. This will make our Mod so  much better when it comes to Locking builds or when we (if we add) base building into the Mod later this year. I know your confident enough to do such stuff. reason why i asked you for help with all my missions. Thanks buddy for the help all the time putting up with my silly ass ha ha. Anyways keep em coming man we love your vids (tuts) man they help us noobs out quite a lot. 

Mike

Share this post


Link to post
Share on other sites

you guys are going to laugh at me but i cant get this to fire up.....I created an initServer.sqf and added the code to the description ext. nothing is happening when I walk up to the tablet. I heard in the video that any tablet should work, because I used the rugged tablet. I can't figure out why it's not working I followed the install video and I know how to add scripts . 

 

I did however change the face of the tablet to this 

https://drive.google.com/open?id=1tR6y3GxnovJo4ihnIK2TffsD4KN49m0X

Share this post


Link to post
Share on other sites

how should it be done so that the door is already locked in (coop mission).

for example:

null = [this, buildingName, doorNumber, DoorCode] execVM "kitty_lockFolder\kitty_codeLockInit.sqf"; 

is it possible to do so?

 

Share this post


Link to post
Share on other sites
4 minutes ago, Casio91Fin said:

how should it be done so that the door is already locked in (coop mission).

for example:

null = [this, buildingName, doorNumber, DoorCode] execVM "kitty_lockFolder\kitty_codeLockInit.sqf"; 

is it possible to do so?

 

Yeah thats a good point you can pre lock the doors with the editor and only use this as the unlock. I forgot to mention that . No need for my purposes to be able to lock the door as they will be locked by default for the mission. Only need the players to be able to UNLOCK

Share this post


Link to post
Share on other sites
1 hour ago, WarhammerActual said:

you guys are going to laugh at me but i cant get this to fire up.....I created an initServer.sqf and added the code to the description ext. nothing is happening when I walk up to the tablet. I heard in the video that any tablet should work, because I used the rugged tablet. I can't figure out why it's not working I followed the install video and I know how to add scripts . 

 

I did however change the face of the tablet to this 

https://drive.google.com/open?id=1tR6y3GxnovJo4ihnIK2TffsD4KN49m0X

only works with the one little white tablet as of now, it can be altered to work with others by changing these two lines to check for multiple different objects instead of just the one tablet

_tablet = "Land_Tablet_01_F";
_objects = allMissionObjects _tablet;

 

1 hour ago, Casio91Fin said:

how should it be done so that the door is already locked in (coop mission).

for example:

null = [this, buildingName, doorNumber, DoorCode] execVM "kitty_lockFolder\kitty_codeLockInit.sqf"; 

is it possible to do so?

 

that can be done, just need to change the kitty_code_lockInit file to accept the parameters

Share this post


Link to post
Share on other sites

So I changed 

only works with the one little white tablet as of now, it can be altered to work with others by changing these two lines to check for multiple different objects instead of just the one tablet

_tablet = "Land_Tablet_01_F";
_objects = allMissionObjects _tablet;

to

_tablet = "Land_Tablet_02_F";
_objects = allMissionObjects _tablet;

Now I get the open keypad option and the keypad GUI but I am getting this error at launch

https://drive.google.com/open?id=1RQuqGxS6I0eBRlvrqwJJf1gx1vPKCSXb

also getting this error when I lock the door after setting the code and the doors remain unlocked

https://drive.google.com/open?id=19GwGhqj5HpKV0OOb_pHbCon7mCWW4I2Z

 

I will paste my mission pbo here so you can have a look at it and see if there is something I've missed or any conflicts

Mission PBO

 

Share this post


Link to post
Share on other sites
1 hour ago, WarhammerActual said:

So I changed 

only works with the one little white tablet as of now, it can be altered to work with others by changing these two lines to check for multiple different objects instead of just the one tablet

_tablet = "Land_Tablet_01_F";
_objects = allMissionObjects _tablet;

to

_tablet = "Land_Tablet_02_F";
_objects = allMissionObjects _tablet;

Now I get the open keypad option and the keypad GUI but I am getting this error at launch

https://drive.google.com/open?id=1RQuqGxS6I0eBRlvrqwJJf1gx1vPKCSXb

also getting this error when I lock the door after setting the code and the doors remain unlocked

https://drive.google.com/open?id=19GwGhqj5HpKV0OOb_pHbCon7mCWW4I2Z

 

I will paste my mission pbo here so you can have a look at it and see if there is something I've missed or any conflicts

Mission PBO

 

Did you add an addAction to the tablet? I'm pretty sure that has to be done in order to define what tablet you're using, otherwise just placing random tablets wont do any good for you lol...

Share this post


Link to post
Share on other sites
1 hour ago, socs said:

Did you add an addAction to the tablet? I'm pretty sure that has to be done in order to define what tablet you're using, otherwise just placing random tablets wont do any good for you lol...

for some reason its not putting the needed information into the _doorList array so its leaving it empty which isnt allowing it to check which door the tablet is closest to which doesnt let the tablet hold the needed information about the door because there is none. looking through it, not sure why yet. narrowed it down to the door count though, its not returning the amount of doors the building has, it returns the building but not the amount of doors so its not running the loop because for whatever reason its detecting the building as house_small_02_v1_ruins_f instead of Land_i_Barracks_V1_F which makes no sense as that building type isnt even around

Share this post


Link to post
Share on other sites

Thank you gokitty1199 !

Couldn't ask for better lock/unlock gizmo to spice missions up.

Great work mate!

  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, WarhammerActual said:

So I changed 

only works with the one little white tablet as of now, it can be altered to work with others by changing these two lines to check for multiple different objects instead of just the one tablet

_tablet = "Land_Tablet_01_F";
_objects = allMissionObjects _tablet;

to

_tablet = "Land_Tablet_02_F";
_objects = allMissionObjects _tablet;

Now I get the open keypad option and the keypad GUI but I am getting this error at launch

https://drive.google.com/open?id=1RQuqGxS6I0eBRlvrqwJJf1gx1vPKCSXb

also getting this error when I lock the door after setting the code and the doors remain unlocked

https://drive.google.com/open?id=19GwGhqj5HpKV0OOb_pHbCon7mCWW4I2Z

 

I will paste my mission pbo here so you can have a look at it and see if there is something I've missed or any conflicts

Mission PBO

 

fixedish. updated to a more reliable method of getting the buildings using nearestObjects instead of nearestBuildings. however i noticed now for some reason when i test it with the normal white tablet it works just fine without any errors, but when i use the rugged tablet/Land_Tablet_02_F it throws the same error, but it works for locking/unlocking the door which makes no sense because it really *cannot* function if its throwing that error. anyhow now its setup so it works more reliably for getting the building its on, and it now scans for both the regular tablet and the rugged tablet so either work. main post updated with new version

Share this post


Link to post
Share on other sites
2 minutes ago, zagor64bz said:

Thank you gokitty1199 !

Couldn't ask for better lock/unlock gizmo to spice missions up.

Great work mate!

thank you sir

  • Like 1

Share this post


Link to post
Share on other sites

So I tried it with the base (white) tablet and as you said. But I have a problem, the building has 6 doors so I have to lay down as many tablets to get all of the doors locked. The problem with that is  now I get this when I lay down multiple tablets on the same building.

 https://drive.google.com/open?id=1Hnxwcvn5jyWH4vOeRke-fimuwS3TOzJq 

So another  question mate, is there a way to have the one tablet lock all doors in the entire building? 

I don't know how much extra work that would be and you have already done so much. Which I can't praise you enough for 

Share this post


Link to post
Share on other sites
41 minutes ago, WarhammerActual said:

So I tried it with the base (white) tablet and as you said. But I have a problem, the building has 6 doors so I have to lay down as many tablets to get all of the doors locked. The problem with that is  now I get this when I lay down multiple tablets on the same building.

 https://drive.google.com/open?id=1Hnxwcvn5jyWH4vOeRke-fimuwS3TOzJq 

So another  question mate, is there a way to have the one tablet lock all doors in the entire building? 

I don't know how much extra work that would be and you have already done so much. Which I can't praise you enough for 

If you don't mind me asking, what building is it that you're trying to lock? Can you give the class name and a picture? I don't think modded buildings are supported but I may be wrong... 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×