Community
AGI Programming => Mega Tokyo AGI Archive => Topic started by: Corby on June 07, 2003, 01:28:40 AM
-
Has anyone has a problem using move.obj.v for the ego? This has happened to me before... it's very strange... here's my code:
if((said("talk","man") ||
said("talk","guru"))){
if(obj.in.box(o0,71,64,93,81)){
program.control();
prevent.input();
get.posn(o0,v100,v101);
v100 = 72;
move.obj.v(o0,v100,v101,1,f89);
}
else{
print("You are not close enough.");
}}
What am doing basically is telling my ego to move to a certain x coordinate while staying in the same y coordinate.
What am I doing wrong?
-
Hint: Count your curly braces }
-
In AgiStudio, the help file and the compiler reckon it's
move.obj.v(oA,vX,vY,STEPSIZE,fDONEFLAG);It's actually
move.obj.v(oA,vX,vY,vSTEPSIZE,fDONEFLAG);where stepsize is a variable.
so try
v150 = 1;
move.obj.v(o0,v100,v101,150,f89);notice how i used 150 as a parameter and not v150? That's because the compiler is expecting a number. It'll all work in the end though.
Use any variable to store the stepsize.. v150 is just an example case.
- Nick
-
Oh!!! How simple! Step size is is a variable too! Thanks Nick! :)