ObjectToString

The   NWScript command converts an object to a hexadecimal string (a string containing only '0' through '9' and 'a' through 'f'). The returned string is eight characters long and represents an integer that uniquely identifies the object. This value does not change should the object become invalid (such as when it is destroyed), and in the case of player characters, it does not change when a player logs out and in.

There is no reverse command that will convert a string to an object.

Definition
The special constant OBJECT_INVALID is represented by "7f000000".

Uses
The primary use of this command is for debugging, as it can distinguish objects that have data (e.g. names and tags) in common. In particular, it easily distinguishes formerly-valid objects (which have no data associated with them) from OBJECT_INVALID, a distinction that can be lost through other debugging methods. Another benefit of using this command is that there is always a non-empty string returned, which can provide some reassurance that a particular script has not gone completely haywire.

This command also has use as a means of generating local variable names that are unique to an object (presumably to an object other than the one on which the variable will be stored). This is one way, for example, to keep track of which player characters have accomplished certain tasks, particularly when that tracking is stored on the module object.