Easter Egg

M

Marten

Guest
Hey guys,

I'm trying to make an easter egg. The idea is simple: if the player enters a certain string of words, he gets teleported to another room. How exactly do I do this? I've tried checking for strings but it doesn't seem to work.

Any help will be appreciated!

Many thanks,
Marten
 
E

EZTALES

Guest
true let us know which gamemaker and we can get a better idea!
 
M

Marten

Guest
Ah, sorry! I'm using gamemaker studio. I've deleted all my tries at tackling this problem, sorry TheouAegis.
 

TheouAegis

Member
Well does the player have to type the secret word at any time during the game or is it in a password menu? Can the player see what he's typing or is it hidden?
 

Alexx

Member
If you want to allow it to be entered at anytime, something like:
Code:
if (keyboard_check(ord('P')))
{
    entered="";
    keyboard_string="";
}
entered=keyboard_string;
if entered=="assword"
{
    password_entered=true;
}
Which would be for the password password.
 
M

Marten

Guest
If you want to allow it to be entered at anytime, something like:
Code:
if (keyboard_check(ord('P')))
{
    entered="";
    keyboard_string="";
}
entered=keyboard_string;
if entered=="assword"
{
    password_entered=true;
}
Which would be for the password password.
Wait, where/when do I put the code to move the player to the next room, and what should I enter in between the " " after entered= and keyboard_string= if my "password" would be the word "please"?
 
That would be in the step event, and the only line you need to change is this
Code:
if entered=="assword"
To this
Code:
if entered=="lease"
If the word you wanted didn't start with p, you'd also have to change the P in the following line to the first letter of your phrase:
Code:
if (keyboard_check(ord('P')))
 

Alexx

Member
Wait, where/when do I put the code to move the player to the next room, and what should I enter in between the " " after entered= and keyboard_string= if my "password" would be the word "please"?
Once a correct password has been entered
Code:
password_entered
will be set to true.

So in the Step Event you could add:
Code:
if password_entered
{
room_goto(room_name);
}
 
L

Laurent57

Guest
Hi, why not
Code:
if string_count( "yourpassword", keyboard_string)=1 then {do what you want ; keyboard_string=""}
 
T

TimothyAllen

Guest
Hi, why not
Code:
if string_count( "yourpassword", keyboard_string)=1 then {do what you want ; keyboard_string=""}
If he is going to be running this every step, its a pretty inefficient way to accomplish this. I'd go for a version more like RefresherTowel's.
 
Top