Transient variable?
by Markus Nuebel · in Torque Game Engine · 09/18/2005 (8:39 am) · 2 replies
Hi.
Is there a way to define a script objects dynamic propertys(member) as transient, so that they are not written to the mission file?
We have some objects that are being initialized in their onAdd() call and get some properties set.
Later on we modify the properties according to the gameplay.
Objects are mounted and dismounted to players while passing over their properties to the mounted images and later on to newly added objects, that are added when you dismount an image.
When the dynamic properties are written to disk and later on reloaded, the code can no more distinguish, in an objects onAdd() function, if the object enters the simulation for the first time, or as the result of an image dismount operation.
Any ideas?
-- Markus
Is there a way to define a script objects dynamic propertys(member) as transient, so that they are not written to the mission file?
We have some objects that are being initialized in their onAdd() call and get some properties set.
Later on we modify the properties according to the gameplay.
Objects are mounted and dismounted to players while passing over their properties to the mounted images and later on to newly added objects, that are added when you dismount an image.
When the dynamic properties are written to disk and later on reloaded, the code can no more distinguish, in an objects onAdd() function, if the object enters the simulation for the first time, or as the result of an image dismount operation.
Any ideas?
-- Markus
About the author
#2
It's more work, but you have better control on the load/save process.
09/19/2005 (11:06 am)
IMO, it's best to avoid saving the dynamic objects themselves. Instead, create scriptObjects or scriptGroups, copy only the properties you need saved onto them, and save them instead. When loading, you re-create your dynamic objects and copy their propeties from the loaded objects.It's more work, but you have better control on the load/save process.
Associate Matt Fairfax
PopCap
Otherwise you are going to probably have to touch some engine source.