well it's coming along. but for some reason sparky ray casting does not seem to be detecting hits in poly mode. I switched the zombie to box and it works just fine. I would love to use "SC_drawObjectBounds". but it won't draw lines for poly collisions >.<
I know it should be the objects bounds. All I know is that it will only mark a hit for certain areas of the model. not even limbs. just parts. I can shoot the left side of the chest and get nothing. then move it to the middle and get a hit. heck I can even miss over the shoulder and still get a hit. It's kinda got me worried.
edit : did not see your post. yah, give me a minute
well monsters die normally now. so that fixed itself
the code below is in the firing system. and sees if there was a hit for an object. if there was it will look and see if the object belongs to a monster. if it does then it sees how high the shot was.
`check for hit
collide = SC_rayCastGroup(1,camera position x(0),camera position y(0),camera position z(0),object position x(2),object position y(2),object position z(2),0)
if collide > 0
`find out what slot the object belongs to
`find a free slot in the array.
arrayfind=0
donefindingai = 0
repeat
`check to see the array holds a valad number
if badguys(arrayfind,2) = collide
donefindingai = 1
else
inc arrayfind
endif
`if there is no free slot, exit
if arrayfind > arraysize
donefindingai = -1
endif
UNTIL donefindingai = 1 or donefindingai = -1
`if a hit
if donefindingai = 1
`find out how hight the hit was. if it was a head shot. do more damage
debug3 = (SC_getStaticCollisiony() - object position y(badguys(arrayfind,2)) )
if debug3 > 12 <--- this is to see if the shot was in the head area
dec badguys(arrayfind,1),100
else
dec badguys(arrayfind,1),10
endif
endif
endif
endif
edit 2:
well after experimenting it seems the game has shifted the hit-box for the object to the left and up. 0.o any idea why sparky would do that?
edit 3: no. it was not that at all. for some reason the object I made to assist in raycasting is not centered in the target. but is lower and to the right. I don't remember doing anything to it's code. but that does not matter. now I know what to do.