More vehicle Fun.
by Ian Roach · in Torque Game Engine · 09/18/2002 (7:01 pm) · 6 replies
Hello all.
I know there has been endless amount of Vehicle threads (Just goes to show how popular they are) but ive been having all sorts of trouble getting vehicles of any kind working.
2 things i want.
1) a working flying vehicle on latest head release.
Ive endlessly tried badguys drone tutorial with no avail. I can get it ingame but as soon as i try to mount it hurts the player (taking like 20 damage each time), I have no idea why and ive tried on old release version and new.
2) A working car model (basically what the racer mod does) but the ability to actually mount and dismount is where my problem lies.
Does anyone have either or both of the above working and possible give me an idea on what i need in the scripts ?
Any help would be much appreciated.
Thanks
I know there has been endless amount of Vehicle threads (Just goes to show how popular they are) but ive been having all sorts of trouble getting vehicles of any kind working.
2 things i want.
1) a working flying vehicle on latest head release.
Ive endlessly tried badguys drone tutorial with no avail. I can get it ingame but as soon as i try to mount it hurts the player (taking like 20 damage each time), I have no idea why and ive tried on old release version and new.
2) A working car model (basically what the racer mod does) but the ability to actually mount and dismount is where my problem lies.
Does anyone have either or both of the above working and possible give me an idea on what i need in the scripts ?
Any help would be much appreciated.
Thanks
About the author
#2
As it stands i cant even hop in and fly cuase just damages me. Occasionally ive had it not hurt me on collision. In which case i can jump all over the thing but never mount :/
Ive got a flyer model that works in tribes 2 (replacement of shrike ) and i just want to get it ingame :/
09/18/2002 (7:33 pm)
Yeh but it should be mounting and not damaging ?As it stands i cant even hop in and fly cuase just damages me. Occasionally ive had it not hurt me on collision. In which case i can jump all over the thing but never mount :/
Ive got a flyer model that works in tribes 2 (replacement of shrike ) and i just want to get it ingame :/
#3
09/19/2002 (4:51 pm)
No one has any vehicle scripts to share ?
#4
09/19/2002 (5:37 pm)
what exactly do you need, a script that mounts the player?
#6
first off player collides with vehicle (actually I think we need to change this because I can't run over ppl, maybe some mounting triggers would be better)
from player.cs
now on to vehicle.cs
In this function I can call animations, change the keys, or do anything else that is specific to this vehicle. Unmount is the same but in reverse. I hope this helps.
09/19/2002 (5:54 pm)
It isn't just one script but I will try to show you how to follow the scriptsfirst off player collides with vehicle (actually I think we need to change this because I can't run over ppl, maybe some mounting triggers would be better)
from player.cs
function Armor::onCollision(%this,%obj,%col)
{
if (%obj.getState() $= "Dead")
return;
//%forceVehicleNode
// Try and pickup all items
if (%col.getClassName() $= "Item")
%obj.pickup(%col);
%client = %obj.client;
// Mount vehicles
%this = %col.getDataBlock();
%dataBlock = %col.getDataBlock();
//now set for WHEELED and FLYING vehicals
if ((%this.className $= WheeledVehicleData || %this.className $= FlyingVehicleData||
%this.className $= WaterCraftData)
&& %obj.mountVehicle && %obj.getState() $= "Move" && %col.mountable) {
// Only mount drivers for now.
//%node = 0;
%node = findEmptySeat(%col, %this);
%col.mountObject(%obj,%node);
%obj.mVehicle = %col;
%dataBlock.playerMounted(%col,%obj, %node);
%client.currentMountedVehicle = %col;
}
}At this point the player is mounted, no call for any damage to the player has occured. I continue the mounting process with the playerMounted() call.now on to vehicle.cs
function SkyHawkFlyer::playerMounted(%data, %obj, %player, %node)
{
// scout flyer == SUV (single-user vehicle)
//commandToClient(%player.client, 'setHudMode', 'Pilot', "Shrike", %node);
$numVWeapons = 1;
echo("skyhawk controls for animation");
//WORKS
if(%player.isPilot())
%obj.schedule(500, "setThreadDir", $ActiveThread , false);
//%obj.playThread( $ActivateThread, "door_close");
//%obj.setThreadDir($ActiveThread, false);
skyHawkPilotMap.push();
// update observers who are following this guy...
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
} In this function I can call animations, change the keys, or do anything else that is specific to this vehicle. Unmount is the same but in reverse. I hope this helps.
Torque Owner TerroX
collDamageThresholdVel = 100;
collDamageThresholdVel = 0.080;
that may be causing the damage to the player.
collDamageThresholdVel is the speed at which damage will occur
and collDamageThresholdVel is the amount of damage.