HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is it possible to... Please Read

03-10-2003, 01:15 AM#1
Iron_Ian
Is there a way that I can make it so you name your character at the begining of the game (assigning a string to him or something), and then in Dialogue, other characters will say whatever you name is.

Example:

You name your guy Bob.

Character talks to you and says: Hi Bob!

You name you guy Joe.

Character talks to you and says: Hi Joe!

This would be really cool in an RPG.
03-10-2003, 01:32 AM#2
Alexian
You can't actually change units name, but you can set a variable for what they type in. So whenever you need the name, you just have the Variable.
I think this should work.
Tell them when you want them to type name, to add a ` to end of name, to finalize.

Event: Player enters chat message including ` as a substring
Condition: Player = Player #
Boolean Nametime = true
Action: Set Variable - Variable Player1Name (String) = Entered Chat String
Boolean Nametime = False

I am sure there is more efficient ways but that should work
03-10-2003, 01:35 AM#3
Ari
There's an easy way, and a hard way to do this, depending on how much you want to break the immersion in a game. Technique wise, there's not much difference, though:

first, create a text variable, "name"

Next, prompt the player to enter in a name preceded by a special character (@, for example).

Next have the following trigger:

event:
player enters a chat message containing "@" as a substring

actions:
set name = substring([entered chat string], 2, 100)
//this is done to "chop off" the @ symbol

now you have the name permentantly entered.

For a purist like me, though, you may not want to break the player's immersion in a gameworld by forcing them to type weird characters merely because it makes *your* life easier. In that case, you need 5 separate events, one for each vowel (player enters a chat message containng "a" as a substring, etc). This will catch any possible real name. (you can have a second event to detect if some jackass is trying to type in something like "xxx").

The only thing special about using 5 events is that you ought to leave such a broad trigger turned off unless needed f you plan on intercepting other chat messages later in the game.
03-10-2003, 07:36 PM#4
Iron_Ian
Yay it worked! Thanks alot. :ggani:

Too bad theres no way to change the name of a unit. Oh well, maybe Blizz will add that function in the xpac...