Collision question

Posted By: DLively

Collision question - 06/11/09 19:57

Hello Everyone,

I am trying to use the sword demo style of code, from AUM12(I think laugh ) in my game.


It works as so:

When player is in his attack frames, the sword traces from the tip of the blade, to the hilt; and if result!=0 and if you!=null, you.health -= sword power.


it works, but only if im hitting near its x position; not its animated frame position.


how do i set it up so that my enemies will be able to be hit anywhere?

Hope thats descriptive enough laugh


http://i149.photobucket.com/albums/s69/sdsdinc/SWORDPROBLEMO.png


thanks for you time.
Posted By: the_mehmaster

Re: Collision question - 06/11/09 20:32

You need to run the instruction 'c_updatehull(me, frame);' where 'frame' is the enemy frame, and 'me' is the enemy pointer. this must run every few frames (not every frame, too slow!). eg:
Code:
while(1)
{
 c_updatehull(me, frame);
 wait(5);
}

Posted By: DLively

Re: Collision question - 06/11/09 21:51

I looked it up in the manual, and still, i dont get how that command works...
Posted By: EvilSOB

Re: Collision question - 06/11/09 22:40

I take it you are using "c_trace" when checking from blade tip to hilt?
Add USE_POLYGON to the c_trace mode flags and I think it will solve the issue.
Posted By: DLively

Re: Collision question - 06/11/09 23:57

I've tried use_polygone, doesn't work...
Posted By: testDummy

Re: Collision question - 06/12/09 00:52

It seems, historically, only polygons from an ENTITY's first frame were detected when using c_trace + USE_POLYGON.

Expanding and contracting the ENTITY's bounding box quickly and properly might work. Of course, the problem might not be fully understood here.

Derived from some version of some manual.
Code:
my.frame = n;
vec_for_min(my.min_x, my);
vec_for_max(my.max_x, my);  		

..and served up for no apparent reason.
Posted By: DLively

Re: Collision question - 06/12/09 04:00

why is frame defined here?
Posted By: DLively

Re: Collision question - 06/12/09 17:36

any other input out there??
Posted By: vlau

Re: Collision question - 06/13/09 06:16

Model's bounding box may change when playing
animation. Update the bounding box with
c_setminmax each frame may help.
© 2024 lite-C Forums