Unique IDs

Place to get help with not working mods / modding interface.
Post Reply
asdff45
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Unique IDs

Post by asdff45 »

Many things in the API have the parameter index or unit_number. Can i generate my own index or unit_number, to make my objects unique? Or do i have to track this by myself?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Unique IDs

Post by DaveMcW »

You have to track it yourself.

I recommend storing the current max id in global.max_id, and the individual ids in global.entity_ids[entity.unit_number].

Post Reply

Return to “Modding help”