View Single Post
Old 10-11-2003, 04:39 PM   #6
shadowfyr
Senior Member
 
Join Date: Oct 2002
Posts: 310
shadowfyr will become famous soon enough
Umm.. While I don't know a whole lot about LPC... A while back I was asking a wiz on the mud I play at how you would go about finding out the names or other information about say each existing piece of equipment in the game. According to what I was told you can get a list of loaded objects that are derived from a based class. All you would then need to do is count the total number of objects returned. Using an UID system seems like overkill if this works...

Note - This wouldn't work for rooms that do not load until some event or the like references them (like the ones created on the fly), which is essencially what the virtual rooms do, since they pull up the data for the room and insert it into the standard room object. However, I am not sure if such virtual rooms necessarilly get removed when they go inactive. If they stay in memory, then they would be in the list of derived objects as well.

I tried looking at the virtual code once for an LPC library that I tried using to play with (and was broken), but it confused the #### out of me at the time, so I don't know if they are created and destroyed as needed or if they just check to see if they exist already and create the room if needed. This would imho make more sense speed wise, but you never know.

Anyway, there should be a way to generate such a list. If the mud driver also has some sort of means to return the upper bound of the array generated (I assume it should), then you may not even need to count them, just get the bounds for the array. Now if you where counting unique objects of some sort...
shadowfyr is offline   Reply With Quote