Group counters start from 0 or 1?

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Group counters start from 0 or 1?

Post by kuertee »

Do lists start at 0 or 1?
E.g. Is the first object in "$Objects" at "$Objects.{0}" or at "$Objects.{1}"?
Mackan
Posts: 143
Joined: Thu, 1. Aug 13, 05:59
xr

Re: Group counters start from 0 or 1?

Post by Mackan »

kuertee wrote: Sun, 3. May 20, 10:56 Do lists start at 0 or 1?
E.g. Is the first object in "$Objects" at "$Objects.{0}" or at "$Objects.{1}"?
Index is 1-based for all list-based datatypes in X4, I believe. Index of 0 is used as a return value when trying to look up the index of an element that does not exist in a given list.

Return to “X4: Foundations - Scripts and Modding”