(note: this is for Sierra's interpreter but I think strange things will happen in NAGI too. )
Try this code in a template game:
if (said("look")) {
move.obj(o0, 20, 100, 0, f60);
}
type in "look" and your ego will move to the left hand side of the screen where x=20. Easy hey?
now replace it with this:
if (said("look")) {
move.obj(o0, 20, 100, 0, f60);
reverse.loop(o0, f140);
}
now your ego will move to the right hand side of the screen where x=140! Same number as the end flag for reverse.loop right? What's going on here?
It's hopefully well known that you can only call one of these for an animated object at a time:
move.obj()/move.obj.v()
wander()
follow.ego()
However, reverse.loop() and end.of.loop() ALSO share the area of memory as the movement commands above.
The problem is if you set reverse.loop()/end.of.loop() on your animated object and it's moving towards something with move.obj()/move.obj.v(), it'll change its x-direction but just keep on moving. even stranger things will happen with wander() and follow.ego()
Conclusion:
If you call any of these functions, wait until they're finished or cancel them before you call another one for the same animated object:
move.obj()/move.obj.v()
wander()
follow.ego()
reverse.loop()
end.of.loop()
- Nick