How to Create a Name in Your Game

by zachJohnson

<< All Articles | Print


In this article, I will show you how to create a name in your game using variables, and links. This is quite difficult to do if you are just starting out.

1. Setting up the variables

First, we need to set up the variables. You need to make the following variables, with a min value of 0, a max value of 26, and a starting value of 0. Note: This list is assuming you want the player to enter a max of 8 letters. If you want them to enter more, then you will have to create variables up to the number of letters you want them to have.

  • DIGIT1
  • DIGIT2
  • DIGIT3
  • DIGIT4
  • DIGIT5
  • DIGIT6
  • DIGIT7
  • DIGIT8

2. Setting up the pages

Now, we set up the pages. Depending on how many digits you want the player to enter, there will have to be different amounts of pages. In this article the max letters is 8. Here is the list of pages:


  • Enter letter 1
  • Enter letter 2
  • Enter letter 3
  • Enter letter 4
  • Enter letter 5
  • Enter letter 6
  • Enter letter 7
  • Enter letter 8
  • Enter name [click when the player is done entering their name but don't want to enter the maximum, which in this article is 8 letters]

3. Setting up the links

On the enter letter 1 page, make 26 links. These links are from A to Z. Once you create the links, do the following:

  • Link them to the enter letter 2 page
  • Make a variable change so that the variable DIGIT1 is increased by the number that is equal to the letter you clicked on, for example: 1 for a, 2 for b, and so on. For the later digits, you use the DIGIT2 variable for the enter letter 2 page, DIGIT3 for the enter letter 3 page, and so on

On the enter letter 2 page, make a reset link, an enter name link that goes to the enter name page, and the 26 letters. Make these links on all the other pages. On each page, for each letter, make it go to the next page. For example: You are entering letter 2, make all the letter links go to the enter letter 3 page. After the player has entered their 8th letter, make it automatically enter. In other words, link the pages on enter letter 8 to the enter page rather then the next letter page, because there is no next letter. On the reset link, make it loop back to the enter letter 1 page, and reset all the variables.

4. The code

In order to display the name on a page, you must enter the following code. You should also do this on the end of every enter letter page, because then the player knows what they have written so far. Here is the code:

5. Ending

So you've done it! You've created a name in your game! This is a complicated process that may take a long time. Another way of doing this is to create a list of links of which name you want for example "Bob", and making a variable that keeps track of which you picked and instead of entering that massive block of text you could enter this. Note you need to change the names to the names you want.


I hope this helped and that it wasn't too confusing.