here is my code
ai start
make object plain 1,100,100
xrotate object 1,90
AUTOCAM OFF
make object sphere 10,2.5 : color object 10,rgb(255,000,000)
make object sphere 2,5
color object 2, rgb(255,000,000)
ai add enemy 2,2
make object sphere 3,5
color object 3, rgb(255,255,000)
ai add enemy 3,3
make object sphere 4,5
color object 4, rgb(255,255,255)
ai add enemy 4,4
make object sphere 5,5
color object 5, rgb(000,255,000)
ai add enemy 5,4
AI Debug Show Paths 2.5
AI Set Entity Speed 2,10
AI Set Entity Speed 3,10
AI Set Entity Speed 4,10
AI Set Entity Speed 5,10
AI Set Entity Patrol Time 2,-10
AI Set Entity Patrol Time 3,-10
AI Set Entity Patrol Time 4,-10
AI Set Entity Patrol Time 5,-10
do
if keystate(2) then selected = 2
if keystate(3) then selected = 3
if keystate(4) then selected = 4
if keystate(5) then selected = 5
pick screen mousex(),mouseY(),1000
vx# = get pick vector x()
vy# = get pick vector y()
vz# = get pick vector z()
dy# = -camera position y()/vy#
vx# = vx#*dy# + camera position x()
vz# = vz#*dy# + camera position z()
position object 10,vx#,0,vz#
picked = pick object (mousex(),mousey(),2,5)
if mouseclick()=1 and picked > 0
selected = picked
endif
if mouseclick()=2 and selected > 0
AI Entity Go To Position selected,object position x(10),object position z(10)
endif
text 000,000,"picked : " + str$(picked)
text 000,015,"selected : " + str$(selected)
ai update
sync
loop
How do I check if it is in stationary mode? (Will check the manual, just in case I don't find the answer I don't have to go back and edit the post... hell' yea im lazy
)
After a small search I changed my code to this
ai start
make object plain 1,100,100
xrotate object 1,90
AUTOCAM OFF
make object sphere 10,2.5 : color object 10,rgb(255,000,000)
make object sphere 2,5
color object 2, rgb(255,000,000)
ai add enemy 2,2
make object sphere 3,5
color object 3, rgb(255,255,000)
ai add enemy 3,3
make object sphere 4,5
color object 4, rgb(255,255,255)
ai add enemy 4,4
make object sphere 5,5
color object 5, rgb(000,255,000)
ai add enemy 5,4
AI Debug Show Paths 2.5
AI Set Entity Speed 2,10
AI Set Entity Speed 3,10
AI Set Entity Speed 4,10
AI Set Entity Speed 5,10
AI Set Entity Stance 2,0
do
if keystate(2) then selected = 2
if keystate(3) then selected = 3
if keystate(4) then selected = 4
if keystate(5) then selected = 5
pick screen mousex(),mouseY(),1000
vx# = get pick vector x()
vy# = get pick vector y()
vz# = get pick vector z()
dy# = -camera position y()/vy#
vx# = vx#*dy# + camera position x()
vz# = vz#*dy# + camera position z()
position object 10,vx#,0,vz#
picked = pick object (mousex(),mousey(),2,5)
if mouseclick()=1 and picked > 0
selected = picked
endif
if mouseclick()=2 and selected > 0
AI Entity Go To Position selected,object position x(10),object position z(10)
endif
text 000,000,"picked : " + str$(picked)
text 000,015,"selected : " + str$(selected)
ai update
sync
loop
but it still dosn't work