malakdecaen 3 Posted August 26, 2013 Hi everybody , I want to know if there a way to input a keypad fonction to my house addon ? So i want the player create a shed passwored by he's characterID and if he want enter in the shed , he have to input the correct code on the Keypad to unlock the action "Open Door". It is possible to do that ? If someone script that for me i give him a donation . thanks and sorry for my bad english Share this post Link to post Share on other sites
lappihuan 178 Posted August 26, 2013 Someone made already such a script. Here is the Post where he explain its usage. Share this post Link to post Share on other sites
Von Quest 1163 Posted August 26, 2013 You can transfer one million dollars *pinky up to mouth* into my account... :icon_evil: To do a Keypad you'll need to set up whats called a dialog. Its a user-graphical-interface thing to display what you want and to process some interaction with code. This is on my list of things I wanted to tackle, but it'll be a while as dialogs are a bit more advanced than I wanted to wade into right now. Do a search for "dialogs". Or start here. Share this post Link to post Share on other sites
malakdecaen 3 Posted August 26, 2013 (edited) hey thanks for you'r reply guys , i go to check that . thanks a lot Edit : Maybe for the dialog i can take something from this script ? http://www.armaholic.com/page.php?id=15032&highlight=KEYPAD And in the other thread you'r code work for a keycard but for a password ? how to setup ? Can you help me to config my addon Goblin ? Thanks a lot Edited August 26, 2013 by kakarot Share this post Link to post Share on other sites
starvin101 10 Posted August 26, 2013 (edited) i had the same idea got dialog started but got carried away in photo shop making the background texture i am like you new to scripting but have used vb a lot i have done a shop dialog which is nearly finished but then i started this this is my background texture for the dialog feel free to use it if it helps if you want the dialog as a project i can post for you as it does open just needs numbers added and the scripts here is the background dont know if its any good to you but have a look and see what you think a quick question does anybody know how to make the buttons in my dialog invisible but still work so i can put them over the keypad i know in vb it can be done but can it be done in arma or do i just make the background color of button a light color and no text thanks any help would be appreciated Edited August 26, 2013 by starvin101 Share this post Link to post Share on other sites
malakdecaen 3 Posted August 26, 2013 hi starvin , yeah can you post the project here i want to see how you start the dialog , thanks . Very nice background. Share this post Link to post Share on other sites
starvin101 10 Posted August 26, 2013 (edited) here you go m8 the start dialog came from a you tube video about a weapon editor or something like that i just adapted it to how i wanted ,buttons are there they just need positioning over the key pad and the test lock code button over the enter keypad button if you press a button the number appears near the number selected but this ok its not in the right place as i have some digital numbers for them the lockbox.paa file needs to go on the lcd but have not got there yet lol but ondialog load you want to set it so it is displayed on the lcd as soon as the dialogs open this is easy as you can just unhighlight this line in lockBoxDialogs.hpp onLoad = "[] execVM 'dialogExtras.sqf'"; and change to onLoad = "[] execVM 'onLoadUnlockDiag.sqf'"; this will make it so as soon as the dialog opens it will run the script onLoadUnlockDiag.sqf at the moment it is a blank file but i was thinking of making it so it flashes just by doing a simple loop of clearing the structured text then displaying it again might work but this is were i would put the code for the lcd opening message hope this helps m8 or gives you a idea of what to do but dont forget im new to all of this like you lol also i done it so the box you run up to gets a add action to it asking you to unlock box so do that and the dialog will open also the box generates a six digit random code(lockBox.sqf) and saves it in a array for later use but it should display a hint showing the code hopefully something in there will help you http://www2.zshares.net/5z2hgdhzuqyw Edited August 26, 2013 by starvin101 Share this post Link to post Share on other sites
malakdecaen 3 Posted August 26, 2013 ho thanks starvin to share this . i will take a look thanks . Share this post Link to post Share on other sites
starvin101 10 Posted August 26, 2013 no problem m8 hope you get a keypad working as i dont have a lot of time to finish the one i started lol Share this post Link to post Share on other sites
Von Quest 1163 Posted August 26, 2013 Anyone else play with the TimeBomb? http://www.armaholic.com/page.php?id...ghlight=KEYPAD Can't get this to run in ArmA3. Only get the "Time: Scalar" in hint form on upper-right screen. @kakarot My setup only works with using/checking for a specific Item that you can carry. @starvin101 Is that site legit? Seems unsafe. Is the DL in the popup? My pc is blocking it. Share this post Link to post Share on other sites
starvin101 10 Posted August 27, 2013 (edited) yes m8 its good its only z share i use Kaspersky Internet Security and zshare has always been ok but re uploaded it with my media fire account for you but for z share click on free download then scroll to bottom of new window and there is a countdown the download appears there so dont click on any of the other links just free download then like i said scroll down and see the 30 sec counter counting down then download now will appear but this new link is like i said it is from my media fire account so its ok edit kakarot this new link will show you what i mean to get the display to flash a message on opening the dialog if you press button 0 the message will stop and the lcd will clear hope this helps http://www.mediafire.com/?k34d39i23p37ndp Edited August 27, 2013 by starvin101 Share this post Link to post Share on other sites
malakdecaen 3 Posted August 27, 2013 ho ok , do you know how to config it to work with a password goblin ? Share this post Link to post Share on other sites
adanteh 58 Posted August 28, 2013 Seeing I'm interested in this well I'll share my thoughts on how you might be able to do this. Can't you assign a variable to the house / whatever the hell it is and assign a value to it. The value would be the password. So setVariable ["PasswordVar", "12345", true]; Then I guess you just check if whatever you entered on the dialog equals that variable. Setting the variable could be done on the intial setup of the keypad system. As in if there is no PasswordVar assigned to the building / door yet, then you're allowed to enter something and that will be used as the keycode. I think I could actually do something like this myself, but I'm not sure how to make it nice and interactable. You'll need a dialog for the numbers and some way to open it up. I'm not sure how to do an AddAction to all doors of a certain building, plus how to assign a system like that to a building in the first place (Preferably something universal you can easily add to whatever you want). The best thing would probably be a small item attach next to the doors that you can add an action to. Share this post Link to post Share on other sites
malakdecaen 3 Posted August 28, 2013 thanks adanteh for this , but i don't know i need to put this , i know how to add an addaction to my addon but for the script i have some trouble to understand how it work . Can you set the script for me please ? The starvin script work to open the dialog but not for input the password , maybe you know how to fix this ? Share this post Link to post Share on other sites
starvin101 10 Posted August 28, 2013 (edited) yes you could use set variable like Adanteh said and check that variable all you got to do is set the variable to the key pressed for example in the dialog i posted in selectnumber.sqf there is a case statement which depends on which button was pressed . if you say for example you pressed button one then in the case statement under case one set the variable to one ie player setVariable ["PasswordVar", "1", true]; then get that variable using get variable ie _passNum = player getVariable "PasswordVar"; you could then add it to array for checking later or you could test see if that variable appears in the lock code array i generated earlier or do other stuff etc etc also my array _finalLockArray = []; in lock box.sqf is a local variable and will only be able to be used in that script so you need to make it so it can be checked by any script by removing the underscore ie finalLockArray = []; Edited August 28, 2013 by starvin101 Share this post Link to post Share on other sites
malakdecaen 3 Posted August 28, 2013 humm my knowledge isn't enought to set a script like that . if you find how to fix that starvin can you post here the script ? thanks a lot for you'r time. Share this post Link to post Share on other sites
adanteh 58 Posted August 28, 2013 http://forums.bistudio.com/showthread.php?162552-Locking-all-doors-of-building-adding-object-next-to-every-door I have some questions there to get the basics of adding proper keypad access to houses first. Right now I have a laptop in the door (Just to make sure it works) that you can access and there's an action added to the laptop that checks if the player knows the password right now. I'm going to build it into something that uses a keypad though. Share this post Link to post Share on other sites
starvin101 10 Posted August 28, 2013 kakarot have a look now i updated the lockbox.sqf to show you an example of how to use set/get variable to set password on box also shown you a way to get password from array as one string and then set that as the box password also gui got a bit more of that working got led to flash lol and some of the numbers will now show if you press the green number buttons then number will appear in the selected number boxes forgot to do 1 and 7 lol hope this helps lockbox.sqf is only a quick way to do this and i did it in 2 for loops so you could see whats going on but you could probably just use one for loop and rather then adding picked number to a array just set the variable for the password there but was not sure if you would understand what i did hopefully this way you can see what i have done so just run the mission and look at the hints then look at lock box.sqf and if should give you a good idea of how things you asked for could be done ,then try gui if you want to see what i updated,please remember i am new to all of this so i am trying to look at arma code like i would in vb and somethings i can do in vb i cant do in arma so im learning to but i have noticed a lot of stuff i learn t from vb does help in scripting http://www.mediafire.com/?cdbwio1kkqt69zb Share this post Link to post Share on other sites
adanteh 58 Posted August 29, 2013 (edited) Figured I'd just post it here untill I make more progress instead of adding yet another topic about the door locking and so. If anyone has suggestions, knows a good way for doing stuff in the to-do list, or just general ideas, let me know. Feel free to edit it and add stuff, as long as you share it with the rest ;) Here's what I've been making today. It's still a work in progress, but it works pretty well now. Right now it only works for one building, but I want to make it so you can add lockMarkers dynamically and add keypads to whatever building you want. I also still need a good way to retrieve the amount of doors, because right now it's set to 8. I already noticed the HQ (Next to the Miltary offices where it's placed now) has an extra laptop on the roof for whatever reason. Here's how it works: On init, keypads get added to all doors of the building lockMarker is currently on top of (Game Logic item you can move in editor). On first use you can set a password (Minimum 4 numbers) After that you need password to unlock and open door. All keypads have their own password (Allows to have your own secure room in a larger building) To-do: (Order somewhat based on priority) Make sure you can add multiple logics and add to multiple buildings Work out decent placement for the keypad (Left of door handle in the frame is prefered) Make sure I can save keypads + passwords with inidb. Create setting to make all keypads use same password Create computer that can manually open each door Create alarm when password is wrong Create password change option when door is open (Or with computer) Allow use of keycards so you dont need to type passcode Do some skinning on the dialog Allow opening doors from inside without passcode (Don't think this is possible) Video: You can download it here (Dev Branch) Edited August 29, 2013 by Adanteh Share this post Link to post Share on other sites
malakdecaen 3 Posted August 29, 2013 (edited) wow very nice video , thanks a lot adanteh . the script work !! but now i need to config it to work with my addon house . someone know how can i config it ? this is my config.cpp for the house : #define _ARMA_ class CfgPatches { class Malak_car { units[] = {"Malak_car"}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {}; }; }; class CfgVehicleClasses { class Malak_bulding { displayName = "[Malak] bulding"; }; }; class CfgFactionClasses { class Malak { displayName = "Malak"; priority = 100; side = 3; }; }; class CfgVehicles { class House_F; // External class reference class garage_repart : House_F { scope = 2; vehicleClass = "Malak_bulding"; faction = "Malak"; animated = true; displayName = "Shack VIP"; model = "\shackdonator\shackdonator.p3d"; supplyRadius = 0.2; memoryPointSupply = "gear"; armor = 10000; accuracy = 0.2; destrType = "DestructNo"; transportMaxMagazines = 400; transportMaxWeapons = 10; transportMaxBackpacks = 5; //DEFINE ANIMATIONS class AnimationSources { class Anim_Door_1 { source = "user"; animPeriod = 1; initPhase=0; }; class execVM { source = "user"; animPeriod = 1; initPhase=0; }; }; //DEFINE ACTIONS class UserActions { class Open_Door_1 { displayName = "Open Door"; position = "Door_1_action"; radius = 4; onlyForPlayer = 0; condition = "this animationPhase ""Anim_Door_1"" < 0.1"; statement = "this animate [""Anim_Door_1"", 1];" }; class Close_Door_1 : Open_Door_1 { displayName = "Close Door"; condition = "this animationPhase ""Anim_Door_1"" > 0.9"; statement = "this animate [""Anim_Door_1"", 0];" }; }; }; }; Edited August 29, 2013 by kakarot Share this post Link to post Share on other sites
Von Quest 1163 Posted August 29, 2013 This looks REALLY GOOD! Download Link *NOT WORKING* This will save me the headache of Dialogs. Thank You! Share this post Link to post Share on other sites
starvin101 10 Posted August 29, 2013 (edited) Adanteh nice m8 but link dont work kakarot no problem m8 Goblin dialogs aren't that hard that's the easy part its the scripting which is the headache lol Edited August 29, 2013 by starvin101 Share this post Link to post Share on other sites
adanteh 58 Posted August 29, 2013 (edited) Uhm, that's quite strange. I'm sure it was in there. Well here it is again: http://cl.ly/1f0o1M1w0n42 Does anyone of you happen to know how to orientate the objects so they're always on the same side relative to the position of the door? This will save me the headache of Dialogs. Thank You! I have to say that I'm using the dialogs a bit weird though. It's probably better to make a function that the enter button calls, instead of the script just waiting till the dialog is closed. That way you can also display the feedback in the keypad itself instead of using hints. Edited August 29, 2013 by Adanteh Share this post Link to post Share on other sites
adanteh 58 Posted August 29, 2013 Update time: http://cl.ly/091F2N3p0v0p Changed things around a bit. By editing kpw_marker.sqf and changing the 9 line and replacing "global" by "single" you can make sure every lock has it's own password. When you leave it on "global" the password is shared per building. Better update though: You can walk into any building, use the action (Add Locks), and it will add locks to all doors of that building. Eventually I want to be able to add locks from a central unit. (Something like a computer). You place that unit in the building and a dialog pops up, where you can preset all the passwords and control whether it should be a shared password or not / reset passwords and open/close doors remotely. Share this post Link to post Share on other sites
starvin101 10 Posted August 30, 2013 (edited) good work m8 ill take a look but i had already sorted that problem in my script as i kept the box local in lock box.sqf then set a variable for that box which held the password and run the script on the box when box loads maybe i am misunderstanding set/get variable by saying _box setVariable ["Password", "123456", true]; i thought any box that run the lock box script would have its own unique password as _box will depend on the box that run the script so each box would have its own password variable set to it now i a m confused lol for instance if my ammobox was called ammo1 and another box called ammo2 i was basically saying by using _box setVariable ["Password", "123456", true]; ammo1 would have a password variable 123456 but as i automatically generate code then ammo2 would have a variable set to it when it runs the lock script but it would be different from ammo1 and i could call them back from the add action script as _ box is just this select 0; as it had the action then just get variable for the box your currently working on and set that as current password to check against the user imputed code but i am new to all this so i will go back and check again guess i need to read more lol and good work again m8 i don't have Altis as don't have dev build so cant look at your version but from the vid it looks good and should be easy to skin so i hope you get it all working m8 one question can you lock ammo boxes ? as i cant seem to do it as a workaround i am having to clear all weapons/magazines when box is locked then if code is good just adding the reward to the box any help would be grateful thanks Edited August 30, 2013 by starvin101 Share this post Link to post Share on other sites