Not a bug but - $Typemasks for Markers Only Work In Editor
by Steve Acaster · in Torque 3D Professional · 10/28/2010 (3:32 am) · 2 replies
T3D 1.1 beta 3 (and beta 2 - haven't checked further back)
win7 32bit
Issue
Spawnsphere/Waypoint don't show up in containerRadiusSearch() at all - thus making them undetectable using raycasts and typemasks.
However they can be found in the hierarchy of gamebase and shapebase (gamebaseObjectType and shapebaseObjectType) BUT only if the editor is open.
Thus meaning that the containerRadiusSearch still cannot detect a spawnsphere/waypoint in-game.
Repeat
Make sure that you have this script function somewhere for testing
Start up T3D
Load a level/mission
Stick some waypoints and spawnspheres in it (World Editor -> library -> Scripted Objects -> Misc
Go back to the game - not in the editor.
Bring up the console and type findGameBase() - see the array show the player in the console but no waypoints/spawnspheres
Now go into the World Editor and bring up the console again and type findgamebase() again - see the array show all the waypoints/spawnspheres in the console this time.
These markers can only be found using gamebase/shapebase when the editor is open
Suggest
Make the SpawnSphere/waypoint markers detectable to raycasts/typemasks in-game and not just esoterically hidden in editor, as currently it's impossible to test whether there is a spawnpoint within a containerRadiusSearch --- I guess this means ghosting (but not sure). Suggest add them to the MarkerObjectType which is called a "Path Node" even though it's class is a "Marker".
EDITED to make sense and clear up a misunderstanding I had.
Double edit: Markers also don't show up their typemask until they have been made visible in the editor ...
Triple edit: Going back to 1.0.1 it seems like it's always been this way, though it does appear a little odd that the typemasks of markers don't function in-game.
Post gonk edit:
As Guy points out below, not a bug, though I still think it'd be useful to have some sort of marker (say Waypoint Object ... cos it's actually not doing anything in the engine) that could be detected with raycasts during play.
last edit
Don't consider this a request it's more of an opinion ... moved out of bug forum to general
win7 32bit
Issue
Spawnsphere/Waypoint don't show up in containerRadiusSearch() at all - thus making them undetectable using raycasts and typemasks.
However they can be found in the hierarchy of gamebase and shapebase (gamebaseObjectType and shapebaseObjectType) BUT only if the editor is open.
Thus meaning that the containerRadiusSearch still cannot detect a spawnsphere/waypoint in-game.
Repeat
Make sure that you have this script function somewhere for testing
function findGamebase()
{
if(!isObject($Markerlist))
{
$MarkerList = new arrayobject();
MissionCleanup.add($MarkerList);
}
%playerPos = LocalClientConnection.getControlObject().getPosition();
$MarkerList.empty();
InitContainerRadiusSearch(%playerPos, 500, $TypeMasks::GameBaseObjectType);
while ((%obj = containerSearchNext()) != 0)
{
$MarkerList.add(%obj, %obj.getClassname());
echo("in radius search loop");
}
$MarkerList.uniqueKey();
$MarkerList.echo();
}Start up T3D
Load a level/mission
Stick some waypoints and spawnspheres in it (World Editor -> library -> Scripted Objects -> Misc
Go back to the game - not in the editor.
Bring up the console and type findGameBase() - see the array show the player in the console but no waypoints/spawnspheres
Now go into the World Editor and bring up the console again and type findgamebase() again - see the array show all the waypoints/spawnspheres in the console this time.
These markers can only be found using gamebase/shapebase when the editor is open
Suggest
Make the SpawnSphere/waypoint markers detectable to raycasts/typemasks in-game and not just esoterically hidden in editor, as currently it's impossible to test whether there is a spawnpoint within a containerRadiusSearch --- I guess this means ghosting (but not sure). Suggest add them to the MarkerObjectType which is called a "Path Node" even though it's class is a "Marker".
EDITED to make sense and clear up a misunderstanding I had.
Double edit: Markers also don't show up their typemask until they have been made visible in the editor ...
Triple edit: Going back to 1.0.1 it seems like it's always been this way, though it does appear a little odd that the typemasks of markers don't function in-game.
Post gonk edit:
As Guy points out below, not a bug, though I still think it'd be useful to have some sort of marker (say Waypoint Object ... cos it's actually not doing anything in the engine) that could be detected with raycasts during play.
last edit
Don't consider this a request it's more of an opinion ... moved out of bug forum to general
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
#2
Yeah, I was beginning to think that ... but was posting at an ungodly hour
Why do I always hit issues at 5am!?!?!
I'll update the title as not being a bug.
10/28/2010 (1:29 pm)
Yawwwwnn.....Yeah, I was beginning to think that ... but was posting at an ungodly hour
Why do I always hit issues at 5am!?!?!
I'll update the title as not being a bug.
Torque Owner Guy Allard
Default Studio Name
MissionMarker derived objects (spawnSphere, wayPoint etc) are not actually part of the scene during gameplay. If you look at missionMarker.cpp, MissionMarker::onEditorEnable and MissionMarker::onEditorDisable, the markers are only added to the scenegraph when the editor is opened, and are removed again from the scenegraph when the editor is closed. During gameplay they do not exist as part of the scenegraph.
Because the markers don't actually exist as part of the scene, they cannot be found using ray casts or radius searches.
Although they are not part of the scene, they are still part of the sim, so if you keep your markers in named simSets/Groups, you can iterate over them from within the engine, and manually compare positions/distances etc.