This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
building:scripts:api:custom_tokens [2023/06/15 07:38] spankitty created |
building:scripts:api:custom_tokens [2024/10/12 01:30] (current) Elemuffin |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Server Custom Tokens====== | + | ======PAGE INFO ALREADY TRANSFERRED TO THE NEW WIKI - Server Custom Tokens====== |
This system is a mandatory alternative to the default CustomToken system, where all <CUSTOMXXX> occurrence get replaced by a value set by the SetServerCustomToken(XXX, "value"); function. | This system is a mandatory alternative to the default CustomToken system, where all <CUSTOMXXX> occurrence get replaced by a value set by the SetServerCustomToken(XXX, "value"); function. | ||
Line 10: | Line 10: | ||
The listen token will always be <code>%%%%1000</code> | The listen token will always be <code>%%%%1000</code> | ||
- | The node print token will always be superior to 2000 <code>%%%%2XXX</code> | + | The node print token will always be equal or superior to 2000 <code>%%%%2XXX</code> |
- | The difference with the default system is that the tokens are replaced in the text before that the text is sent to the client. This system should fix the issue where players sometime don't see the right token value. Also, those token can be use in more places: any name, description, chat message and more... | + | The difference with the default system is that these tokens are replaced in the text before that the text is sent to the client. This system should fix the issue where players sometime don't see the right token value. Also, those tokens can be used in more places: any name, description, chat message and more... |
- | And .. the default custom tokens are sent to everyone and every time that they are set or edited and so it is a potential cause of lag server and client side. | + | Furthermore the default system custom tokens are sent to everyone and every time when they are set or edited. So it is a potential cause of latency, server and client side. |
- | It is a must to use this system. I take the responsibility of updating the existing script/conversations, but any new scripts/conversations must use this system. | + | Therefor any scripted conversation HAS TO USE this system ! |
- | If you want to add colors to your dialog, you still need to use a default custom token, but it is not really a problem since color tokens only need to be set once and then never change. I created a shared ERF for everyone to add the color tags that they need: https://nwn.sinfar.net/res_nss_edit.php?name=cstmtok_ev_load | + | If you want to add colors to your dialog, you still need to use a default custom token, but it is not really a problem since color tokens only need to be set once and then never change. There is a shared ERF for everyone to add the color tags that they need: https://nwn.sinfar.net/res_nss_edit.php?name=cstmtok_ev_load. |
+ | |||
+ | Original by Mavrixio. | ||