Add custom variables to items

From ARK Modding Wiki
Revision as of 13:10, 21 December 2016 by Tao (talk | contribs) (Created page with "Category:Tutorials == Preparation == When adding custom variables to an item you will face the problem that their values are reset after transferring them to another inven...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Preparation

When adding custom variables to an item you will face the problem that their values are reset after transferring them to another inventory. This can only be avoided by using existing variables and updating the values after moving the item. One particular variable is very useful for this: "CustomItemDescription" (String). The content of this variable will be kept when moving the item. When using it it is recommended to set "HideCustomDescription" to true to hide the content from the player.

Storing data in CustomItemDescription

When storing only one value it is pretty simple - set the variable value and make sure to properly convert between your time (for example bool, int, float, ... ) and the variable type (string).

Encoding multiple values

When storing more than one value you will have to encode the data somehow.

A very simple approach is to use the node "Join String Array" to join multiple values with a delimeter.

Joinstringarray node.png

To get the data back you can use the node "Parse into Array" combined with converting your data back correctly.

Parseintoarray node.png