Game Development Community

Scripting Question

by Donny Wilbanks · in Torque Game Engine · 04/08/2004 (11:33 am) · 3 replies

What does the "SPC" represent? I see it cropping up alot in the Beffy snippits. I have seen it used in Echo and non echo calls.

function findVehicle(%obj)
{
	%position = %obj.getTransform();
	%radius = 50;
	InitContainerRadiusSearch(%position, %radius, $TypeMasks::VehicleObjectType);

   	while ((%targetObject = containerSearchNext()) != 0)
   	{
		%dist = containerSearchCurrRadiusDist();
		echo("found vehicle:" [b]SPC[/b] %targetObject SPC ",distance is:" SPC %dist);
   	}
}

Oh and where can I get a list of Object Types? (such as VehicleObjectType) in the example above? or is that something more ore less unique to the individual designer not engine related? I think it's more engine related though.

#1
04/08/2004 (12:17 pm)
It is a concatenation operator that inserts a space. There's also TAB and @. @ inserts nothing, and TAB a tab.

I believe types are registered in game/main.cc.
#2
04/08/2004 (12:19 pm)
SPC just means a space, like " ". So if you were to write:

%myObj = "HealthPack";
echo ("Found item:" SPC %myObj);
You would get:
Found item: HealthPack

You can find a list of the Object Types below, they are all engine related:

$TypeMasks::CameraObjectType
$TypeMasks::CorpseObjectType
$TypeMasks::DamagableItemObjectType
$TypeMasks::DebrisObjectType
$TypeMasks::EnvironmentObjectType
$TypeMasks::ExplosionObjectType
$TypeMasks::ForceFieldObjectType
$TypeMasks::GameBaseObjectType
$TypeMasks::GoalObjectType
$TypeMasks::GuiControlObjectType
$TypeMasks::InteriorObjectType
$TypeMasks::ItemObjectType
$TypeMasks::MarkerObjectType
$TypeMasks::PhysicalZoneObjectType
$TypeMasks::PlayerObjectType
$TypeMasks::ProjectileObjectType
$TypeMasks::ShapeBaseObjectType
$TypeMasks::StaticObjectType
$TypeMasks::StaticRenderedObjectType
$TypeMasks::StaticShapeObjectType
$TypeMasks::StaticTSObjectType
$TypeMasks::TerrainObjectType
$TypeMasks::TriggerObjectType
$TypeMasks::VehicleBlockerObjectType
$TypeMasks::VehicleObjectType
$TypeMasks::WaterObjectType
#3
04/08/2004 (2:27 pm)
Thanks allot, This is really cool. Thanks for the list of object types. No to go do some experimenting...