How to Get the Name, Gender, and Pronouns of the Player, RPG style

This is how I got the name and the gender for the player. This is for the web version of Quest, but can work for any version of Quest.

Neutral pronouns, third gender pronouns, masculine and feminine pronouns.

First, give the player a type and an alias. The alias is found under the name, the tupe is found below prefix, suffix, and the object is a room check box. My player has an aias of "Gold", and a type of "masculine (named)" . You may also want to store the plauer's gender. Make an attribute. Mine is named gender1. DO NOT name the attribute gender, it overrides the direct gendered article (pronouns)!

player.gender1 = "male"

Make a starting room, if you don't have one already. My starting room is called Starting Room.

Next, make a name the player function. The function can be namrd anything. I named it gname.

gname

msg ("What's your name?")
get input {
  is_command = false
  foreach (cmd, ScopeCommands()) {
    if (IsRegexMatch (cmd.pattern, result)) {
      is_command = true
    }
  }
  if (is_command) {
    msg ("Is that so? Okay, then.")
    player.alias = "Gold"
    MoveObject (player, room)
  }
  else {
    player.alias = result
    msg ("What is your gender?")
    get input {
      is_command = false
      foreach (cmd, ScopeCommands()) {
        if (IsRegexMatch (cmd.pattern, result)) {
          is_command = true
        }
      }
      if (is_command) {
        msg ("Is that so? Okay, then.")
        MoveObject (player, room)
      }
      else {
        player.gender1 = result
        msg ("Just to be safe, what pronouns do you want?")
        pronouns = Split("Boy;Girl;Neutral;Surprise Me", ";")
        ShowMenu ("Pronouns", pronouns, true) {
          switch (result) {
            case ("Boy") {
              player.gender = "he"
              player.article = "him"
              player.possesive = "his"
            }
            case ("Girl") {
              player.gender = "she"
              player.article = "her"
              player.possesive = "her"
            }
            case ("Neutral") {
              player.gender = "they"
              player.article = "them"
              player.possesive = "their"
            }
            case ("Surprise Me") {
              roll = GetRandomInt(1,3)
              if (roll = 1) {
                player.gender = "he"
                player.article = "him"
                player.possesive = "his"
              }
              if (roll = 2) {
                player.gender = "she"
                player.article = "her"
                player.possesive = "her"
              }
              if (roll = 3) {
                player.gender = "they"
                player.article = "them"
                player.possesive = "their"
              }
            }
          }
        }
        msg ("Press any key or type \"mobile user\" or \"phone user\" to continue.")
        wait {
          MoveObject (player, room)
        }
      }
    }
  }
}

Preferably in the starting room, change the toom description to a script, and then make it into something lile this. Call your naming function here.

msg ("Hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!!!<br/>....<br/>Righto.<br/><br/>Now, the Pokémon... They are... magical creatures. Sometimes they are animals, and sometimes they are objects (such as Pokéballs) that come to life.<br/><br/>Commands you should know; Heal Oran Berry me, Heal Sitrus Berry me, Rest me, Access object, Egress object, Look at object, x object, Check object, Scan object<br/><br/>Equip Pokemon.<br/>Save often. I recommend saving every 30 minutes.")
msg ("What's your name? Please type your answer as soon as possible.")
gname
msg ("{command:help:Help}<br/>{command:Skip And Use Default Settings:Skip and use default settings}")

And that should be it! I'll post more when I come up with something.

Game for it here: http://textadventures.co.uk/games/view/5jllte-m4e2e2whw4gf5jq/pokemon-type-harley-gold-and-silver


I made these screenshots showing how it looks in the GUI editor view in case someone needs them!

https://i.imgur.com/LzjAdqR.png
https://i.imgur.com/YMvtw6H.png
https://i.imgur.com/KRkFsdD.png
https://i.imgur.com/TPpMWPj.png
https://i.imgur.com/m8tYWEG.png
https://i.imgur.com/G1jbazb.png
https://i.imgur.com/sHuXqjD.png
https://i.imgur.com/vJbi8ra.png
https://i.imgur.com/0GcJeAs.png
https://i.imgur.com/m0EeXm8.png
https://i.imgur.com/tVfxjXV.png
https://i.imgur.com/Tm1D5pa.png
https://i.imgur.com/Chix7DX.png

I hope everyone has a smooth and fun time with this code! :)


Odwertas

You may also want to store the plauer's gender.


I'm pretty sure I did.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums