Tge Id Numbers
by Chad Kilgore · in Torque Game Engine · 05/03/2007 (5:17 pm) · 2 replies
Can anybody tell me if I can somehow maintain a constant object ID between different loadings of the same mission file? What I am doing is when the player picks up an item, it stores its function call to a file so that on another play-through, pickup will occur without the action of the player. Could anybody please help me out? Thanks.
#2
Then when he re-enters the game, read the file and create and mount those items or add them to his inventry etc. You don't need item ID's (instance of an item), you just need the item type and then create a new instance of the same type next time through.
05/03/2007 (9:50 pm)
Try saving a text file for the player stating what items he has and should have again when he next spawns.Then when he re-enters the game, read the file and create and mount those items or add them to his inventry etc. You don't need item ID's (instance of an item), you just need the item type and then create a new instance of the same type next time through.
Associate Orion Elenzil
Real Life Plus
the object IDs will be very difficult / impossible to make the same from session to session unless the product is 100% frozen, with no new datablocks, ever, etc etc.
you could make up a unique identifier of your own tho (like maybe the sequence 1, 2, 3, 4...)
and either use that to construvt the object's name (eg myobject_
or you could put it in the field "internalName", which has some has some handy utility functions around it.
TDN has more to say on internalName.