T3D1.1 Beta 2 - Calling setHidden on an object (not a staticshape) doesn't work.- RESOLVED
by Richard Marrevee · in Torque 3D Professional · 08/25/2010 (6:09 pm) · 23 replies
Build: 1.1 Beta 2
Platform: Windows XP, 32 bit
Target: Editors, Torsion
Issues: Calling setHidden( 1 ) on a TSStatic has no effect. Object stays visible.
Steps to Repeat:
1. Launch World Editor
2. Add a TSStatic or any other object as long it is not a staticshape.
3. Select this object and in the Inspector at the Editing part select hidden
4. The object stays visible, only the assigned name disappears.
5. This also happens when directly calling object.setHidden(1) in the console
Suggested Fix:
I don't know.
Platform: Windows XP, 32 bit
Target: Editors, Torsion
Issues: Calling setHidden( 1 ) on a TSStatic has no effect. Object stays visible.
Steps to Repeat:
1. Launch World Editor
2. Add a TSStatic or any other object as long it is not a staticshape.
3. Select this object and in the Inspector at the Editing part select hidden
4. The object stays visible, only the assigned name disappears.
5. This also happens when directly calling object.setHidden(1) in the console
Suggested Fix:
I don't know.
About the author
Started programming in 1984 on an Oric, when time progressed switched to MSX, Amiga and finally the Windows PC with T3D. Now developing an epic fantasy game: The Master's Eye. Creator of the DoorClass pack and VolumetricFog pack @ richardsgamestudio.com
#2
As far as I can see now setAllMeshesHidden and SetMeshHidden are only exposed to player, item and staticshape objects.
08/25/2010 (7:46 pm)
@Steve:As far as I can see now setAllMeshesHidden and SetMeshHidden are only exposed to player, item and staticshape objects.
#3
08/25/2010 (8:28 pm)
That is most likely correct TSStatic shapes were not setup to have a sethidden. Just take a look at their net code. Richard how do you feel about makeing your own class that does what you need it to do? That way you don't have to use the standard example classes in the engine?
#4
08/25/2010 (9:04 pm)
Try this for TsStaticsif(myTsStaticsName.isrenderenabled)
LiterallyAnythingHere(myTsStaticsName);
myTsStaticsName.isrenderenabled=0;
#5
08/25/2010 (9:07 pm)
Logged as TQA-916 for QA to verify
#6
I will give that a shot.
@All:
It isn't really a problem for me, but I stumbled on this when I added the Universal AI Starter kit 1.5 to T3D1.1B2, where calling setHidden caused a crash. After some investigation it seems that setHidden doesn't work on any object. In any case calling setAllmesheshidden() did the trick for me, so thanks Steve didn't know it was there in any case 8P.
08/26/2010 (7:30 am)
@Steve:I will give that a shot.
@All:
It isn't really a problem for me, but I stumbled on this when I added the Universal AI Starter kit 1.5 to T3D1.1B2, where calling setHidden caused a crash. After some investigation it seems that setHidden doesn't work on any object. In any case calling setAllmesheshidden() did the trick for me, so thanks Steve didn't know it was there in any case 8P.
#7
If the UAISK is causing a crash when calling setHidden() then something is probably wrong in it. Of if not and something else is causing the crash then that is the bug that needs catching. But I just tested and confirmed (with 3 versions of Torque3d and 2 projects) that setHidden() does work for the above mentioned classes as it has in the past for TGE-TGEa.
08/26/2010 (9:00 am)
setHidden() does work. setHidden() works for Items, StaticShapes, Players, Vehicles -- all script accessible objects. TSStatics have never had such a method implemented for them.If the UAISK is causing a crash when calling setHidden() then something is probably wrong in it. Of if not and something else is causing the crash then that is the bug that needs catching. But I just tested and confirmed (with 3 versions of Torque3d and 2 projects) that setHidden() does work for the above mentioned classes as it has in the past for TGE-TGEa.
#8
It's probably a bug with StaticShape.setHidden(). If it was a problem with the kit, then simply replacing setHidden() with setAllmeshesHidden() likely wouldn't change the script from causing a fatal error to working perfectly.
08/26/2010 (9:52 am)
The UAISK only uses StaticShapes, not TSStatics. So its either that StaticShape.setHidden(); is not working properly, or this bug shouldn't have been reported here.It's probably a bug with StaticShape.setHidden(). If it was a problem with the kit, then simply replacing setHidden() with setAllmeshesHidden() likely wouldn't change the script from causing a fatal error to working perfectly.
#9
You're right, I mentioned this also in post #2. The thing is that at every object you add in the worldeditor you have the choice in the editing part of the inspector to set it hidden, which in many cases do nothing.
As said: for me it is not a problem, but why is it there if you can't use it.
08/26/2010 (5:47 pm)
@Michael:You're right, I mentioned this also in post #2. The thing is that at every object you add in the worldeditor you have the choice in the editing part of the inspector to set it hidden, which in many cases do nothing.
As said: for me it is not a problem, but why is it there if you can't use it.
#10
08/26/2010 (6:29 pm)
We actually had a ticket for this one already, THREED-1134, we discovered it during the 1.1 Beta 2 testing. There's a fix for it for me to confirm in the next build QA receives.
#11
08/26/2010 (6:51 pm)
Quote:That is what prompted my response. It does work as expected as it always has before. The issue is more of one over confusion of what setHidden actually does and exposes a liability of unusable fields exposed to the Editor for classes that shouldn't have them.
After some investigation it seems that setHidden doesn't work on any object.
#13
I do agree with your point about why is it there in the editor as a usable field if it's not actually usable for some classes. Just a simple undersight in my opinion of the Tools since setHidden() is more far reaching in scope than just the visibility option that it's usage description indicates.
08/26/2010 (7:58 pm)
@Richard: no worries :)I do agree with your point about why is it there in the editor as a usable field if it's not actually usable for some classes. Just a simple undersight in my opinion of the Tools since setHidden() is more far reaching in scope than just the visibility option that it's usage description indicates.
#14
Fixed for next release. Problem were ScopeAlways objects since they prevented the server object that's been removed from the scene to go out of scope and thus the ghosts couldn't be killed.
Also fixed the problem of only ShapeBase implementing setHidden() properly which solves the problem here with TSStatic. Now all SceneObject classes do it properly.
The reason hiding worked properly when using World Editor's hiding but not when using setHidden() was that World Editor manually sets the ghost to hide.
Yep indeed. I added documentation to SceneObject to that effect. setHidden() completely takes a SceneObject out of the scene and networking. isRenderEnabled is the flag that truly only affects visibility.
01/26/2011 (4:27 pm)
Fixed for next release. Problem were ScopeAlways objects since they prevented the server object that's been removed from the scene to go out of scope and thus the ghosts couldn't be killed.
Also fixed the problem of only ShapeBase implementing setHidden() properly which solves the problem here with TSStatic. Now all SceneObject classes do it properly.
The reason hiding worked properly when using World Editor's hiding but not when using setHidden() was that World Editor manually sets the ghost to hide.
Quote:setHidden() is more far reaching in scope than just the visibility option that it's usage description indicates.
Yep indeed. I added documentation to SceneObject to that effect. setHidden() completely takes a SceneObject out of the scene and networking. isRenderEnabled is the flag that truly only affects visibility.
#15
So setHidden() affects clients in multiplayer and isRenderEnabled only affects server?
01/26/2011 (5:25 pm)
Rene,So setHidden() affects clients in multiplayer and isRenderEnabled only affects server?
#16
Actually, both do. If you set isRenderEnabled on a server object, it will be networked to the client and take effect there (since rendering only happens on the client). Same goes for setHidden.
The difference is that setHidden() kills off the client-side stuff and completely takes the object out of the scene, i.e. it will be neither visible to rendering nor to collision detection or to anything else operating on scenes whereas isRenderEnabled is just a simple flag that causes ghost objects to be skipped for rendering.
01/26/2011 (5:32 pm)
Actually, both do. If you set isRenderEnabled on a server object, it will be networked to the client and take effect there (since rendering only happens on the client). Same goes for setHidden.
The difference is that setHidden() kills off the client-side stuff and completely takes the object out of the scene, i.e. it will be neither visible to rendering nor to collision detection or to anything else operating on scenes whereas isRenderEnabled is just a simple flag that causes ghost objects to be skipped for rendering.
#18
01/27/2011 (1:09 am)
Now im confused. If I had an object in game that I wish to completely 'ignore' for a time, setHidden() will 'delete' it from the client?
#19
If object "isHidden" it doesn't processed in simulation, so it doesn't ghosted to clients -- which means no object on client-side. And server ignores everything (collision/network/etc) for that object while running sim (as Rene stated above).
01/27/2011 (1:13 am)
Caylo: yes.If object "isHidden" it doesn't processed in simulation, so it doesn't ghosted to clients -- which means no object on client-side. And server ignores everything (collision/network/etc) for that object while running sim (as Rene stated above).
#20
01/27/2011 (8:40 am)
So, we don't want to have a guy stood on a bridge when we hide it ... cos it's a long way down ...
Associate Steve Acaster
[YorkshireRifles.com]