I'm trying to do a few things with the standard chat interface:
(1) Show/hide individual chat messages to individual players based on arbitrary logic; also change text style of individual messages
(2) Move and resize the area in which chat messages are displayed on-screen
I've been poking around a bit in the editor and I can't seem to figure out a good way to do this. A little guidance would be appreciated.
Well maybe you could create a custom dialog box or something. And then when a player enters a chat message, erase the message and then put that message in the dialog box. I think thats the only way to move messages.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
for (2) This can be done somewhat easilly by modifying the sc2 layout files: Let's assume you know how to do that. If you don't look for the tutorial thread on this page, you can get started there.
Open the GameUI, and search for "ChatDisplay". You can set the text style, the duration and number of messages and also the position of the chat window.
Okay I've been messing around with this and figured out that (..."", matching Exactly) will fire for any text from any player. From there I can Clear Chat Messages, but sometimes I still get the chat flickering onscreen before it's cleared. Do you know of a better way to suppress an individual message so it's never shown in chat?
Okay I've been messing around with this and figured out that (..."", matching Exactly) will fire for any text from any player. From there I can Clear Chat Messages, but sometimes I still get the chat flickering onscreen before it's cleared. Do you know of a better way to suppress an individual message so it's never shown in chat?
Thanks for both comments!
Is it particularly important that your new chat interface is in a certain spot, or could you have it covering the regular chat area to make messages unable to be read while they flicker?
Hmm that's an interesting idea but I don't think it's compatible with my goal. What I ultimately want to do is:
(1) Be able to move and resize the chat area during runtime. For example, in one mode it would replace the normal UI you get at the bottom third of the screen, making lines of chat text stretch across entire screen. Then in another mode it would move to the right side of the screen, with a large height but small width.
(2) Intercept and suppress/style individual chat messages differently.
I'm thinking I'm going to need to use custom dialogs for this, but I'm still going to have the problem of flickering chat messages unless I figure that part out...and I'd really prefer to avoid covering up the chat area...
The only thing I can think of is just blocking the chat area in the modes you want to use your advanced chat in. Maybe creating a dialog that fits into the rest of the UI so it looks nice?
Well maybe you could create a custom dialog box or something. And then when a player enters a chat message, erase the message and then put that message in the dialog box. I think thats the only way to move messages.
That wont work, a lot of players tried this for custom chat logs but the text will be visiable on the screen for a moment.
HOWEVER if you move the chat frame all together and then make the text jump to where you want it afterwards.. but then the player wont be able to see his typing line, unless that line UI element is different from the output frame.
How does one "block" the chat area? I don't want to cover it up and I'm getting flickering messages when I use Clear All Chat Messages.
Yeah it would be covering it up with something else. That's what the suggestion for the dialog that fit into the rest of the UI was about, to make it look more natural instead of being a box that just covers it.
My final suggestion would be to move the chat frame altogether the screen and leave the chat box (what you type stuff into) where it is, if it's possible. Then make a dialog that transfers all chat to it that has an invisible background, essentially creating the default UI chat. You could then turn the visibility of this on or off.
That wont work, a lot of players tried this for custom chat logs but the text will be visiable on the screen for a moment.
HOWEVER if you move the chat frame all together and then make the text jump to where you want it afterwards.. but then the player wont be able to see his typing line, unless that line UI element is different from the output frame.
Could you please provide details (code) on how I can (1) Move the chat area offscreen and (2) keep the normal typing line where it is? That would save me a lot of poking around :) Thanks all for your comments.
Here's a good guide that will get you started in the right direction. Take a look at this example map I've made where I moved the whole chat dialog to the bottom left corner of the screen. If you need any help, send me a PM.
Well, if you want to do this properly you will have to modify the layout files.
(0) Figure out how to modify layout files. It's simple, just go through helral's tutorial. It's in the tutorial section. Basically you have to download the layout files, modify them in the text editor and then import them back CORRECTLY.
(1) Open the file "GameUI", and search for "ChatDisplay".
(2) Set one of the offsets to a large number, maybe 5000. Or add <<visible = false>> (PSEUDO CODE) somewhere. Just look around you will see how the syntax for the "visible = false" thing works. I can't check right now.
(3) Import the layout files back to your map. Pay close attention to the tutorial, this has to be done axactly right.
(4) So far we should have achieved this: The player can still see himself typing, but his messages wont show. So now we're going to want to retrieve the messages he types. For this you can just use trigers, like you yourself have done already.
(5) Print the messages with the style of your choice at the position of your choice using custom dialogs.
Hope this helps!
Edit: Perfect, deathtorn posted all the visuals plus the tutorial to what I just wrote. :-D
The only problem is that people won't be able to see Friend messages that are incoming from people on their friends list, and that if they send private messages, that will trigger the chat event as well.
OK good call. These types of messages will still show up in the normal Social interface, though, right? Or would such messages be lost forever...?
Also: deathtorn, with your method is there any way to move the chat area around during runtime or does this happen only once at init and then you're stuck with its position for remainder of game?
I'm trying to do a few things with the standard chat interface:
(1) Show/hide individual chat messages to individual players based on arbitrary logic; also change text style of individual messages (2) Move and resize the area in which chat messages are displayed on-screen
I've been poking around a bit in the editor and I can't seem to figure out a good way to do this. A little guidance would be appreciated.
Well maybe you could create a custom dialog box or something. And then when a player enters a chat message, erase the message and then put that message in the dialog box. I think thats the only way to move messages.
for (2) This can be done somewhat easilly by modifying the sc2 layout files: Let's assume you know how to do that. If you don't look for the tutorial thread on this page, you can get started there.
Open the GameUI, and search for "ChatDisplay". You can set the text style, the duration and number of messages and also the position of the chat window.
Greetings
@Obatztrara: Go
Can the size/placement of chat area be changed programatically during runtime or can this be done only at map init?
@zeldarules28: Go
Okay I've been messing around with this and figured out that (..."", matching Exactly) will fire for any text from any player. From there I can Clear Chat Messages, but sometimes I still get the chat flickering onscreen before it's cleared. Do you know of a better way to suppress an individual message so it's never shown in chat?
Thanks for both comments!
Only at map init.
Is it particularly important that your new chat interface is in a certain spot, or could you have it covering the regular chat area to make messages unable to be read while they flicker?
@Tudentau: Go
Hmm that's an interesting idea but I don't think it's compatible with my goal. What I ultimately want to do is:
(1) Be able to move and resize the chat area during runtime. For example, in one mode it would replace the normal UI you get at the bottom third of the screen, making lines of chat text stretch across entire screen. Then in another mode it would move to the right side of the screen, with a large height but small width. (2) Intercept and suppress/style individual chat messages differently.
I'm thinking I'm going to need to use custom dialogs for this, but I'm still going to have the problem of flickering chat messages unless I figure that part out...and I'd really prefer to avoid covering up the chat area...
@jcraigk: Go
The only thing I can think of is just blocking the chat area in the modes you want to use your advanced chat in. Maybe creating a dialog that fits into the rest of the UI so it looks nice?
@Tudentau: Go
How does one "block" the chat area? I don't want to cover it up and I'm getting flickering messages when I use Clear All Chat Messages.
That wont work, a lot of players tried this for custom chat logs but the text will be visiable on the screen for a moment.
HOWEVER if you move the chat frame all together and then make the text jump to where you want it afterwards.. but then the player wont be able to see his typing line, unless that line UI element is different from the output frame.
Yeah it would be covering it up with something else. That's what the suggestion for the dialog that fit into the rest of the UI was about, to make it look more natural instead of being a box that just covers it.
My final suggestion would be to move the chat frame altogether the screen and leave the chat box (what you type stuff into) where it is, if it's possible. Then make a dialog that transfers all chat to it that has an invisible background, essentially creating the default UI chat. You could then turn the visibility of this on or off.
Do this, the two frames are different indeed.
@Obatztrara: Go
Could you please provide details (code) on how I can (1) Move the chat area offscreen and (2) keep the normal typing line where it is? That would save me a lot of poking around :) Thanks all for your comments.
@jcraigk: Go
Here's a good guide that will get you started in the right direction. Take a look at this example map I've made where I moved the whole chat dialog to the bottom left corner of the screen. If you need any help, send me a PM.
Well, if you want to do this properly you will have to modify the layout files.
(0) Figure out how to modify layout files. It's simple, just go through helral's tutorial. It's in the tutorial section. Basically you have to download the layout files, modify them in the text editor and then import them back CORRECTLY.
(1) Open the file "GameUI", and search for "ChatDisplay".
(2) Set one of the offsets to a large number, maybe 5000. Or add
<<visible = false>>
(PSEUDO CODE) somewhere. Just look around you will see how the syntax for the "visible = false" thing works. I can't check right now.(3) Import the layout files back to your map. Pay close attention to the tutorial, this has to be done axactly right.
(4) So far we should have achieved this: The player can still see himself typing, but his messages wont show. So now we're going to want to retrieve the messages he types. For this you can just use trigers, like you yourself have done already.
(5) Print the messages with the style of your choice at the position of your choice using custom dialogs.
Hope this helps!
Edit: Perfect, deathtorn posted all the visuals plus the tutorial to what I just wrote. :-D
@jcraigk: Go
The only problem is that people won't be able to see Friend messages that are incoming from people on their friends list, and that if they send private messages, that will trigger the chat event as well.
@deathtorn: Go
OK good call. These types of messages will still show up in the normal Social interface, though, right? Or would such messages be lost forever...?
Also: deathtorn, with your method is there any way to move the chat area around during runtime or does this happen only once at init and then you're stuck with its position for remainder of game?
I'm afraid that it's only during init, and I think those messages are lost to the wind.
Wait, they wouldn't even show up after the game is over in a personal chat window?
They would, but what I'm saying is you wouldn't get the notification, and a lot of players, including myself like that.