If any of you have played the custom game Mafia I'm sure you've noticed that at the beginning of the game it lets you type in a name which than gets attached to the overhead of a unit. Does anyone know how to replicate this?
I have a map and at a specific time I want a player to be able to type in a name and have that name become attached to a unit that is created right before they type in the name. Any help would be greatly appreciated.
Text Tag seems like it has potential. One other small question that is probably very easy for you. What would a trigger look like to capture input from a player. For example what actions and events should I use to create a trigger that...
-> Stores the typed in text after the word -name... for example -name Harry (where Harry would get stored into a variable)
With the above information I can store 'Harry" into an array of text tags and attach it to a unit shortly after.
Here is a simple unfinished version of the trigger
EVENT: Game - Player Any Player types a chat message containing "-name", matching Partially
LOCAL VARIABLE: Temp Name = (Text(((Entered chat string) with characters from 1 to 5 replaced by ""))) <Text>
ACTION: UI - Display Temp Name for (All players) to Subtitle area
It stores the text after -name into the local variable and displays the correct name as a test. Now I can simply add and replace whatever further actions I need. Yay :D
Here is a simple unfinished version of the trigger
EVENT: Game - Player Any Player types a chat message containing "-name", matching Partially
LOCAL VARIABLE: Temp Name = (Text(((Entered chat string) with characters from 1 to 5 replaced by ""))) <Text>
ACTION: UI - Display Temp Name for (All players) to Subtitle area
It stores the text after -name into the local variable and displays the correct name as a test. Now I can simply add and replace whatever further actions I need. Yay :D
It will properly store the name - that is, until the trigger finishes its execution. Use a global variable if you wish to recall the name beyond the scope of that one trigger. You will have to use a Set Variable action.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello everyone,
If any of you have played the custom game Mafia I'm sure you've noticed that at the beginning of the game it lets you type in a name which than gets attached to the overhead of a unit. Does anyone know how to replicate this?
I have a map and at a specific time I want a player to be able to type in a name and have that name become attached to a unit that is created right before they type in the name. Any help would be greatly appreciated.
Try using Text Tag and attach it to your unit.
Pretty sure it's just a dialog?
@Tekaichi: Go
Text Tag seems like it has potential. One other small question that is probably very easy for you. What would a trigger look like to capture input from a player. For example what actions and events should I use to create a trigger that...
-> Stores the typed in text after the word -name... for example -name Harry (where Harry would get stored into a variable)
With the above information I can store 'Harry" into an array of text tags and attach it to a unit shortly after.
@LordSora: Go
For anyone interested I think I figured it out...
Here is a simple unfinished version of the trigger
EVENT: Game - Player Any Player types a chat message containing "-name", matching Partially
LOCAL VARIABLE: Temp Name = (Text(((Entered chat string) with characters from 1 to 5 replaced by ""))) <Text>
ACTION: UI - Display Temp Name for (All players) to Subtitle area
It stores the text after -name into the local variable and displays the correct name as a test. Now I can simply add and replace whatever further actions I need. Yay :D
It will properly store the name - that is, until the trigger finishes its execution. Use a global variable if you wish to recall the name beyond the scope of that one trigger. You will have to use a Set Variable action.