Originally Posted by tk102
Interesting. I wonder where these two functions are used. I suppose they make it possible to store a reference to an object as a global variable.
As far as I can tell it allows you to 'wield' your object as an integer (i.e. access the actual IDs that the game uses to identify objects).
Edit: Yeah, that seems to be it;
Originally Posted by Rich Taylor
The ObjectToInt() script funciton is just data conversion. The 'object' engine type in the scripting language is really just an unsigned int. Converting the 'object' type to 'int' type doesn't do anything special other than let you now manipulate the object ID as an int.
object oPC = GetFirstPC();
int nPC = ObjectToInt( oPC ); //nPC now equals the PC's object ID
string sPC = IntToString( nPC );//sPC is now a string that equates to the PC's object ID.
If you copy an object, then that object has a new ID, so ObjectToInt() on the new copy will return a different numeric value.
All this function really does is give you script access to the actual IDs that uniquely identify objects.
I hope this helps explain it a little.