bullets should not collide

Posted By: Hawk

bullets should not collide - 05/03/07 22:10

I used the search function but didn't find the answer..
I don't know how to avoid that the bullets don't collide in the air. I fire them out of a shotgun and because of the scatter they often hit each other. They move via c_move, but i can't ignore models because then they wouldn't hit the enemies. I tried to use ignore_push, but all bullets share the same action and so they all have the same push value. The consequence of this is that they still hit each other, because the ignore_push mode ignores only lower push values. A solution would be to set the bullets passable for the first quants, but what if the enemy is allready close to the player? He would miss him all the time. That's why I don't want to use that.

Do you have any ideas?
Posted By: MrCode

Re: bullets should not collide - 05/03/07 22:46

Are the bullets going in random directions, or are they gradually moving away from each other?

it would be better if they moved away from each other, because then you wouldn't have that problem.
Posted By: Hawk

Re: bullets should not collide - 05/03/07 22:55

the bullets get all the same target and move there with some random coordinates.
how can i make them to move away from each other?
Posted By: ambe

Re: bullets should not collide - 05/03/07 23:04

well, I suspect they whould get stuck either way seeing as they start out small and then spread out..
Posted By: Hawk

Re: bullets should not collide - 05/03/07 23:16

hm you're right ambe, cuz if they hit each other it's always immediately in front of the player
Posted By: tompo

Re: bullets should not collide - 05/04/07 11:31

Maybe try to use if(you != bullet){stop;} else{keep going;} in bullet trace/move action?
Or make bullet passable because it still be able to collision detection even with passable =on;
Posted By: Scorpion

Re: bullets should not collide - 05/04/07 12:46

just use push and move with the option ignore_push
Posted By: ambe

Re: bullets should not collide - 05/04/07 13:26

well, he saied he tryed that already ...
Posted By: Scorpion

Re: bullets should not collide - 05/04/07 14:03

sorry thought c_moves ignore push worked diffrent...so i would see the only way in setting them , if they collide to passable and after a frame again non passable, but maybe thell then go jsut slowly through eachother..don' know
Posted By: Metal_Man

Re: bullets should not collide - 05/04/07 15:53

Wouldn't it be more efficient to c_trace the shot instead of using a moving bullet model?

With a shotgun you could use c_scan and then c_trace to see if anything is in the way.
Posted By: vlau

Re: bullets should not collide - 05/04/07 16:24

or try vec_dist.

Code:

if (vec_dist(my.x,enemy.x) < dist)
{
enemy.health -= 1;
if (enemy.health <= 0)
{
enemyDie();
}
}


Posted By: Hawk

Re: bullets should not collide - 05/07/07 11:32

sry has been a while since my last post..
thanks for your ideas, i am satisfied with my current result although they are still colliding from time to time. But nevertheless my main issue has been solved because the bullets don't create any bulletholes and dust anymore if they collide with each other. I didn't think about pointers, so thanks for the hint tompo
I didn't tried everything because I don't want to change my shooting script anymore. The game isn't a fps anyways, so the current script is ok for me. I will occupy myself with the colliding when i have more time. For now i just want to get things working. If the bullets collide they just remove themselfes and my current explanation for missing bullets is that they are duds
Posted By: vartan_s

Re: bullets should not collide - 05/07/07 12:56

"still colliding from time to time". So sometimes your shotgun shoots 8 bullets, sometimes 5? Not a good idea in my opinion. I had this problem a while ago, I tried making a while loop to distribute different push values to the bullets but this didn't work as smaller push values still collided with larger push values. Therefore, I recommend giving bullets a skill value of 1, with other objects being 0, and on collision check if the skill value of the thing it collided with is 1 or 0. If it is 0, remove it and do damage, smoke etc. If it is 1, do nothing; the bullets will then pass each other . Works fine for me. c_trace also works, but then you can't do tracers and stuff like that, and also the bullet will always reach the target immediately.
Posted By: xXxGuitar511

Re: bullets should not collide - 05/07/07 21:31

use a regulated c_trace()...

Same as above, but do'nt do the full trace, just from units of distance at a time...
Posted By: miez

Re: bullets should not collide - 05/08/07 09:37

If the bullets have to be entitys and NO trace (for slow bullets in bullettime and such stuff...)
Make the bullets sprites and use C_move with ignore sprites.
Works fine in most situations, because everything I shoot at in my game are modelentities, even Windowglass (some people use sprites).
© 2024 lite-C Forums