Author Topic: move.obj.v problems  (Read 1774 times)

0 Members and 1 Guest are viewing this topic.

Offline Corby

move.obj.v problems
« 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?



Offline Andrew_Baker

Re:move.obj.v problems
« Reply #1 on: June 07, 2003, 01:51:09 AM »
Hint:  Count your curly braces }
I hope you realize that one day I will devour the Earth.

Offline Nick Sonneveld

Re:move.obj.v problems
« Reply #2 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
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Corby

Re:move.obj.v problems
« Reply #3 on: June 07, 2003, 04:14:16 AM »
Oh!!! How simple! Step size is is a variable too! Thanks Nick!  :)


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.045 seconds with 15 queries.