how to make custom chat

Posted by jose_creative
far i know it is possible to create a custom chat using draw events
and i wanted to know how

(sorry if i have to many questions im new to this game maker server stuff)

Replies (1)

Last message on 26 Jun 2021

Size43 (Administrator) on 26 Jun 2021, 17:22:29
Correct, this is possible. You can obtain all information on the chat messages using the various gms_chat_get_* functions. Expanding on the loop I showed here:https://gamemakerserver.com/en/docs/script/gms_chat_get_sendername/
You could do something like this:

var ypos = 400;
for (var n = gms_chat_num() - 1; n >= max(gms_chat_num() - 10, 0); n -= 1) {
    var name = gms_chat_get_sendername(n), 
        message = gms_chat_get_text(n);
    // ...
    draw_text(100, ypos, name + ": " + message)
    ypos -= 40
}


This will draw the last 10 messages on the screen. You'll likely need to adjust the positioning, etc. to make it look nicer. To send messages, you can call gms_chat.