Daggerfall Mod:DFRemake/Resource - RMGetFreeObjectID

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

DWORD RMGetFreeObjectID ( )[edit]

Inputs[edit]

None

Outputs[edit]

Returns the next available object ID. The ID is guaranteed to be valid and not currently in use.

Description[edit]

Use this function to obtain a free object ID used for object creation.

Notes[edit]

The only way this function can fail to return a valid object ID is if all IDs are currently in use. Since object IDs range from 1000 to 1 million, this is unlikely to occur. Object IDs returned by this function start at 1000 leaving the lower IDs available for special purposes. IDs are limited to 1 million since large object IDs seem to require too much memory and slow down the system.

Typical access time for this function is < 0.004 ms for the first 999,000 objects created.

Example[edit]

  Local NewID as DWORD

  NewID = RMGetFreeObjectID()
  make object box NewID, 10, 10, 10