Can the player name themselves? How would I do that?

SteveMcQueenRat

  • Posts: 71
I'm making a game and I was wondering if there was a way to let the player name their character in-game. I know if it's on Kongregate there's a specific block for it, but I can't think of a way to let the player name themselves. Help would be greatly appreciated.

thegenericbanana

  • *
  • Posts: 494
Well, the hardest part would be inputting the names. How do you want that to happen, with the player typing out a name, pressing on a button, and turning that into it's name?
Johnny Turbo's Surgery Frenzy

SteveMcQueenRat

  • Posts: 71
I'd like them to be able to type their own name in.

Alexin

  • *
  • Posts: 3130
I don't think we have any kind of support for text fields. Flash has text fields (and many other UI components) but it requires code.
"Find the fun"
alexin@stencyl.com

captaincomic

  • *
  • Posts: 6108
Do you want something like the text field here: http://www.stencyl.com/game/play/10227 ?
If this is what you need, you can find it on StencylForge in the GUI Widgets Pack.

cloa513

  • Posts: 245
If you only want a temporary display to enter the name, use Enter Text by HNF (by  - its a scene behaviour so you'll need to go from your game start scene to this and add some extra gaphics but no big deal and then move the text as a game attribute to proper game scene. Its not too difficult - contrary to what Alexin says, Stencylworks can do it without permanent GUI.

I entered numbers rather than the above by creating an actor and having a long IF tree to enter the numbers and then exported the number as a game attribute and killed the actor.   

hcwdikk

  • Posts: 33
I just uploaded my Text Input to forge however it's very simplistic..not sure if it will suit you
Search for very simple text input on stencyl forge if you want it.

Abigayl

  • Posts: 807
If you don't mind getting your hands dirty in some basic AS3 coding, there's a great behavior set called FlxInputText (google it), which lets you make textboxes. That is what I used for The Lonely Square.
If you need help, please check my tutorials either here or Kongregate (http://www.kongregate.com/accounts/Abigayl) or come over to my stream: http://www.livestream.com/poweredbyflowers

SteveMcQueenRat

  • Posts: 71
Alright guys, I found a way around this but I'm running into a small problem. Basically I decided to make the whole alphabet into controls (A is control A, B is control B, etc.) and have it change the Name attribute but I've run into a bit of a hiccup. I have under "when drawing" the following blocks in this order "if A was pressed" "draw text a at (x:280 y:7)" "print A was pressed" but it doesn't do anything. If I have it as "if A is down" it works fine but the text then only shows up when A is down, which I don't want. I want it so that if you hit A, text appears and stays there even after you release A. The top screenshot is the one that works properly (with A is down), the second is what I want to see it works (with A was pressed), the third is what I want at the end.

hcwdikk

  • Posts: 33
I don't think that's the right way to do text input. Anyway the way you are trying to get it to work I think that it would look like this:

SteveMcQueenRat

  • Posts: 71
That makes perfect sense hcw, thanks. Don't know why I didn't think of it but glad someone did. Thanks alot.