Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to make a "password" in a game

In my game there is a part where you have to find out the password to the computer to continue on.

How can i make it so you have to answer the right digits to get to the next point in the game?
 
I would recommend using a Conditional Branch event. Enter what you want the password to be, and require the player to put it in to activate the door opening or whatever. In the Else branch, simply put "Access Denied", or whatever your computer says when this password is invalid.
 
i was trying to do that but i dont know where i put the password.
is it a switch?
varriable??

can u maybe do it and take a screen shot of what the event should ook like when it is done?
 
Code:
 

@>Text: Enter Password

@>Input Number:[0001: password], 5 digit(s)

@>Conditional Branch: Variable [0001: password] == 12345

  @>Text: You log into the computer

  @>

 : Else

  @>Text: Invalid Password.

    :   :You get Nothing. You lose.

    :   :Good day, Sir!

  @>

 : Branch End

@>

 
 
I would set it up like this:

The player has access to the computer and the password. If he finds the computer first, then this happens: It turns on, asks for password, but the player can't do it because he doesn't have the password.

So....after the player finally finds the password (which is hidden elsewhere, perhaps in a book) and returns to the computer, allow an event to run that lets the computer accept the password and opens the door.

I don't know how to bring up a menu where the player puts in actual letters and numbers. I'm still a noob, myself. :biggrin:

Edit: Yeah....just now noticed the "Imput Number" option. Uh..... :blush:
 
There's another way to do it, if you want the password to be a word.

Create one more Actor slot than you need. Go on and name it something memorable, like "Password Input."

Now use Name Input Processing to get the password.

You can set a Conditional Branch to check whether a name is equal to, say, a password, the answer to a riddle, whatever...
 
Unka Josh":3utjteou said:
There's another way to do it, if you want the password to be a word.

Create one more Actor slot than you need. Go on and name it something memorable, like "Password Input."

Now use Name Input Processing to get the password.

You can set a Conditional Branch to check whether a name is equal to, say, a password, the answer to a riddle, whatever...

Or you could use the event text input script I'm reasonably certain I saw lying around this script forums from ages ago.
 
Brewmeister":k1fw7u2r said:
Code:
 

@>Text: Enter Password

@>Input Number:[0001: password], 5 digit(s)

@>Conditional Branch: Variable [0001: password] == 12345

  @>Text: You log into the computer

  @>

 : Else

  @>Text: Invalid Password.

    :   :You get Nothing. You lose.

    :   :Good day, Sir!

  @>

 : Branch End

@>

 


How do I make it so I can add the "name change" password thing in with the conditional branch?
 
memyselforwho":2i2tr1ba said:
How do I make it so I can add the "name change" password thing in with the conditional branch?

Go to the bottom of page four of the Condition branch, and add this code:

Code:
$data_actors[1].name == "Aluxes"

Just change the number to the number of the character whose name is a password, and the text in quotes to the password. Just leave the qoutes there, though. Currently, it will activate the conditional branch if Actor 1 is named Aluxes. (The default name)
 
Glitchfinder":m8hw8327 said:
memyselforwho":m8hw8327 said:
How do I make it so I can add the "name change" password thing in with the conditional branch?

Go to the bottom of page four of the Condition branch, and add this code:

Code:
$data_actors[1].name == "Aluxes"

Just change the number to the number of the character whose name is a password, and the text in quotes to the password. Just leave the qoutes there, though. Currently, it will activate the conditional branch if Actor 1 is named Aluxes. (The default name)


Ah perfect! Thanks a lot man, it's greatly appreciated. :grin:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top