Sets the value for a custom token.
- The number of the custom token.
- The string value for the custom token.
Sets the value for a custom token to be used in a conversation.
You can set the custom tokens in any script, however you may consider setting the tokens in StartingConditional() script to keep things contained.
The Lexicon has hitherto erroneously stated that tokens are local to conversations. This is NOT the case. Tokens are global, so when you set a token in a script (e.g. in a conversation file), it will have an effect on all instances of that token's use. Thus, using the same token number for different things in different conversation files can cause problems in multiplayer games especially, and should be avoided.
Custom tokens 0-9 are used by BioWare and should not be used. Maximum token number is 2,147,483,647.
There is a risk if you reuse components that they will have scripts that set the same custom tokens as you set. To avoid this, set your custom tokens right before your conversations (do not create new tokens within a conversation, create them all at the beginning of the conversation).
To use a custom token, place <CUSTOMxxxx> somewhere in your conversation, where xxxx is the value supplied for nCustomTokenNumber. <CUSTOM100> for example.
SetCustomToken() can also be used to give a name to some placeables, although not creatures or map notes.
For completeness it goes roughly as follows:
In the module OnLoad event place the command:
And in the name of the Brazier put:
The call to SetCustomToken() could go anywhere provided it was executed before the object was created.
Note that, for placeable names, any player in the same area as the placeable whose name is updated using SetCustomToken() will not see the name change. They'd have to leave the area and reenter before the name gets updated for them. SetName() is likely a better option for these instances.
You can also use tokens in journal entries.
All objects which share the same blueprint number have their token value updated when this function is called.
// a conversation by typing <CUSTOM100>
author: Tom Cassiotis, editor: Jasperre, Mistress, additional contributors: Vincent Bairan, Andy Lange, Jonathan Williams, Lilac Soul, Orca, Jasperre, Bjorn Hamels