Author Topic: Wandering...  (Read 1606 times)

0 Members and 1 Guest are viewing this topic.

Ethan

  • Guest
Wandering...
« on: September 06, 2002, 07:14:57 AM »
Hi. I was wondering, how can I make a wandering view do something when it comes in contact with the player? I've got it wandering around... but I can't really think of how to make it react to touching the player. Thanks for helping the poor little newbie. :)



Offline Sami Tervo

Re:Wandering...
« Reply #1 on: September 06, 2002, 07:43:23 AM »
let's assume that your wandering view is named as object 1 (o1). here's few ways to do it, prolly not the best but they should work.

1) Easy, but not quite accurate one. Flag 40 is optional, just to prevent multiple prints.

if (f5){
 .....
v40 = 0;
reset(f40)
}

distance(o0,o1,v40);

if(!f40){

if(v40 < 20){ print("Hi I'm object 1, wazzup"); }set(f40);

}

return();

-------------------------------------------------------------------
2) Hard?! =), but accurate

if (f5){
 .....
v40 = 0;
v41 = 0;
v42 = 0;
v43 = 0;
}

get.posn(o0,v40,v41);
get.posn(o1,v42,v43);

/*
Damn, im running out of time so I let you figure out exact commands. I'm back at monday so I can then tell the exact code.

Check which variable is bigger than other to do this:
*/
Variable_with_bigger_value -= Variable_with_smaller_value

/*
If you don't check which one is bigger than other AGI won't approve it because value can't be smaller than 0

do it twice, for x and y-coords
*/
if(!f40){


if (Result_variable_x < 20 &&  Result_variable_y < 34){print("Hi I'm object 1, wazzup");}
set(f40);
}

return();

Easy eh =)?
Apocalyptic Quest [ http://apocalypticquest.cjb.net ] No Mutants Allowed [ http://www.nma-fallout.com ] Batmud [ http://www.bat.org ]


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

Page created in 0.058 seconds with 21 queries.