object

From NWN Lexicon
Revision as of 21:58, 11 June 2020 by Jasperre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A pointer to an object in the module. Objects can be areas, areas of effect, creatures, doors, encounters, items, placeables, stores, triggers, waypoints, and even the module itself.

You can use ObjectToString to see how the game references these. PCs are referenced from 7FFFFFFF (or 0x7FFFFFFF if you were able to define it yourself as an int) downwards, while objects start at 0 (or 0x00000000 if you were able to define it as an int) and work upwards. This may be useful for when GetIsPC fails in some game edge cases - see that article for details. The player ID is generated on login, and retained until the server is restarted.

You can't do StringToObject or IntToObject so these numbers are otherwise only useful for debugging. Instead you can save/load these with SetLocalObject and GetLocalObject or loop them with various other functions.

To see a bit about this see the NWNXEE source code.

Example

See Also