Author Topic: ObjectToString  (Read 374 times)

Legacy_Highv Priest

  • Full Member
  • ***
  • Posts: 170
  • Karma: +0/-0
ObjectToString
« on: January 01, 2013, 08:32:34 am »


               -How- unique is ObjectToString? Are copies of the same creature the same string? If I use CopyObject for instance, the copy = original? Are players given unique ObjectToString's? If player 1 logs in and player 2 logs in after. IF player 1 leaves is player 2 now considered player 1?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
ObjectToString
« Reply #1 on: January 01, 2013, 08:52:22 am »


               

Highv Priest wrote...

-How- unique is ObjectToString?...

100% unique, within any given run of the game.


...Are copies of the same creature the same string?...

No. 


... If I use CopyObject for instance, the copy = original?...

Yes. 

...Are players given unique ObjectToString's?...

Yes.

...If player 1 logs in and player 2 logs in after. IF player 1 leaves is player 2 now considered player 1?

Player 2 will be the First Player as far as GetFirstPC() goes.  But he will not have the Object ID that player 1 had.   If Player 1 logs back in he should get his old ID back.  I have no Idea who the first PC would be though.  

Player Information is keept in the Turd allowing them to be one of the few things that can leave the game and come back with the same ID. 

When the Game loads the module gets ID 0.   the First Area gets ID 1 the second area gets ID 2 ect...
After that each object is given the next ID as they are created, If an item is destroyed the ID is invalid and never used again.  

PC's are given ID's at that top of the range of the list.   And are assigned the next lower ID when a new PC logs in.    so if the top of the range was 0x0E0000, the first PC to log in would have ID 0x0E0000.  and the Second PC would have ID 0x0DFFFF
               
               

               


                     Modifié par Lightfoot8, 01 janvier 2013 - 08:54 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
ObjectToString
« Reply #2 on: January 01, 2013, 08:55:05 am »


               its unique per server instance

if you copy object, it gets new ID and objectToString simply returns this ID in string

as far players related, their id (might - not sure if always atm) change when relog and there is little discrepancy but I dont recall any details, I do rely on this and no problem
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
ObjectToString
« Reply #3 on: January 01, 2013, 08:58:05 am »


               Hmm,  I may have to double check on the PC ID's at some point.