Game Development Community

Script syntax

by Edward Gardner · in Torque Game Engine · 08/22/2001 (10:13 am) · 6 replies

In the Tribes Vehicle scripts, there is an entry for the position of the player model (not coordinates, but actual position of the model, standing versus sitting).

What is the, or is there, syntax for hiding the player model altogther?

#1
08/22/2001 (11:19 am)
You could use the ShapeBase::hide(bool) function. I'm not sure what it's going to do if the client is still controlling the player shape though. You'd probably want to shift the client to controlling the vehicle, then hide his body.

%client->setControlObject(%vehicle);
%player->hide(true);
#2
08/22/2001 (11:24 am)
I'll try that.

I was hoping that there would be something like playerModel=hidden since it's like that for standing and sitting in the vehicle_shrike.cs

C'est la vie :)
#3
08/22/2001 (11:40 am)
You could try adding this to the Armor::onMount function in player.cs:

if (%vehicle.getDatablock().mountVisible[%node] == 0)
{
%obj.startFade(0,0,true);
}


Then in Armor::onUnmount add:
if (%vehicle.getDatablock().mountVisible[%node] == 0)
{
%obj.startFade(0,0,false);
}


Then to make this work you would need to add some code to your vehicle spawn routine:

%obj = new HoverVehicle()
{
dataBlock = %block;
...
...
mountVisible[0] = 0;
mountVisible[2] = 0;
...
...
}
#4
08/22/2001 (12:04 pm)
That actually looksl ike it would work. I'll give that a shot.
#5
08/22/2001 (2:29 pm)
So from the tutorial:

function serverCmdAddFlyer(%client)
{
if (%client.player.isMounted())
return;

%vehicle = new FlyingVehicle()
{
dataBlock = ScoutFlyer;
mountVisible[0] = 0;
mountVisible[2] = 0;
};
MissionCleanup.add(%vehicle);
%vehicle.mountable = true;
%vehicle.setTransform( %client.player.getEyeTransform() );

}


-edit-

answered my own question, yes, that works like a charm.
#6
08/22/2001 (2:36 pm)
Yes