Difference between revisions of "EntityId"

From Nomad DB
Line 1: Line 1:
Every [[Entity]] that is spawned into the world has an '''Entity Id'''. It is a 64-bit unsigned integer, which is represented in Lua as a string.
+
Every [[Entity]] that exists in the game world has a unique '''Entity ID'''. It is a 64-bit unsigned integer, represented in Lua as a string. This also applies to multiple instances of a single entity. Additionally, Entity IDs are dynamic, meaning an entity that is always being spawned will have a different ID each time the game is run. An exception to this are entities inside [[World Loading Unit|WLUs]] as they have pre-defined IDs.
  
 
'''Example'''
 
'''Example'''
Line 7: Line 7:
  
 
== Invalid Entity Id ==
 
== Invalid Entity Id ==
Some functions that return an Entity Id, might return one that is invalid. To check, if an Entity Id is valid, compare it against [[GetInvalidEntityId]].
+
Some functions that return an Entity ID might return one that is invalid. An Entity ID can always be compared against [[GetInvalidEntityId]] to find out whether it is valid or not.
  
 
== Related Pages ==
 
== Related Pages ==

Revision as of 18:10, 14 April 2020

Every Entity that exists in the game world has a unique Entity ID. It is a 64-bit unsigned integer, represented in Lua as a string. This also applies to multiple instances of a single entity. Additionally, Entity IDs are dynamic, meaning an entity that is always being spawned will have a different ID each time the game is run. An exception to this are entities inside WLUs as they have pre-defined IDs.

Example

15738498423673481953

Invalid Entity Id

Some functions that return an Entity ID might return one that is invalid. An Entity ID can always be compared against GetInvalidEntityId to find out whether it is valid or not.

Related Pages