HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Store chat-messages as variables!

02-23-2005, 11:52 AM#1
Undifty
How to do taht if a player for an example shall change name of its hero and the map will have triggers that do this, how to fix a map like this that like the example:
a player selects its unit and enters a chat message like "-un Gerard" and the units name will beome gerard... how to do this? How to store variables or things that depends on chat-messages? :(
02-23-2005, 12:00 PM#2
Guest
E: A player types a chat message containing (-un) as a (substring)

A: Change name of (hero) to (----there goes your string----)

Now there is a problem, I don't know either how to store the string from the chat message. But at least, you have the "skeleton" of your trigger now :/
02-23-2005, 12:57 PM#3
logik
actually you cannot change the name of units or heros (real names and refering names)

you can only change player names...


if you are refering to actually logging chat messages... i attempted to do this, and i had a semi-successful framework...

but the problem was when you typed in a command to look at the message, it will log the command aswell...

i cant be bothered fixing... if someone wants to tinker around with my old map, pm and i will send it to you.
02-23-2005, 01:07 PM#4
Elven Ronin
Yea, changing unit names is imposssible, as far as i know. maybe you can do it with jass, definiely not with gui.

About the only thing that comes close is doing something like the name tags in battleship command 1.41. It stored an entered string in a variable, then creates a floating text over the named unit. It periodically destroys the text (make sure you set it a variable when you make it), and recreates it at the new location.
02-23-2005, 01:19 PM#5
logik
that would cause monster lag aswell... i dont think you can change names using jass either (if so i think a mastermind like vexorian, weeraadar or <insert jass dude here> would of devised it/made something using it)

maybe hax?
02-23-2005, 02:12 PM#6
Undifty
Okay... ..The "Changing name on Units" was more like an example ;)

I just wondering how to store a chat message as a variable
Like if a player sends a chat message like "-un wee" the "wee" will be saved as a string variable.. :8 But how to do this :(
02-23-2005, 07:02 PM#7
Anitarf
Code:
Store chatstring
    Events
        Player - Player 1 (Red) types a chat message containing -store  as A substring
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 1, 7)) Equal to -store 
            Then - Actions
                Set stringVar = (Substring((Entered chat string), 8, (Length of (Entered chat string))))
            Else - Actions
                Do nothing
You do it using substrings. In this example, the command is 7 characters long ("-store "), so all characters from 8 to the end of the chat string are stored to the variable.
02-23-2005, 07:04 PM#8
Undifty
Ohh... Thanks