Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
scan_path question #328485
06/13/10 14:19
06/13/10 14:19
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
hi.. i used the scan_path example from the manual
to move a player in a circle or a loop and its working fine
but.. for some reason there are cases that the player
is moving up above the knee of the other player.
and retain that level. any reason why this thing happen?

thanks... laugh

Re: scan_path question [Re: bobby_danseco] #328489
06/13/10 14:40
06/13/10 14:40
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
If you mean path_scan, then the reason is the example code does not use a gravity code and uses GLIDE.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: scan_path question [Re: Superku] #328543
06/13/10 20:20
06/13/10 20:20
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
yup.. path_scan.. sorry about that. laugh
if it is so.. then i have to put gravity code. frown

thanks..

Re: scan_path question [Re: bobby_danseco] #328572
06/14/10 00:21
06/14/10 00:21
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!


Or tell your player to stay x quants off the ground.
before or after the c_move.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: scan_path question [Re: Ottawa] #328580
06/14/10 05:25
06/14/10 05:25
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
thnks ottawa and superku laugh

Re: scan_path question [Re: Ottawa] #328645
06/14/10 13:05
06/14/10 13:05
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
hi.. i try to put my.z = -180 before or after cmove (wherein -180 is my level on the ground) but still player is going up frown

i also try this but no success..
Code:
vec_set(tmp_vec, my.x);
tmp_vec.z -= 1000;
boot_dist.z = -abs(c_trace (my.x, tmp_vec, IGNORE_ME | IGNORE_PASSABLE));
		
c_move(my,vector(boot_dist,nullvector, IGNORE_YOU | IGNORE_PASSABLE | IGNORE_WORLD | GLIDE );



thanks for any help laugh

Re: scan_path question [Re: bobby_danseco] #328746
06/15/10 00:33
06/15/10 00:33
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!
1)
Is this in a loop?

You could try
2)
vec_set(tmp_vec.x, my.x);
or
vec_set (tmp_vec.x, vector(my.x,my.y,my.z-180)); // player's pos copied to ???

What is boot_dist.z ?
I believe that this value is changing all the time in your C_move.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: scan_path question [Re: Ottawa] #328770
06/15/10 05:44
06/15/10 05:44
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
thanks for the time ottawa actually
this what ive got. this is working perfectly well in some area
there there are some points that the players is gliding up
on some waypoint. i only have 4 nodes on each path.

just to give you a clear picture.
maybe you or anyone can help me on how i can maintain the player on
-180

may thanks.. laugh

Code:
function boot_player()
{
	
	my.ambient=100;
	// attach entity to nearest path
	result = path_scan(me,my.x,my.pan,vector(360,180,1000));
	if (result == 0) { return; } // no path found
	
	// find first waypoint
	var node = 1; // start at first node
	path_getnode(my,node,my.skill20,NULL);
	
	while (1)
	{
		var angle[3];
		// find direction
		result = vec_to_angle(angle,vec_diff(temp,my.skill20,my.x));
		
		// near target? Find next waypoint of the path
		if (result < 25) {
			node = path_nextnode(my,node,1);
			path_getnode(my,node,my.skill20,NULL);
			my.z = -180;
			if(node==3)
			{
				my.z = -180;
				node=1;
				result = path_scan(me,my.x,my.pan,vector(360,180,1000));
				path_getnode(my,node,my.skill20,NULL);
				my.z = -180;
			}
		}
		
		// turn and walk towards target
		//
		my.pan = angle[0];
		//my.z = -180; //<==if i put this it will stuck on the point where the player is gliding.
		
		//c_move(me,vector(3*time_step,0,0),NULL,GLIDE); // walk ahead...
		
		c_move(my,vector(3*time_step,0,0),nullvector, IGNORE_YOU | IGNORE_PASSABLE | IGNORE_WORLD | GLIDE ); //moves the player
		
		my.skill[41] += 6*time_step;
		if(my.skill[41] > 100) {my.skill[41] = 0;}
		ent_animate(my,"walk",my.skill[41],ANM_CYCLE);
		
		wait(1);
	}
	
}



Last edited by bobby_danseco; 06/15/10 08:20.
Re: scan_path question [Re: bobby_danseco] #328959
06/16/10 12:41
06/16/10 12:41
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Here's a suggestion :
Place the declaration of var at the beginning of the function
Code:
function boot_player()
{
var node = 1; // start at first node
var angle[3]; // this should not get declared every time 
 ....



I'll look further.
edit :
I don't think you need the c_move
the get next node (path_getnode) gets you to the next node and so on.

Last edited by Ottawa; 06/17/10 00:41.

Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: scan_path question [Re: Ottawa] #329389
06/19/10 14:26
06/19/10 14:26
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
hi..
thank ottawa.. i did what you said.
still the same thing.. gliding up. frown

really appreciate your help. laugh

many thanks..
regards.
bobby

Page 1 of 2 1 2

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