logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
ObjectToString. What about StringToObject

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Sat Jan 23, 2010 13:49    Post subject: ObjectToString. What about StringToObject Reply with quote

ObjectTostring gets a unique hex reference to the object in nwnserver process right? Surely it might be useful if there was a method that could directly get objects based of their unique object to string.


Eg. GetObjectByString("00ffead");

or something like that.

It would eliminate the need for some of my systems to do lengthy loops just to get a single object.
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Sat Jan 23, 2010 15:06    Post subject: Reply with quote

Code:
string _ObjectToString(object oObj)
{
  string sObj = ObjectToString(oObj);
  SetLocalObject(GetModule(), "OBJ_" + sObj, oObj);
  return sObj;
}
object GetObjectByString(string sObj)
{
  return GetLocalObject(GetModule(), "OBJ_" + sObj);
}


Done!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group