(SOLVED) How do i give the option for the player to type their name?

Started by AGSPwnage, Sun 27/06/2010 18:28:55

Previous topic - Next topic

AGSPwnage

How can I give players the option to type their name, and then have that appear in the "RealName" box in the Character's "property grid", so i can make NPCs say their name when spoken to?

Wyz

You can set and get the name of a player by the 'Name' property. To enable the player to type in a name, you can use an inputbox.

Code: ags

cEgo.Name= Game.InputBox("What is your name?");
Life is like an adventure without the pixel hunts.

AGSPwnage

 ??? so, do i type that into globalscript or room script  ???

Atelier

Wherever you want it to happen. If you want them to do it on the first room, put it under room_Load.

AGSPwnage

so, now how do I get the NPCs to say the player name when spoken to (example. "Hello John,")?

Dualnames

Quote from: AGSPwnage on Mon 28/06/2010 16:41:01
so, now how do I get the NPCs to say the player name when spoken to (example. "Hello John,")?

cNpc.Say("Hello %s", cEgo.Name);
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

AGSPwnage

Thanks... I'll put your Names in the credits! ;D :) ;) :D >:( :( :o 8) ??? ::) :P :-[ :-X :-\ :-\ :-* :'( :=

SMF spam blocked by CleanTalk