Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
1 registered members (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
My path problem :S #304675
01/09/10 20:37
01/09/10 20:37
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Hi, I have a problem of paths. I move my object on the path. But, when object arrived end of path, starting turn around. I think I tried every ways.

My code:
Code:
action f22_u()
{
	VECTOR temp;
	wait(2);
	c_setminmax(me);

  result = path_scan(me,my.x,my.pan,vector(360,180,1000));
  if (result == 0) { return; }
  var node = 1;
  path_getnode(my,node,my.skill20,NULL);
 
  while (1)
  {
    var angle[3];
    result = vec_to_angle(angle,vec_diff(temp,my.skill20,my.x));
    if (result < 50) {
      node = path_nextnode(my,node,1);
      path_getnode(my,node,my.skill20, NULL);
    }
    my.pan = angle[0];
    my.tilt = angle[1];
    c_move(me,vector(50*time_step,0,0),NULL,GLIDE);
    ent_animate(me, "fly", my.skill10, ANM_CYCLE);
    my.skill10 += 6 * time_step;
    wait(1);
  }
}



Re: My path problem :S [Re: WickWoody] #304733
01/10/10 14:25
01/10/10 14:25
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

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

Do you have to redefine the var angle in the while?


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: My path problem :S [Re: Ottawa] #304749
01/10/10 17:15
01/10/10 17:15
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Yes, but for next node.

Code:
result = vec_to_angle(angle,vec_diff(temp,my.skill20,my.x));



Re: My path problem :S [Re: WickWoody] #305061
01/12/10 18:39
01/12/10 18:39
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Doesn't anyone know?

Re: My path problem :S [Re: WickWoody] #305124
01/12/10 23:53
01/12/10 23:53
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

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

Is your path a circle?

And
What happens if the result is > 50 in
if (result < 50)


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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