Preload vs onNewDataBlock
by Demolishun · in Torque Game Engine · 09/17/2006 (9:48 pm) · 2 replies
I need to load a file and make some calls on some data when a new datablock is set. The issue I cannot understand is the function of Preload vs onNewDataBlock. Here is what I want:
new datablock set:
1 I need to reload a file and create a new version of some master data and delete the old.
2 Create a new instance of the data based on the master data for each instance of the object.
In a way the master data is datablock specific and the instanced data is object/instance specific.
What is the correct way to look at preload and onNewDataBlock? Another option is to never allow the master data to change, but that would not be the best thing.
new datablock set:
1 I need to reload a file and create a new version of some master data and delete the old.
2 Create a new instance of the data based on the master data for each instance of the object.
In a way the master data is datablock specific and the instanced data is object/instance specific.
What is the correct way to look at preload and onNewDataBlock? Another option is to never allow the master data to change, but that would not be the best thing.
About the author
I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67
#2
Thanks for the explanation,
Frank
09/18/2006 (6:10 pm)
No, I was not going to be very dynamic. I just wanted to handle the cases that the functions were designed to handle correctly. Thanks for the explanation,
Frank
Associate Kyle Carter
onNewDatablock is called on an object when a new db is assigned to it.
If you're going to be highly dynamic you might want to look at ditching dbs and going with another synchronization technique for semi-static data, ie, grabbing it from a local, dynamically updated database.