Game Development Community

Y johnny can't hide

by Orion Elenzil · in Torque Game Engine · 08/31/2007 (5:13 pm) · 2 replies

Hey Folks -

so in the TGE world editor, the "Hide Selection" option hasn't worked for a long time,
and i'd always assumed i'd broken something,
but in trying to fix it today, i think it may never have worked since at least TGE 1.3.5.

Here's the flow:

1. Hide/Unhide selection set a dynamic script field named "hidden" in the item to true or false.
2. In InteriorInstance::renderObject(), we have:
if(gEditingMission && isHidden())
      return;
3. isHidden() just returns the value of the dynamic field.

Seems Good,
except that EditTSCtrl::renderWorld() looks like this:
void EditTSCtrl::renderWorld(const RectI & updateRect)
{
   // .. set some GL states ..

   gClientSceneGraph->renderScene();

   // ..

see the problem ?




i tried having renderWorld() render gServerSceneGraph, but it got some funky errors which i don't want to track down.

so, proposed solution:
have Hide/Unhide selection set the "hidden" dynamic field in the server object and then lookup the client version of the object and if it exists, set it there too.

#1
08/31/2007 (5:26 pm)
Oh wait. that should already be happening in WorldEditor::hideSelection().
looking more..
#2
08/31/2007 (5:35 pm)
Uh.. this does seem to be working for interiors. never mind.
it does not seem to work for DTSs, triggers, and spawnspheres,
but that should be easy to fix.

also even when an object is hidden,
it's still selectable, which is a big part of why we want to hide it.