O.o slick game! Love that vehicle you've got there.
I've been messing around with that mine monster code. Not sure how you want us to post our updates so I'll just put it in the code box.
function handlemonster()
for id=O_bullet to O_bullet+N_bullet
SC_setObjectCollisionOff id
next id
inc ticker_monster
if ticker_monster>O_monster+N_monster then ticker_monster=O_monster
set vector3 6,object position x(O_player)-object position x(ticker_monster),object position y(O_player)-object position y(ticker_monster),object position z(O_player)-object position z(ticker_monster)
dist#(ticker_monster-O_monster) = length vector3(6)
for id=O_monster to O_monster+N_monster
dmy#=camera position y(0)-object position y(id)
if dist#(id-O_monster)<300
if M_health(id-O_monster)>0
oldx# = object position x(id)
oldy# = object position y(id)
oldz# = object position z(id)
px#=object position x(O_player)
py#=object position y(O_player)
pz#=object position z(O_player)
set vector3 6,px#-oldx#,py#-oldy#,pz#-oldz#
tempdist#(id-O_monster)=length vector3(6)
collide=SC_rayCast(O_level,px#,py#,pz#,oldx#,oldy#,oldz#,0)
if collide=0 then awake#(id-O_monster)=1 : seeplayer#(id-O_monster)=1
`only attack if monster is on same level as player
if awake#(id-O_monster)=1
if abs(dmy#)<100.0 and abs(dmy#)>-10.0 and collide=0
`ATTACK
if dist#(id-O_monster)<40
if B_monster(id-O_monster)=0
dec health,5
B_monster(id-O_monster)=80
loop object id+1000,20,40
endif
endif
`RUN
`run directly to player when monster sees them
if dist#(id-O_monster)>40 and dist#(id-O_monster)<300
if B_monster(id-O_monster)=0
move object id,1
loop object id+1000,1,20
turn#=180-wrapvalue(object angle y(id)-atanfull(object position x(O_player)-object position x(id),object position z(O_player)-object position z(id))-180)
endif
endif
else `run around wild because they lost player
if dist#(id-O_monster)>40 and dist#(id-O_monster)<300
if B_monster(id-O_monster)=0
move object id,1
loop object id+1000,1,20
if tempdist#(id-O_monster)<100 then seeplayer#(id-O_monster)=0
if seeplayer#(id-O_monster)=0 then turn# = -360+rnd(720)
endif
endif
endif
endif
if turn#>5
yrotate object id,object angle y(id)+4
else
if turn#<-5
yrotate object id,object angle y(id)-4
endif
endif
if B_monster(id-O_monster)>0 then B_monster(id-O_monster)=B_monster(id-O_monster)-1
if T_monster#(id-O_monster)<=0
if B_monster(id-O_monster)=0
if rnd(50)=1
if sc_sphereSlide(0,oldx#,oldy#,oldz#,oldx#,oldy#+4,oldz#,R_monster,id)=0
T_monster#(id-O_monster)=7
endif
endif
endif
else
if T_monster#(id-O_monster)>0 then T_monster#(id-O_monster)=T_monster#(id-O_monster)-0.1
endif
move object up id,T_monster#(id-O_monster)-5
x# = object position x(id)
y# = object position y(id)
z# = object position z(id)
collide = sc_sphereSlide(0,oldx#,oldy#,oldz#,x#,y#,z#,15,id)
if collide>0
position object id,sc_getCollisionSlideX(),sc_getCollisionSlideY(),sc_getCollisionSlideZ()
endif
sc_updateObject id
else
if object frame(id+1000)<40 then loop object id+1000,40,60
if object frame(id+1000)>60-1 then stop object id+1000
endif
endif
next id
for id=O_bullet to O_bullet+N_bullet
SC_setObjectCollisionOn id
next id
endfunction
This replaces the old one:
global ticker_monster
ticker_monster=O_monster
dim dist#(N_monster)
dim awake#(N_monster)
dim tempdist#(N_monster)
dim seeplayer#(N_monster)
for id=0 to N_monster
dist#(id)=500
awake#(id)=0
tempdist#(id)=0
seeplayer#(id)=0
next id
I've added the following:
*monster uses a waypoint to keep tabs on players last visible location
*monster runs around wild when they've lost player
*monster only attacks a player on the same level as it, other wise it runs around wild
Try not to shoot it, but just watch it with the map in wireframe. I slowed down the monster intentionally so you could see it do it's stuff.
Its not what you know, its who you know.