User Tools

Site Tools


building:scripts:api:custom_tokens

This is an old revision of the document!


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.

It works the same way except that these tokens use the format :

%%%%XXXX

where XXXX is the ID of the token, for example:

My name is %%%%2010

Its value is set by using the Get/SetServerCustomToken functions.

SetServerCustomToken(2010, "Name");

The listen token will always be

%%%%1000

The node print token will always be superior to 2000

%%%%2XXX

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…

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.

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.

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

authpdo: Statement did not return 'mail' attribute [auth.php:522]
building/scripts/api/custom_tokens.1686814686.txt.gz · Last modified: 2023/06/15 07:38 by spankitty

phpBB Appliance - Powered by TurnKey Linux