1. Home
  2. Docs
  3. In-game implementation
  4. JSON overview
  5. Entity fields

Entity fields

Each entity instance contains fields that are stored in the fieldInstances array.

The actual “easy to parse” value is stored in __value. Its type varies, based on the field type. See some examples below.

Note: if your field is, for example, an Integer limited to [1,5] range, and no value was manually provided in the editor, the __value field will be 1, to always comply with your field definitions.

Integer / Float / Bool / String fields

{
	"__identifier": "life",
	"__value": 3, 
	"__type": "Int",
	"defUid": 2,
	"realEditorValues": [ /* you shouldn't care about this thing */ ]
}

Color fields

{
	"__identifier": "hairColor",
	"__value": "#FF0000",
	"__type": "Color",
	"defUid": 58,
	"realEditorValues": [ /* only for the editor */ ]
}

Enums

{
	"__identifier": "enemyType",
	"__value": "Fighter",
	"__type": "LocalEnum.MonsterType",
	"defUid": 49,
	"realEditorValues": [ /* no one reads that anyway */ ]
}

Arrays

Arrays of values work exactly the same for all types described above, except… well they are arrays.

{
	"__identifier": "colors",
	"__value": [ "#FF0000", "#00FF00", "#0000FF" ],
	"__type": "Array<Color>",
	"defUid": 53,
	"realEditorValues": [ /* don't care */ ]
}