G1R:MP Forum Alpha
Log in Join
Gothic 1 Remake Multiplayer

The Colony Forum

News, support, development discussions, server communities, and stories from beyond the Barrier.

Colony discussion

Default chat script understanding

Started by Xardas0327 in Scripting Help

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
08-31-2026, 09:35 PM (This post was last modified: 09-07-2026, 08:08 PM by Xardas0327.)
#1
I try to understand the default/free resources, which are in the current G1RMP-Server-Protocol26-Win64 build.
I have started the research with the chat resource, because it looks simple.
So, I have turned off all resources, except the chat.
Update: I have checked in the G1RMP-Server-Protocol32-Win64 too.

But I have some questions, because I don't understand a couple part of the code. Big Grin

  1. Why I can open the chat with the "T" Key? I don't see any bindKey function.
    Is it a default behaviour because of guiRegisterChat?
  2. I don't understand, how the message sending work.
    The server side looks clear for me. If the message is not command and there is no subscribed function for onPlayerChat event,
    then it will call the outputChatBox function (chat/server.lua line 145).
    But I don't understand, how the client catch the message.
    I see the CHAT_EVENT_OUTPUT (value=g1r:chatOutput chat/client.lua line 6 and line 63) custom event catchs the message.
    But the server never call this event. How does the outputChatBox function know it have to call the CHAT_EVENT_OUTPUT event?
    Update: It looks the g1r:chatOutput is the important. If I change the string, the chat doesn't work.
    Is this string/event hardcoded in the server? I haven't found it in the documentation.
  3. Update: Where is the time coming from on the chat?
+1: Where can I see the outputDebugString logs from client side? The Wiki say it is available on client-side and the script use it.
09-07-2026, 07:58 PM
#2
I have updated my questions. (just the forum didn't update the last post time)
09-15-2026, 11:51 AM (This post was last modified: 09-15-2026, 11:51 AM by QCherry.)
#3
The chat is mostly native. We only added the option to apply a limited amount of custom design and styling, but the core functionality itself remains native.

I’m also not sure why it opens the chat on “I”. The chat script always needs to be loaded, so that behavior shouldn’t be related to the script not being present.
09-15-2026, 08:26 PM
#4
Sorry, I still have questions Big Grin 

1. You wrote it:
Quote:I’m also not sure why it opens the chat on “I”.
I think you wanted to write "T". Or does the chat open with a different character for you?

2. Do you no sure? Didn't you write the scripts? Big Grin 
It is also good for me, if the script writer answer my questions.

3. The most important question, which I didn't get answer yet.
I understand, that I can send text by outputChatBox function from the server.
But how can the g1r:chatOutput event catch the chat text on the client side?
How do outputChatBox function and g1r:chatOutput event connect to each other?
The g1r:chatOutput is not an native event? or yes? I don't find it in the wiki.
09-16-2026, 10:09 AM (This post was last modified: 09-16-2026, 10:11 AM by QCherry.)
#5
Yes, I wrote the scripts.

What I meant regarding the chat opening with **“I”** is that this is not normal/default behavior.

Natively, the default chat is opened with **“T”**. This behavior is hardcoded in the multiplayer itself, so under normal conditions pressing “T” is what should activate the default chat input.

If the chat opens with **“I”**, then it most likely means that the chat script/resource was not loaded or initialized correctly, or there is some other issue interfering with the normal behavior.

So when I said I wasn't sure why it opens on “I”, I meant that this is not behavior that normally happens and I cannot reproduce it with the default setup.

And yes, I meant **“I”**, not “T”. Smile

Regarding point 3:

If a function or event is not documented on the wiki, then it means that we currently do not expose it as part of the public API.

`g1r:chatOutput` is not a native/public event that you should rely on or call directly. The communication between `outputChatBox` and the default chat resource is handled internally.

At the moment, chat customization is possible, but only within the limitations of the API that we currently provide.

So if there is no function, event or method described on the wiki for doing something, then there is currently no officially supported way to do it.

The chat system can be modified to some extent, but certain parts of it are intentionally not exposed yet. We may add more possibilities in the future, but for now you should only rely on the functions and events that are documented on the wiki.
Forum Jump: