Community

AGI Programming => Mega Tokyo AGI Archive => Topic started by: Corby on June 07, 2003, 01:28:40 AM

Title: move.obj.v problems
Post 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?
Title: Re:move.obj.v problems
Post by: Andrew_Baker on June 07, 2003, 01:51:09 AM
Hint:  Count your curly braces }
Title: Re:move.obj.v problems
Post by: Nick Sonneveld on June 07, 2003, 03:57:06 AM
In AgiStudio, the help file and the compiler reckon it's

Code: [Select]
move.obj.v(oA,vX,vY,STEPSIZE,fDONEFLAG);It's actually

Code: [Select]
move.obj.v(oA,vX,vY,vSTEPSIZE,fDONEFLAG);where stepsize is a variable.

so try

Code: [Select]
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
Title: Re:move.obj.v problems
Post by: Corby on June 07, 2003, 04:14:16 AM
Oh!!! How simple! Step size is is a variable too! Thanks Nick!  :)