Game Development Community

error attempting to call incscore...

by Ryan Ackley · in Torque Game Engine · 01/06/2002 (9:38 pm) · 3 replies

A funny thing: with one of my 3 weapons, i can kill people and commit suicide (via radius damage) and get credit for it, but with the other 2 i cannot... if i kill someone (or myself), the chat window says:

Ryan gets nailed by !

any idea on where to look to fix this? keeping score would be a good idea, methinks :)

its even weirder because one of the guns i just made today, and its basically a copy of the script that works, with different names for all the data blocks and such. they work and shoot and kill just fine, but dont give credit where credit is due. ive tried reading through the problem and tracing. the ondeath() calls inc score (and dec score, if thats the case) but i cant figure out why it doesnt know who did the killing!

Ryan

#1
01/07/2002 (12:30 pm)
fixed it... the projectiles didnt have a client that owned them, so incscore didnt know who fired them!

note: i used the spread tutorial, and he didnt have it, so neither did i :)

http://garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1714

check it for the fix i posted
ryan
#2
07/15/2007 (7:15 am)
Sorry to open an old thread. im having the same problem, eventhough i havent used this tutorial and my crossbowProjectile for example has a client :

// Create the projectile object
%p = new (%this.projectileType)() {
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %client;
};

now when i go to armor::onDamage(...) and i have the %sourceObject echoed it returns a number, when i use getDatablock().getName() it indeed does reflect it is a crossbowprojectile. but when i acces variables like %sourceObject.client/sourceSlot/sourceObject/dataBlock it all does return "".

ill submit something when i figure it out or maybe one of you guys can help
#3
07/15/2007 (7:45 am)
Obviously it should be client = %obj.client; and not %client.