Starter.fps Kork problem
by DejaBlue · in Torque Game Engine · 10/27/2005 (6:54 pm) · 5 replies
OK this is on a fresh install. i go into game and kill Kork after he dies i get a
starter.fps/server/scripts/player.cs (810): Unable to find object: '' attempting to call function 'onDeath'
player.cs line 810 is
%client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
which is part of
function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
if (%obj.getState() $= "Dead")
return;
%obj.applyDamage(%damage);
%location = "Body";
// Deal with client callbacks here because we don't have this
// information in the onDamage or onDisable methods
%client = %obj.client;
%sourceClient = %sourceObject ? %sourceObject.client : 0;
if (%obj.getState() $= "Dead")
%client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
}
just to show you ondeath found in game.cs
function GameConnection::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc)
{
// Clear out the name on the corpse
%this.player.setShapeName("");
// Switch the client over to the death cam and unhook the player object.
if (isObject(%this.camera) && isObject(%this.player)) {
%this.camera.setMode("Corpse",%this.player);
%this.setControlObject(%this.camera);
}
%this.player = 0;
// Doll out points and display an appropriate message
if (%damageType $= "Suicide" || %sourceClient == %this) {
%this.incScore(-1);
messageAll('MsgClientKilled','%1 takes his own life!',%this.name);
}
else {
%sourceClient.incScore(1);
messageAll('MsgClientKilled','%1 gets nailed by %2!',%this.name,%sourceClient.name);
if (%sourceClient.score >= $Game::EndGameScore)
cycleGame();
}
}
this is after i kill Kork... been all over the search feature but nothing fixes this that i can find
starter.fps/server/scripts/player.cs (810): Unable to find object: '' attempting to call function 'onDeath'
player.cs line 810 is
%client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
which is part of
function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
if (%obj.getState() $= "Dead")
return;
%obj.applyDamage(%damage);
%location = "Body";
// Deal with client callbacks here because we don't have this
// information in the onDamage or onDisable methods
%client = %obj.client;
%sourceClient = %sourceObject ? %sourceObject.client : 0;
if (%obj.getState() $= "Dead")
%client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
}
just to show you ondeath found in game.cs
function GameConnection::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc)
{
// Clear out the name on the corpse
%this.player.setShapeName("");
// Switch the client over to the death cam and unhook the player object.
if (isObject(%this.camera) && isObject(%this.player)) {
%this.camera.setMode("Corpse",%this.player);
%this.setControlObject(%this.camera);
}
%this.player = 0;
// Doll out points and display an appropriate message
if (%damageType $= "Suicide" || %sourceClient == %this) {
%this.incScore(-1);
messageAll('MsgClientKilled','%1 takes his own life!',%this.name);
}
else {
%sourceClient.incScore(1);
messageAll('MsgClientKilled','%1 gets nailed by %2!',%this.name,%sourceClient.name);
if (%sourceClient.score >= $Game::EndGameScore)
cycleGame();
}
}
this is after i kill Kork... been all over the search feature but nothing fixes this that i can find
About the author
#3
messageAll('MsgClientKilled','%1 gets nailed by %2!',%this.name,%sourceClient.name);
Happen to know what would cause this?
10/27/2005 (7:13 pm)
Fix worked fine to get rid of the error. but i am not getting the msgmessageAll('MsgClientKilled','%1 gets nailed by %2!',%this.name,%sourceClient.name);
Happen to know what would cause this?
#4
*steals fix* ;D
10/31/2005 (2:11 pm)
I didn't look around but there may just me no code to handel MsgCleintKilled. Look through the code.*steals fix* ;D
#5
The key is that any animation called "Death" is significant to Torque. So name your death animations something else, like "die" or "argh." I renamed my death animation to "die" and made the following changes. In armor::damage,..
if(%client) {
%client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
} else {
if(%obj)
%obj.death();
And on the object, in this case AIManager:
function AIPlayer::death(%this) {
%this.setActionThread("die");
}//F
This worked a treat :)
10/30/2006 (8:36 pm)
I dunno if this is any use, but I also got past this using some advice from here.The key is that any animation called "Death" is significant to Torque. So name your death animations something else, like "die" or "argh." I renamed my death animation to "die" and made the following changes. In armor::damage,..
if(%client) {
%client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
} else {
if(%obj)
%obj.death();
And on the object, in this case AIManager:
function AIPlayer::death(%this) {
%this.setActionThread("die");
}//F
This worked a treat :)
Torque Owner Paul Jan
A fix would looks something like
if (%client && %obj.getState() $= "Dead")
%client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
but since its not a fatal error, no one really bothers. :D