bugs_
04-07-2007, 10:08 PM
So I got sidetracked on some deployable turret stuff. In zadmin and fstat
these lines are present but commented out in the deploy turret code:
// Client::setOwnedObject(%c lient, %turret);
// Client::setOwnedObject(%c lient, %player);
In normal zadmin the turret wouldn't be associated with the deployer and
the server logs the turret kills to killerId 0 in Client::onKilled()
if (!%killerId)
{
//turret
%damageType = $EnergyDamageType;
messageAll(0, strcat(%victimName, " dies."), $DeathMessageMask);
%playerId.scoreDeaths++ ;
}
So the kill isn't awarded to anyone and even the death is apparently not
tallied. I added the "%playerId.scoreDeaths++ ;" line to keep track of
this.
If you uncomment those Client::setOwnedObject lines you start getting some
nicer turret kill messages and the scoring can give the turret kill points
to the deployer.
My problem is disassociating the turret from the deployer when the deployer
drops or changes teams. I have tried a couple of things to get this to
happen and I have run out of ideas.
Does anyone know of a scripting way to undo the client::setownedobject() or
is it necessary to code an unsetownedobject() mem.dll function?
these lines are present but commented out in the deploy turret code:
// Client::setOwnedObject(%c lient, %turret);
// Client::setOwnedObject(%c lient, %player);
In normal zadmin the turret wouldn't be associated with the deployer and
the server logs the turret kills to killerId 0 in Client::onKilled()
if (!%killerId)
{
//turret
%damageType = $EnergyDamageType;
messageAll(0, strcat(%victimName, " dies."), $DeathMessageMask);
%playerId.scoreDeaths++ ;
}
So the kill isn't awarded to anyone and even the death is apparently not
tallied. I added the "%playerId.scoreDeaths++ ;" line to keep track of
this.
If you uncomment those Client::setOwnedObject lines you start getting some
nicer turret kill messages and the scoring can give the turret kill points
to the deployer.
My problem is disassociating the turret from the deployer when the deployer
drops or changes teams. I have tried a couple of things to get this to
happen and I have run out of ideas.
Does anyone know of a scripting way to undo the client::setownedobject() or
is it necessary to code an unsetownedobject() mem.dll function?