Page 1 of 2

Proper pasword scripts

Posted: May 24th, 2010, 5:29 am
by megazor
If you are going to create a map with password input system, my advices may help you.

Sooner or later, all players learn the password (someone give it to them) and unfortunately they just enter it instead of looking for a way to get it. It makes me sick -.-

Therefore I decided that the password should be random-generated and (optionally) changed after each successful input.

For my map I wrote a code that generates random quadratic equations; its form is ax^2 + bx + c = 0; the two roots are integers of the interval (-1000; 1000):

Code: Select all

level.x1 = randomIntRange(-1000, 1000);
level.x2 = randomIntRange(-1000, 1000);
level.b = (level.x1+level.x2)*(-1);
level.c = level.x1*level.x2;
or
x^2 + bx + c = 0

yeah, a is 1, but this doesn't really matter, it is still as diffucult to solve as if the number a wasn't equal with 1.

1. The majority of players are unable to solve quadratic equations.
2. If someone learns the code, it will be unable to be used one more time, as it is automatically changed upon the putting into the system.

These facts make my code system be much better than having an invariable password.
You are able not to use the equation way. There are lots of different ways, for example making a big gap jump and a button placed beyond of the gap; if pressed, the button tells the code (random generated, of course).

Re: Proper pasword scripts

Posted: May 24th, 2010, 5:32 am
by megazor
For some reason I can't edit my posts. I've made a mistake in the code, it should have been:

Code: Select all

level.x2 = randomIntRange(-1000, 1000);

Re: Proper pasword scripts

Posted: May 24th, 2010, 10:04 am
by Moustache
megazor wrote:lol... what an idiot...
:?:

Re: Proper pasword scripts

Posted: May 24th, 2010, 11:32 am
by Drofder2004
Not sure the point of using quadratic equations to forma random password...

simply doing

Code: Select all

level.password = "";
level.password = spawnStruct();
level.password.a = rand(10);
level.password.b = rand(10);
level.password.c = rand(10);
level.password.d = rand(10);
level.password = "" + level.password.a + level.password.b + level.password.c + level.password.d;
Then you can at trigger points print indivdual numbers...

If you want this to be even better, you can instead of using level, use self and then each player is assigned their own password, different to each other player.

Re: Proper pasword scripts

Posted: May 24th, 2010, 11:35 am
by megazor
no no and no. I wanted to make it so that only clever players can get into the secret room.

Re: Proper pasword scripts

Posted: May 24th, 2010, 11:36 am
by Drofder2004
megazor wrote:no no and no. I wanted to make it so that only clever players can get into the secret room.
Ok, fair enough, I thought you were simply creating a random script...

Re: Proper pasword scripts

Posted: May 24th, 2010, 11:37 am
by megazor
that is why i wrote
You are able not to use the equation way. There are lots of different ways, for example making a big gap jump and a button placed beyond of the gap; if pressed, the button tells the code (random generated, of course).

Re: Proper pasword scripts

Posted: May 24th, 2010, 5:04 pm
by Drofder2004
Nothing really.

A more complex puzzle would be to simply create your own logic. For example, why not program the enigma code?

Re: Proper pasword scripts

Posted: May 24th, 2010, 5:39 pm
by Pedsdude
Differentiation/integration ftw, that'll keep most of the noobs out.

Re: Proper pasword scripts

Posted: May 24th, 2010, 5:43 pm
by Rezil
Integration ftw.

Re: Proper pasword scripts

Posted: May 24th, 2010, 5:47 pm
by Pedsdude
Do integration by substitution and you'll be sorted.

But then again, they can use Wolfram if they have any common sense :(

Re: Proper pasword scripts

Posted: May 25th, 2010, 1:42 am
by megazor
Am I the only one thinking that you don't have to be clever to solve a quadratic equation...
You unfortunately can't think like a child. Being an adult, it seems so easy. but believe me, 95% of players can't solve quadratic equations and hardly ever anyone of them will visit wikipedia for it. It is actually good elimination.
Even knowing the formula, they will be perhaps unable to realize what a, b, c are. many players don't even know what square root is and so on.

Re: Proper pasword scripts

Posted: May 25th, 2010, 1:46 am
by megazor
why not program the enigma code?
what is it? explain in detail

Re: Proper pasword scripts

Posted: May 25th, 2010, 1:54 am
by Pedsdude
megazor wrote:
why not program the enigma code?
what is it? explain in detail
http://tinyurl.com/32exclk

Re: Proper pasword scripts

Posted: May 25th, 2010, 2:09 pm
by Drofder2004
megazor wrote:
why not program the enigma code?
what is it? explain in detail
Mathematical description.

Code: Select all

E = P(ρiRρ − i)(ρjMρ − j)(ρkLρ − k)U(ρkL − 1ρ − k)(ρjM − 1ρ − j)(ρiR − 1ρ − i)P  − 1.
In other words, it a complex encryption technique that doesn't require computers...