there's a few reasons why that isn't working.
the code your using to kill the player doesn't state that it should only kill the player, it's just not going to work.
you got the whole entitycollided thing right, though it says array index out of bounds because the "x" is supposed to be the array for the bullet, not the "type" for it. Try this code in replace of your original code that makes everything it touches disapear.
For q=0 to fullmag
if EntityCollided(bullet(q),whatever the collision type is for your player eg. type_player) Then
HideEntity whatever the name of your player is
EndIf
Next
that should work, but here's some advice that I learned through many problems with collisions. Try using entitydistance, trust me, it will save you many hours of painfull work with collisions. Here's the code I would actually use for that, player will be whatever the name or your player is:
For q=0 to fullmag
if EntityDistance(bullet(q),player)=<1 Then
HideEntity player
EndIf
Next
trust me, entitydistance is a much easier to use command, and will let the collisions of your game be less of a hassle.
here's som more advice :D
I only use collisions for speeding up the game, by the sounds of it you know how to shoot the bullets and whatever else. but here's a hint, use this line of code in your game in your main loop, and make sure this is the only line of code that involves collisions. Use entitydistance for everything else.
If countcollisions(bullet(q)) then hideentity bullet(q) : positionentity bullet(q),0,-10,0 : rotateentity bullet(q),0,0,0
then make sure to call the showentity command when you fire the bullet again.
hope I helped, and that I didn't confuse you :D
Andrew
the code your using to kill the player doesn't state that it should only kill the player, it's just not going to work.
you got the whole entitycollided thing right, though it says array index out of bounds because the "x" is supposed to be the array for the bullet, not the "type" for it. Try this code in replace of your original code that makes everything it touches disapear.
For q=0 to fullmag
if EntityCollided(bullet(q),whatever the collision type is for your player eg. type_player) Then
HideEntity whatever the name of your player is
EndIf
Next
that should work, but here's some advice that I learned through many problems with collisions. Try using entitydistance, trust me, it will save you many hours of painfull work with collisions. Here's the code I would actually use for that, player will be whatever the name or your player is:
For q=0 to fullmag
if EntityDistance(bullet(q),player)=<1 Then
HideEntity player
EndIf
Next
trust me, entitydistance is a much easier to use command, and will let the collisions of your game be less of a hassle.
here's som more advice :D
I only use collisions for speeding up the game, by the sounds of it you know how to shoot the bullets and whatever else. but here's a hint, use this line of code in your game in your main loop, and make sure this is the only line of code that involves collisions. Use entitydistance for everything else.
If countcollisions(bullet(q)) then hideentity bullet(q) : positionentity bullet(q),0,-10,0 : rotateentity bullet(q),0,0,0
then make sure to call the showentity command when you fire the bullet again.
hope I helped, and that I didn't confuse you :D
Andrew