Game Development Community

1.7: Locking/Unlocking entities issue

by TheGasMan · in Torque Game Engine Advanced · 04/18/2008 (4:01 pm) · 4 replies

Forgive me if I overlooked this in my searching(what searching the site allows to be done)..

I have not been able to lock AND unlock an entity without a crash.
This happens to more than 90% of my attempts at this.

Also, the Dynamic Value "Locked" does not appear in the Editor Panel after the engine is restarted.

Anyone ? anyone ? Beuller ? Beuller ?

#1
04/20/2008 (11:39 pm)
Same problem here.

I just edited the .mis file to solve the problems. Highly annoying though.
#2
04/28/2008 (3:32 pm)
Hmm, could not replicate the crashing. Neither in release nor in debug builds.

Do you see a pattern here or does it seem to happen regardless of what you do?

Could replicate the disappearing "locked" field thing, though. Will take a look at that.
#3
04/28/2008 (4:16 pm)
Okay, have a fix for the "locked" field not appearing. In fact, the problem is not specific to this particular field but rather pertains to how the inspector code treats dynamic fields in general.

There's an oddity in the code for GuiInspectorDynamicGroup::inspectGroup that will cause the creation of controls for non-dynamic fields on dynamic fields. While the field edit controls are constructed and added correctly to the group, they have no field data and thus will never show anything.

Here's the original code from gui/editor/inspector/dynamicGroup.cpp@91:

// If the field already exists, just update it
      GuiInspectorField *field = constructField( mTarget->getDataFieldType( entry->slotName, NULL ) );
      if( field == NULL )
         field = new GuiInspectorDynamicField( this, mTarget, entry );

I couldn't deduct the intention behind the code; it simply does not make sense to me.

//--EDIT--
To maybe clarify this: For the "locked" field, for example, it will construct a GuiInspectorTypeCheckBox object which will work with a AbstractClassRep::Field but not with a SimFieldDictionary::Entry.
//---------

To make the whole thing work, replace the code above with:

GuiInspectorField* field = new GuiInspectorDynamicField( this, mTarget, entry );

What's a little ugly now is that the field won't update correctly in the inspector when you toggle the lock, but guess one can live with that.
#4
04/30/2008 (4:21 am)
Thanks Rene.

The crashes were occurring by 'hand'-adding the locked & true DYN fields to objects.

I have been using the binds for locking which have no issues..that I am currently aware.


ctrl+L = lock
ctrl+shift+L = unlock