-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add posibility to use (color) color constants in chat:send messages #19
Comments
While only available on the client, UTChat::PostMessage allows for using color tags, as well as using programmatically built UText objects. The latter would be preferred if you are posting messages from code because programming the formats may be more reliable than using a chat handler like color tags. Adding a server-side method for this will be tricky because I am gearing towards having multiple instances of UTChat, so the problem is which one to use. Perhaps if the server does not specify a specific chat (which is how I would implement it, and add a function for specific chats later), it sends it to a 'global' chat which appears in all UTChats. So the plan will be to add a 'global' UTChat to the client and add a PostMessage function to the server to post to this global UTChat. Also, color tags should already be able to handle multiple tags, does it not? |
Yeah they support multiple taga, but I meant as in [VIP] with VIP and name having a one color and the message another. Like what is done right now in, for example, admin scripts where it overrides the message and sends one in a red color. Problem is those can only use on color thanks to limitations in color usage. But I am glad to hear you want multiple chat instances in the future. Was going to work on that myself once #17 was solved, but if you do it I think it will be more advanced and stable. How does one use utchat::postmessage btw? Same as chat print? (i.e. UTChat::PostMessage( )) and if so, how do you add more colors in one message? |
You use PostMessage by passing a UText object. It does the rest of the work and puts it in the chat. Unfortunately I don't have any examples on-hand, you'll have to look at the documentation in the code for UText and the available formats. When building you UText object, you can apply any of the formats found in the formats folder and give it a start and end position in the text string. That's how you can apply multiple colors. |
Yeah I'll take a look at that then |
After looking at it, Chat:Send should definitely be able to use color tags. The slightly broken utcIntegration code might be to blame for that. I'm working on getting that fixed, but you should still try to use programmatic UText objects when you're writing code specifically for UTChat. |
Awesome. I'll get back to using your integrator then instead of the autorun file I had in use. |
right now when this is used, the (color) part is removed and it throws an error(luckily not the type that shuts down the script). 't would be very useful to actually be able to use multiple colors in Chat:Send, Chat:Print. Chat:Broadcast and player:SendChatMessage. An example for such usage would be coloured tags, a Chat AI and stuff like that.
The text was updated successfully, but these errors were encountered: