I have a litte problem with an infinte loop in a scene.
a little introduction:
theres a dog in the scene, and if the actor walks to near, the dog starts to bark, and the actor turns arround an walks back an says something.
it should be removed (the script) if the dog is away.
now my solution:
I attached this script in the scene_init.script to the Game:
#include "scripts\base.inc"
#include "scripts\keys.inc"
global dogflag=true;
while(dogflag){
if(actor.X<=260){
actor.Reset;
actor.GoTo(650,500);
actor.TurnTo(DI_DOWN);
actor.Talk("bla");
}
if(actor.Y<=450){
actor.Reset;
actor.GoTo(650,500);
actor.TurnTo(DI_DOWN);
actor.Talk("bla");
}
Sleep(20);
}
It works fine the first time I 'overwalk' one of the borders. but then, the script dosn't work. Why?