🧢XTASK.desc
Specifies the description that will appear below the title of an achievement.
▸ Data Type
string
▸ Description
This value will show a description below the title of each achievement. It would be a brief summary of what the player must do in order to complete the achievement.
▸ Example
▸ Structuring String
A string is text that is surrounded by quotation marks.
The description above tells the player they must play on the server with %s players or more.
In-game, the %s will be replaced with the actual number of players required to complete the achievement.
If we break the code apart; it means:
sf is a shortcut for string.format
--
you can click here to read about this function on the official Garry's Mod Wiki.
At the end of our string.format
; we have placed tostring( XTASK.param_extra )
When the code is ran in-game, %s will be replaced with the value specified for XTASK.params_extra:
%s is replaced with 60
string.format
example:
The first %s will be replaced with apples; the second %s will be replaced with bananas.
In-game; you see the following:
▸ Escaping Characters
Finally, backslashes were inserted in the description:
\ character should be placed before an apostrophe to escape the character or you will receive errors. This can be avoided if you write the string using double quotation marks. Since the beginning of the string starts with ' -- it will see don' as the end of the string.
Both of the following examples are a proper way to write a string for your description:
OR
Last updated