Melee | WeaponImage::onImageIntersect
by Pawel Stochlinski · in Torque Game Engine · 01/13/2005 (8:43 am) · 6 replies
Hi, i've just reimplemented the known Melee weapons support for the TGE.
All works perfect, animation, item pickup, nothing crashes - but the weapon doesn't do damage to the bots.
I've seen that this should be somehow injected :
[weapon.cs]
-- cut here --
function WeaponImage::onImageIntersect(%this,%player,%slot,%startvec,%endvec)
-- /cut here --
But this is not called, i've checked that setting up an debug error message
right after the function definition:
-- cut here --
function WeaponImage::onImageIntersect(%this,%player,%slot,%startvec,%endvec)
{
error("WeaponImage::onImageIntersect...");
// if damage sequence is not playing then dont do damage
-- /cut here --
The message doesn't show,
any idea ?
Maybe i should somehow call the function and i don't do that ?
Thanks for the reply.
All works perfect, animation, item pickup, nothing crashes - but the weapon doesn't do damage to the bots.
I've seen that this should be somehow injected :
[weapon.cs]
-- cut here --
function WeaponImage::onImageIntersect(%this,%player,%slot,%startvec,%endvec)
-- /cut here --
But this is not called, i've checked that setting up an debug error message
right after the function definition:
-- cut here --
function WeaponImage::onImageIntersect(%this,%player,%slot,%startvec,%endvec)
{
error("WeaponImage::onImageIntersect...");
// if damage sequence is not playing then dont do damage
-- /cut here --
The message doesn't show,
any idea ?
Maybe i should somehow call the function and i don't do that ?
Thanks for the reply.
#2
I'm getting my head ripped off with that..
01/13/2005 (8:57 am)
Yes, i'm totally sure about running this tut correctly.I'm getting my head ripped off with that..
#3
Damn maybe i'm really a little bit tired and i've lost my mind while implementing...
01/13/2005 (9:13 am)
Oh Josh, could U point me from which correct C source the function is called ?Damn maybe i'm really a little bit tired and i've lost my mind while implementing...
#4
Con::executef(this, "onImageIntersect", args...);
Make sure you included that line, and if you did and it still doesnt work, check that the rest of the function is correct. Step through it and see where the check is failing when it should be succeeding.
I apologize for making the tutorial in such a horrible format, but I did not yet then even know how to use pathces. :) Once I learned, I was too busy with other things to go back and change the tutorial. Additionaly, a patch would havethe downside that later versions of Torque that changed the functions I depend on would completely break the tutorial, whereas this way, you have to read through and understand most of the code anyway, so adapting it to a slightly modified version of Torque isnt as hard.
Good luck!
01/13/2005 (10:53 am)
Just do a ctrl f in the tutorial for "onImageIntersect" and I'm sure you will find some C++ line like Con::executef(this, "onImageIntersect", args...);
Make sure you included that line, and if you did and it still doesnt work, check that the rest of the function is correct. Step through it and see where the check is failing when it should be succeeding.
I apologize for making the tutorial in such a horrible format, but I did not yet then even know how to use pathces. :) Once I learned, I was too busy with other things to go back and change the tutorial. Additionaly, a patch would havethe downside that later versions of Torque that changed the functions I depend on would completely break the tutorial, whereas this way, you have to read through and understand most of the code anyway, so adapting it to a slightly modified version of Torque isnt as hard.
Good luck!
#5
@Josh, I thinks he's using the RW server side melee system.
01/13/2005 (12:03 pm)
The function that calls onImageIntersect is supposed to be in shapeBase.cc, make sure you have it.@Josh, I thinks he's using the RW server side melee system.
#6
And there is no word 'bout onImageIntersect there - well ?
01/13/2005 (12:08 pm)
Yes, I use Josh Moore's tut. And there is no word 'bout onImageIntersect there - well ?
Torque Owner Josh Moore