Page 1 of 1

Create a keycode lock

Posted: March 15th, 2012, 5:56 am
by dkforreal
how would I make a keycode lock? similar to the one on ib_glass_v3

Re: Create a keycode lock

Posted: March 15th, 2012, 5:07 pm
by rB|Liam*
On my map I used this script, I've already forgot how to do the radiant part though so you would have to ask someone else about that. :)

Code: Select all

CombinationLock()
{
   lockTriggers = getentarray("trigLock","targetname");
   for(i=0;i<lockTriggers.size;i++)
   {
      lockTriggers[i] thread saveInput();
   }
   
   unlockTrigger = getent("trigUnlock","targetname");
   unlockTrigger thread unlock();
   
   level.code = "CODE HERE";
   level.input = "";
}
saveInput()
{
   for(;;)
   {
      self waittill("trigger",user);
      level.input += self.script_noteworthy;
      user iprintln(level.input);
   }
}
unlock()
{
   door_02 = getent("door_02","targetname");
   for(;;)
   {
      self waittill("trigger",user);
        if(level.input == level.code)
        {
        user iprintlnbold ("^7Password ^2CORRECT");
	wait(0.10);
        level.input = "";
	wait(0.10);
	door_02 moveX (-97,1.5);
	door_02 waittill ("movedone"); 
	wait(0.5);
	door_02 moveX (97,1.5);
	door_02 waittill ("movedone"); 
        }
   else
   {
    user iprintlnbold ("Password ^1INCORRECT");
	level.input = "";	
   }
   }
}

Re: Create a keycode lock

Posted: March 17th, 2012, 3:00 am
by dkforreal
Thanks for the script. :)

I tried the radiant part but kept getting these errors when activating the triggers

Image



Image

Re: Create a keycode lock

Posted: October 26th, 2012, 7:58 pm
by TrikX
script is good!
make your keypad in radiant, then on every button place trigger damage!
place these values for the keys from 1 to 0
key = targetname
value = trigLock

key = script_noteworthy
value = 1

(for script_noteworthy value for every key on keypad put it's number 1 2 3 ...)

place these values for Enter key
key = targetname
value = trigUnlock


now, i don't know if you made a door and brush next to it and placed ORIG ORIG ORIG tool on that brush,
but that is what you need to make, then make the door and that ORIG brush script_brushmodel

and as i see on that first picture, for main problem, when you make a separate .gsc like that,
put main() instead of CombinationLock()

now it should work!

Re: Create a keycode lock

Posted: October 27th, 2012, 6:55 am
by megazor
Keycode should be random-generated on each map start. Those who use a constant keycode are noobs.
For my map, I provided two ways on getting to know the code to the sercret room. The first way was solving a quadratic equation, and the second one was doing a long strafe jump.

Re: Create a keycode lock

Posted: October 27th, 2012, 4:03 pm
by Drofder2004
megazor wrote:Keycode should be random-generated on each map start. Those who use a constant keycode are noobs.
For my map, I provided two ways on getting to know the code to the sercret room. The first way was solving a quadratic equation, and the second one was doing a long strafe jump.
Not much of a secret if the password could be accessed by jumping. I would call it a bonus at most (the whole quadratic equation thing stinks of a form of unimpressive elitism).

A password should not be created on the start of a level, the password should be created on-the-fly and should be attached per person. This stops people from sharing the solution and also allows you to create puzzles where the answers to each digit of password is given to those who suceed.

Very simple to implement and effectively impossible to crack on a live server.

Re: Create a keycode lock

Posted: October 28th, 2012, 5:59 am
by megazor
Any secret will die sooner or earlier, unless you bind it to certain guids, but thats slightly a different thing.
Why not let only pro jumpers get to the secret room? It is fair, isn't it? As for my map, no one would solve equations, people would only try to access it by jumping. Quadratic equations turned to be too hard, even knowing that you could easily get the answer by googling. Any way, after someone entered the room, the code would change, so people who didn't have time to enter would have got to do that jump again. That system was much better than constant code in other jump maps.

Re: Create a keycode lock

Posted: October 28th, 2012, 3:32 pm
by Drofder2004
megazor wrote:It is fair, isn't it?
I do not know what your area holds, so I cannot say if it is or is not fair.

---

My take on what a hidden room should/could (+) contain and what it should not (-):

+ Credits, Images, Hidden Messages, Access to exta jumps, Soundtracks, Teleports
- Weapons, Kill switches, punishments to others

Bonus rooms should be accessible to anyone and should be accessible by completing a puzzle(s) or by finidng a hidden entrance and should not be GUID lockedor impossible.

Idea:
Map 20+ hidden (hard to find) locations on your map.
When map is started, a random 4 locations are unlocked (this stops players from simply going to the same locations).
The 4 locations provide a local message containing a character+digit to a code [A0].
Once all 4 are found the player can locate the enter pad.
This pad can provide an 'order' sequence using the letter characters. This forms the entrance code.

This is incredibly easy to code and forms a bonus that is both rewarding and challenging.

Re: Create a keycode lock

Posted: October 28th, 2012, 5:20 pm
by TrikX
i used guided keypads before on my maps only for clan members, now i just put guided teleport, much easier!
and for secret room that everyone can enter i just make a non-colliding wall or something like that!