Mounting Persist objects impossible? Or TGB bug?
by Richard Skala · in iTorque 2D · 07/25/2010 (2:28 am) · 9 replies
I'm trying to mount several Persistent objects together in TGB. I mark them all as "Persist" (so they exist in all levels). I mount one object to another as normal and move the parent around, and the children follow as normal.
However, once I SAVE the level, the Persistent objects are no longer mounted. Is this by design? Or is this a bug in TGB?
However, once I SAVE the level, the Persistent objects are no longer mounted. Is this by design? Or is this a bug in TGB?
About the author
Founded in 2009, Pixel Vandals Inc. is focused on bringing fun, fresh, and new ideas to the iPhone. www.pixelvandals.com www.pixelvandals.com/vineking
#2
02/12/2011 (1:29 pm)
it is a bug but what i don't understand why ?
#3
02/14/2011 (9:47 am)
I don't really understand what you're asking, but with Persistent objects, you cannot mount anything to them, and you cannot use Behaviors with them. In fact, I think Persistent objects have been disabled in iTGB 1.4. They are still in the TGB editor, so I just use them for easily recreating objects throughout various levels.
#4
02/17/2011 (3:49 pm)
Persist object is nothing but normal object, like other objects. When you check Persist option in editor ,editor removes that object from level file and puts him in persistent.cs .Engine load them separately in levelManagement.cs . Behaviors should work with them ,but they don't .And I can't figure why .
#5
02/17/2011 (6:55 pm)
are you sure that the behaviours are all executed before the persistent.cs is executed?
#6
It would have been a lot easier if the Persistent objects kept their behaviors, but I just dealt with it and took advantage of the fact that the behavior remains on the Persistent object as long as the Editor isn't closed. I just opened every one of my levels, selected the Persistent object, duplicated it (copy-paste), and then deleted the Persistent object when I was finished. The copied object retains the behavior, but the Persist flag is removed. And, yes, it was VERY annoying to have to go through all 30+ levels, but it worked :)
02/17/2011 (7:05 pm)
I think the TGB Editor removes behaviors from Persistent objects -- maybe they are not supposed to have behaviors. If you add a behavior to a Persistent object and open or create a new level, the Persistent object will still have the behavior. However, if you close the TGB Editor, and open any level, you will see that the Persistent object no longer has the behavior.It would have been a lot easier if the Persistent objects kept their behaviors, but I just dealt with it and took advantage of the fact that the behavior remains on the Persistent object as long as the Editor isn't closed. I just opened every one of my levels, selected the Persistent object, duplicated it (copy-paste), and then deleted the Persistent object when I was finished. The copied object retains the behavior, but the Persist flag is removed. And, yes, it was VERY annoying to have to go through all 30+ levels, but it worked :)
#7
02/17/2011 (7:15 pm)
By the way, persistent.cs is NEVER executed in iTGB 1.4. If you look at _initializeProject(), you will see this:if($LevelEditorActive)
{
%dbFile = expandFilename("game/managed/datablocks.cs");
%persistFile = expandFilename("game/managed/persistent.cs");
%brushFile = expandFilename("game/managed/brushes.cs");
}
#8
02/18/2011 (3:23 pm)
I am talking about TGB 1.7.5 not iTGB 1.4 iTGB don't have Behaviors any more I know that.
#9
@Afan: This is the iT2D board, problems in relation to TGB should best be posted on the TGB boards :)
02/18/2011 (7:27 pm)
It does still have behavior support but the default behaviors are no longer in the install, the fresh project is really empty.@Afan: This is the iT2D board, problems in relation to TGB should best be posted on the TGB boards :)
Torque Owner Richard Skala
Pixel Vandals Inc.