Patrol on Path

Posted By: Liamissimo

Patrol on Path - 10/30/09 00:14

Hey,

can anyone tell me where I can find an example of How a Camera/Entity can follow a path?

Thanks in advantage

Liam
Posted By: Razoron

Re: Patrol on Path - 11/01/09 19:18

If you have Commercial edition, you can the download the warehouse source here.
Posted By: Liamissimo

Re: Patrol on Path - 11/04/09 16:06

Thnaks Dude, I'll have a look laugh
Posted By: Liamissimo

Re: Patrol on Path - 11/04/09 16:14

Sorry, is there any other thing with an Path example in it? I don't no the Username and the Serial, I forgot them tongue DOnÄt wanna search the now:)

Thanks
Posted By: Rei_Ayanami

Re: Patrol on Path - 11/04/09 16:58

It's written under Sed/Help -> there it is written!
Posted By: Liamissimo

Re: Patrol on Path - 11/04/09 18:20

Yes, but just things like finde next path and someting like that, didn't find something useful. I just want to write something like: c_move(camera, mypath, nullvector, GLIDE); or so on wink

Thanks
Posted By: Rei_Ayanami

Re: Patrol on Path - 11/04/09 18:25

oh, sorry tongue

But that's easy - you will get it grin
Posted By: Liamissimo

Re: Patrol on Path - 11/05/09 18:02

Okay, but it doenst help me when I know its easy wink SOmeone have something fo rme? Or can someone upload the ressorce file? Thanks
Posted By: Ottawa

Re: Patrol on Path - 11/06/09 00:22

Hi!

Did you look in the GameStudio folder
under
projects.
Posted By: Liamissimo

Re: Patrol on Path - 11/06/09 18:48

Yes, I did, just the sahdertest and the carlevel, nothing useful wink ALso not in the Samples
Posted By: testDummy

Re: Patrol on Path - 11/06/09 21:20

Code:
/* 
???
pathwalker_a 
A7 Lite-C
ENTITY loops / moves (x,y,z) along path 
(optional) ENTITY turns (pan, tilt) to next node
???
*/

// temp variables
VECTOR* v2 = {x=0; y=0; z=0;}
VECTOR* v3 = {x=0; y=0; z=0;}  
ANGLE* a1 = {pan=0; tilt=0; roll=0;}

// skills
#define _nodeId skill71
#define _nodeDir skill72

action pathwalker_a() {
	wait(1);
	// attach entity to nearest path
	my._nodeId = path_scan(me,my.x,my.pan,vector(360,180,1000));
	
	my._nodeDir = 1;
	//my._nodeId = 1;

	if (my._nodeId != 0) {
	
		while(me != NULL) {
			if (path_getnode(me, my._nodeId, v3, NULL) == 0) {
				my._nodeDir *= -1;
				my._nodeId += my._nodeDir;
				path_getnode(me, my._nodeId, v3, NULL);
			} 
			if (vec_dist(my.x, v3) < 25) {
				my._nodeId += my._nodeDir;
			}
			// v3 is destination VECTOR
			vec_diff(v2, v3, my.x);		// v2 is destination direction
			
			// turn ENTITY towards node
			vec_to_angle(a1, v2);
			my.pan += ang(a1.pan - my.pan) * 0.5*time_step;
			my.tilt += ang(a1.tilt - my.tilt) * 0.5*time_step;
			
			// move ENTITY
			vec_normalize(v2, 1);
			vec_scale(v2, 10 * time_step);
			c_move(me, nullvector, v2, GLIDE | IGNORE_PUSH);
			wait(1);
		}
	}
}


(arrrrr!!!)


Posted By: Liamissimo

Re: Patrol on Path - 11/06/09 22:33

Thanks, but were have you found it? Sorry wink
© 2024 lite-C Forums