Ok, I haven't tested this, but it'll get you on the right track. Read the code and then look at the explanation below. I assume this is all the code you have, right?
sync rate 60:sync on
load animation "open_seq.avi", 1
do
PlayerX# = camera position x ()
PlayerZ# = camera position z ()
Box_X# = object position x (1)
Box_Z# = object position z (1)
disX# = Abs(Box_X# - PlayerX#)
disZ# = Abs(Box_Z# - PlayerZ#)
print disX#
print disZ#
Waypoint# = 0
if (disX# <=200 and disZ# <=200) and waypoint#=0
play animation 1,0,0,800,600
waypoint# = 1
endif
if (animation playing(1)<1) and waypoint#=1
stop animation 1
delete animation 1
endif
sync
loop
First, you want to load the animation before the main loop, this way you avoid accedentally reloading the animation. Second, your if statements were continuosly triggering. Once you've reached the waypoint, you want the program to know you've reached. This you already did with disX# and disZ# testing, but you also need a test to see if the waypoint has been previously reached. Finally, placing a stop animation right after the play animation will instantly stop the animation. The code will continue to run even when you have called a play animation command. Hopefully this will help. I don't use animation files that often and I'm not sure the code will cut the animation but it should. Keep in mind, that this code could still use a lot of work, but I did this without the compiler
Good luck!
There 10 kinds of people, those who understand binary and those who don't