CJ, need help, error

Started by , Sun 15/02/2004 01:33:38

Previous topic - Next topic

Akumayo1

I am making a game where you must avoid evil creatures.  I put this script in the Repeatedly Execute, here it is:

MoveCharacterPath(CREATURE,159,173);
MoveCharacterPath(CREATURE,168,120);

However, when I test the game, the creature starts moving towards 159,173 then I get this error message



An error has occured.  Please contact the game author for support, as this problem was caused by the game rather that the interpreter.
(ACI version 2.56.627)

(Room1 script line 9)
Error:  MoveCharacterPath: move is to complex, cannot add any further paths



Please tell me how to fix this or do something else to still move the creature like I want to!!!

Wolfgang Abenteuer

I don't know how many AGS accepts, but you cannot use too many MoveCharacterPath commands at once.  With that in the repeatedly execute, it's adding a new one every 1/40 of a second.  Not good. :P

What you can do is, as soon as you have the creature appear in the room then use MoveCharacterPath.  Like if you've interacted with something and caused the creature to appear.  Or, if you need the creature(s) to appear at random, do it like this:

repeatedly execute

if (character[CREATURE].room != character[EGO].room) {
 character[CREATURE].room = character[EGO].room;
 character[CREATURE].x = 160; //or whatever
 character[CREATURE].y = 140; //or whatever
 MoveCharacterPath(CREATURE,159,173);
 MoveCharacterPath(CREATURE,168,120);
}

That way the sequence will only happen one time, since the if statement becomes false as soon as CREATURE appears in the room.

~Wolfgang

SMF spam blocked by CleanTalk