Hi, can anyone provide me with some basic code for having an entity patrol a path and for following the player? If not, a general idea how I might do so would be of great help! Thank you!
Re: Basic Patrol and Following
[Re: 82RJZAE]
#338667 08/20/1009:3308/20/1009:33
rather than the basic reply of read the manual which is everyones default reply here allow me to be abit more helpful.(not just this forum but in all forums ive seen here on 3dgs.)
You want Aum 97 and you looking for pathfinder...some other exampels within that same article can be very helpful.
hope this gives you a better example of how paths work.
im still learning about them myself so sorry I cant be more helpful but atleast I didnt say "read the manual".
A8 Pro Windows 7 64bit QuadCore i7, 6 gb ram, ATI 5970
Re: Basic Patrol and Following
[Re: nomis23uk]
#374742 06/21/1112:2806/21/1112:28
Iam not at home else i would post a path-follow code. But i can give u a very basic player following:
Code:
entity* Player;
action My_Player
{
Player = ME;
}
action Follow_Player
{
WHILE(1)
{
//look into players direction
vec_set(temp,player.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // now MY looks at PLAYER
//move me in that direction
C_MOVE(me, vector(5*time_step,0,0), nullvector, IGNORE_ME);
WAIT(1);
}
}
Edit: Just checked out the Breadcrumb script (aum76). Man that is awesome working well ! Brought it into c-script, just running fine. Great thing ! MfG
Last edited by rayp; 06/21/1114:57.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;