How to detect if 1 entity has hitted another...

Posted By: PeterM

How to detect if 1 entity has hitted another... - 06/20/07 19:47

Hey I am wondering how would i detect when one entity hits another with a sword?
I have no idea how to do that...

tnx for your help.
Posted By: Slin

Re: How to detect if 1 entity has hitted another.. - 06/20/07 20:34

I think that it is usually done by a c_trace.
If it hitted an other entity, the you pointer is set to that entity and you can do what ever you want with it. c_scan should work, too.

Just look it both up in the manual.
Posted By: Gordon

Re: How to detect if 1 entity has hitted another... - 06/20/07 20:35

event_impact is all that you need there is no need to check before with c_trace or c_scan.

Posted By: Slin

Re: How to detect if 1 entity has hitted another.. - 06/20/07 20:38

Quote:

event_impact




But this could make some troubles with collision detection.
And the sword has to be turned and moved through c_move and c_rotate.

But for a lot of other things this would be the way to go
Posted By: PeterM

Re: How to detect if 1 entity has hitted another.. - 06/20/07 21:17

wouldnt event_impact be a problem if i hit my entity in another withouth swinging a sword wouldnt that count as a hit?

Oh and could someone tell me where can i find good literature or tutorials for simple AI?
Posted By: Xarthor

Re: How to detect if 1 entity has hitted another.. - 06/21/07 11:38

Set the sword to 'passable' and do a trace every frame (while you swing it) from the bottom of the blade to the tip of it.
Set the trace_mode 'activate_shoot' to have an indicator for the other entity if it was hit by a sword trace or just another trace
© 2024 lite-C Forums