Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Basic Patrol and Following #338666
08/20/10 08:46
08/20/10 08:46
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
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/10 09:33
08/20/10 09:33
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline
Member
Bone  Offline
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
you can set a path in WED and use the path functions or code some easy path following with vec_to_angle.

With vec_to_angle you can the entity look at a point in your world.

In words:

look at point 1 , go to this point , look at point 2 , go to point 2 ....

Re: Basic Patrol and Following [Re: Bone] #365553
03/27/11 14:04
03/27/11 14:04
Joined: Mar 2011
Posts: 28
Deutschland
Nog Offline
Newbie
Nog  Offline
Newbie

Joined: Mar 2011
Posts: 28
Deutschland
Bone can you explain me this abit more? (i mean how to make the AI follow you)



YIPIIE YAY YEY, SCHWEINEBACKR!!!
_________________________

Nog grin!
Re: Basic Patrol and Following [Re: Nog] #365557
03/27/11 14:19
03/27/11 14:19
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
It is explain in the manual.

Re: Basic Patrol and Following [Re: Widi] #365559
03/27/11 14:37
03/27/11 14:37
Joined: Mar 2011
Posts: 28
Deutschland
Nog Offline
Newbie
Nog  Offline
Newbie

Joined: Mar 2011
Posts: 28
Deutschland
Thanks Widi.



YIPIIE YAY YEY, SCHWEINEBACKR!!!
_________________________

Nog grin!
Re: Basic Patrol and Following [Re: Nog] #374656
06/20/11 19:11
06/20/11 19:11
Joined: Jun 2011
Posts: 133
N
nomis23uk Offline
Member
nomis23uk  Offline
Member
N

Joined: Jun 2011
Posts: 133
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/11 12:28
06/21/11 12:28
Joined: Jul 2008
Posts: 2,101
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,101
Germany
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/11 14: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;

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1