ok that worked but I needed to take the final value from 360 to get it to shoot in the right direction (EG. down or up depending on where I was).
But I have another problem that seems rather silly,
when I or the enemy shoots we both seem to max out our xangle at a certain ....well... angle.
So, I tryed to cheat alittle to make the task as simple as possible and I still get the exact same thing.
heres the mob ai to get the anglex
if bee(mob).state=2
`if bee is in range we need it to turn and shoot player
point object 1100+mob,camposx#,camheight#,camposz#
`get the angles
tax#=object angle x(1100+mob)
tay#=object angle y(1100+mob)
taz#=object angle z(1100+mob)
`return angles so we never notice the mob switching just following
point object 1100+mob,camposx#,bee(mob).y#,camposz#
`
tempx#=newxvalue(bee(mob).x#,bee(mob).ay#,25)
tempz#=newzvalue(bee(mob).z#,bee(mob).ay#,25)
erx#=bee(mob).x#-matrix position x(1)
erz#=bee(mob).z#-matrix position z(1)
fg=get ground height(1,erx#,erz#)
bee(mob).y#=fg+1400
bee(mob).x#=tempx#
bee(mob).z#=tempz#
bee(mob).ax#=tax#
bee(mob).ay#=tay#
bee(mob).az#=taz#
position object 1100+mob,bee(mob).x#,bee(mob).y#,bee(mob).z#
if timer()-bee(mob).shoot>bee(mob).shootdelay
gosub enemyshoot
gosub controlfireballs
bee(mob).shoot=timer()
endif
if object in screen(1100+mob)
text (object screen x(1100+mob)),(object screen y(1100+mob)),""+str$(bee(mob).state)
endif
endif
`mini map sprite for mob
mobx#=(((bee(mob).x#/tilesize)*xsize)/xsize)
moby#=ysize-(((bee(mob).z#/tilesize)*xsize)/xsize)
sprite 5100+mob,mobx#,moby#,6
As it says, there isnt any restrictions at all, but.... heres the fireball routine. This just finds the first free fireball to use then returns.
for bullet=1 to 100
if fireball(bullet).state=0
make object sphere 500+bullet,10
set object transparency 500+bullet,1
texture object 500+bullet,5000
fireball(bullet).ax#=tax#
fireball(bullet).ay#=tay#
fireball(bullet).az#=taz#
fireball(bullet).x#=newxvalue(bee(mob).x#,fireball(bullet).ay#,500)
fireball(bullet).y#=newyvalue(bee(mob).y#,fireball(bullet).ax#,500)
fireball(bullet).z#=newzvalue(bee(mob).z#,fireball(bullet).ay#,500)
position object 500+bullet,fireball(bullet).x#,fireball(bullet).y#,fireball(bullet).z#
SET OBJECT COLLISION ON 500+bullet
fireball(bullet).hp=200
fireball(bullet).state=1
fbtimer=timer()
inc bullets
return
endif
next bullet
Again, no restriction
anyway I hope someone knows or can figure out whats goin on, this is getting frustrating. Again thanks in advance.
cheers
crighton
Why are the forgotten always remembered? But no-one remembers me?!