Im using Matedit 1.6b together with DBC. I tried to follow the tutorials posted on this site which makes use of HOTSPOT (e.g. Limit Rush) but i want to make use of MatEdit's zone instead so that the enemy racer will only follow the path designated as zone 1 or zone 2, i manage to make it follow throught the zone in a staight path but the problem is "it is not able to turn left or right when i programmed it to(preety stupid of me)". Can anyone suggest what's wrong? here is the code:
`-----------------------------------
`racing artificial intelligence
`-----------------------------------
function control_player(id)
X=object position x(id)
Z=object position z(id)+36.5
Zone=CheckZone(X,Z)
xPos#=object position x(id)
zPos#=object position z(id)
yAng=object angle y(id)
if zone=1 or zone=2
forward=1
left=0
right=0
backward=0
else
X2=object position x(id)+15
Z2=object position z(id)
Zone2=CheckZone(X2,Z2)
if zone2=1 or zone2=2
` targetXPos=X2
`targetZPos=Z2
right=1
else
` targetXPos=object position x(id)-15
` targetZPos=object position z(id)
left=1
endif
`angle#=atanfull(targetXPos-xPos#,targetZPos-zPos#)-yAng
`work out direction to turn
`if angle#<-180
` left=1
`else
` right=1
endif
move_player(id,forward, backward, left, right)
endfunction
ive included the remarks so that you can see what changes ive tried to made.
phukol