Game Development Community

Killer vehicles

by Scott Schaefer · in Torque Game Engine · 02/03/2002 (1:27 pm) · 6 replies

Thanks badguy for the vehicle tutorial. It worked great for me except for one minor detail...

If I try to "remount" the vehicle is kills my player, lol! I did follow the code in the tutorial and get no errors in my console, and I'm stumped. It is pretty amusing though.

Just wondering if any of you guys had this same problem.

Scott

#1
02/03/2002 (6:45 pm)
Scott ..
im pretty sure this is happening because
A: there is a problem in your Armor::doDismount(..)
function .. you must make sure the mountVehicle variable is set and if your scheduling the MountVehicles function ..
be sure to have changed the spelling on that from
setMountVehicle to MountVehicles as it is now named
or ..

B: as well make sure in Armor::onUnmount(..)
that you set
%vehicle.mountable=true;
.. other than that Im not to sure what it can be lemme know if this dont help
#2
02/05/2002 (1:54 am)
I too am having trouble with the vehicle tutorial

Ive done all the changes including the ones youve suggested and i can spawn the vehicle fine

but it will not mount.

no idea why :(

can sumone perhaps show there player.cs file ?

also my code to spawn the vehicle Ctrl-F doesnt spawn

it says it console . Player Spawns !

any suggestions ?
#3
02/05/2002 (2:10 am)
well ..
i think perhaps take a closer look at the vehicle script you are using .. as well what are the console error messages? as there Must be some
resolving those would rectify this im sure
at first glance im thinking .. are you sure you can spawn the vehicles thru the editor using the field
Vehicles in the shapes category
if not it is no doubt your spelling of category in the vehicle script is maybe catagory

and if this doesnt do .. im sure the player.cs is still available as a link to a comment stemmed from the tutorial you found the ctrl-f feature at maybe go over that tut one more time as im sure it works

and when having the vehicle selected in the editor after spawning what is its dataBlock type?
#4
02/05/2002 (2:26 am)
Hey thanks for the quick reply

In regards to ure questions i have uploaded 2 images which might help you

www.users.bigpond.net.au/Roachie/editordrone.jpg

and

www.users.bigpond.net.au/Roachie/adddrone.jpg

any help ?

btw the vehicle script is the one supplied in the zip file with no changes.
#5
02/05/2002 (2:43 pm)
Your function Armor::onUnmount in Player.cs should look like this.

function Armor::onUnmount( %this, %obj, %vehicle, %node )
{
if (%node == 0)
%obj.mountImage(%obj.lastWeapon, $WeaponSlot);
%vehicle.mountable=true; //<--added line
}

Now I can remount my vehicles! Thanks for the tutorial, badguy. This little drone is actually half-assed fun to fly around :)

Scott
#6
02/05/2002 (3:05 pm)
Samea:
you must first make sure that when spawning the vehicle it is done from the Shapes--Vehicles category
otherwise it will not load as a Vehicle
secondly I see you are prolly unable to do this as it is prolly not there; when you ctrl-f i see many errors in your console starting with the statement
Drone is not a valid datablock class ..
are you Sure you executed these scripts? :)

above the
exec("./player.cs");

look farther back in the console to where they were to be executed ..
and verify that indeed they compiled and executed without issue .. lemme know what that case is

Scott :
Right on :)