Game Development Community

Vehicle Creation

by Stephen · in Torque Game Engine · 06/11/2006 (6:11 pm) · 2 replies

I have been trying to find some way to get vehicles to respawn when destroyed. Right now, I have been using the vehicle spawner from the TGE vehicle resource, just for testing. But now I would like to get the vehicles to respawn where they was created in the World Editor. I was looking at TDN and in "Creating a Simple Flying Vehicle" and saw this line in the function FlyingVehicle::onDamage

if(%obj.respawnTime !$= "")
      %obj.marker.schedule = %obj.marker.data.schedule(%obj.respawnTime, "respawn", %obj.marker);

So how can I get the vehicles to respawn when destroyed?

Thanks

#1
06/12/2006 (8:41 pm)
Anyone got any ideas?
#2
06/12/2006 (9:06 pm)
Use the same technique that the starter.fps does, and create a spawn sphere for your vehicles.

Take a look at how the spawn location happens in starter.fps--search for GameConnection::onClientEnterGame in /server/scripts/game.cs and trace through the execution calls.