Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: AGSPwnage on Sun 27/06/2010 18:28:55

Title: (SOLVED) How do i give the option for the player to type their name?
Post by: AGSPwnage on Sun 27/06/2010 18:28:55
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?
Title: Re: How do i give the option for the player to type their name?
Post by: Wyz on Sun 27/06/2010 20:52:47
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.


cEgo.Name= Game.InputBox("What is your name?");
Title: Re: How do i give the option for the player to type their name?
Post by: AGSPwnage on Mon 28/06/2010 16:20:07
 ??? so, do i type that into globalscript or room script  ???
Title: Re: How do i give the option for the player to type their name?
Post by: Atelier on Mon 28/06/2010 16:31:34
Wherever you want it to happen. If you want them to do it on the first room, put it under room_Load.
Title: Re: How do i give the option for the player to type their name?
Post by: 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,")?
Title: Re: How do i give the option for the player to type their name?
Post by: Dualnames on Mon 28/06/2010 16:56:15
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);
Title: Re: How do i give the option for the player to type their name?
Post by: AGSPwnage on Mon 28/06/2010 17:15:20
Thanks... I'll put your Names in the credits! ;D :) ;) :D >:( :( :o 8) ??? ::) :P :-[ :-X :-\ :-\ :-* :'( :=