Killing while mounted not credited to player
by Ronald J Nelson · in Technical Issues · 09/14/2005 (7:56 pm) · 2 replies
I am having a problem when my character is mounted to a vehicle and kills someone whether my running them over or by shooting them, it is not giving that character credit for the score. Any help on this would be appreciated.
#2
08/28/2006 (1:20 am)
Thanks Billy although I know I am a bit late in it. That worked great for running people over but my next question is if there is a weapon mounted to the vehicle, how can the player take credit for the kill from that weapon?
Torque 3D Owner Billy L
in your mountedImage::onFire add this
%source = %obj.getMountNodeObject(0);
and change the italic below
%p = new (%this.ProjectileType(){
..
client = %source.client;
..
};
for the collision you need to do Something like this
function WheeledVehicleData::onCollision(%this,%obj,%col,%vec,%speed) { %client = %obj.getMountNodeObject(0); if(%col.getType() & $Typemasks::PlayerObjectType) { if(%col.getState() !$= "Dead") { %col.damage(%client, VectorAdd(%obj.getPosition(),%vec) ,%speed * %this.speedDamageScale, "OverRunByVehicleDamage"); } } }You need to change things to fit your needs !I have lots more code in my script only took apart of it ,hope you understand the basic.