Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, monk12, TipmyPip, Quad, aliswee), 1,031 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Wizard not moving straight #459490
05/24/16 02:59
05/24/16 02:59
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
I have a wizard model. If the player gets close enough to the wizard while climbing toward the top of a large spiral staircase, certain code is to be triggered where the wizard will start running down the big spiral staircase along a set path with path nodes.

I got the same path to work for an ogre toward the bottom of the same spiral staircase. The ogre will chase the player no problem up or down the stairs. However, every time the wizard starts moving toward the 1st node of the path, at the very top of the spiral staircase, instead of running straight toward that 1st node, the wizard will first run back and up in the air, before running (floating) in the air toward the 1st path node, kind of like a check mark shape path in the air toward the 1st path node.

I placed a "dummy block model" next to the 1st path node in the level to see if the wizard would move toward the dummy block without the check mark pattern in the air. I programmed it so that the wizard would move and face directly toward the dummy block, and once the wizard's .y location got above 239, the wizard would then travel on the spiral staircase path. The wizard did move directly toward the dummy block without a check mark pattern, but once the wizard started on the path, the wizard did the funny check mark pattern in the air again before starting down the path.

Does anyone know what may be causing the wizard to move in the check mark pattern in the air, as opposed to just running straight toward the first path node on the floor?

Here is my path_setter() function that seems to be making all this happen:

Code:
action path_setter()
{
   proc_kill2(path_setter,my);
   VECTOR vec_next_node;

   VECTOR temp;

   path_set(my,"path_001");

   while(1)
   {
      // PATH NODE DETECTION AND FACING //////////////
		
      if(vec_dist(my.x,vec_next_node.x) < 80) 
      {    
         if(pathSetNum == 1) // pathSetNum = 1 makes 
                             //    entity move down the 
                             //    spiral staircase.
	 {   
	    my.NODE_NEXT+=1; 	             
	 }
		 
	 if(pathSetNum == 2) // pathSetNum = 2 makes 
                             //    entity move up the 
                             //    spiral staircase.
	 {
	    my.NODE_NEXT-=1; 	          
	 }
	         
	 if(my.NODE_NEXT > 247) // if entity is past 
                                //    last node on bottom 
                                //    of staircase, that 
                                //    node is set as 
                                //    my.NODE_NEXT
	 {
	    my.NODE_NEXT = 247;	
	 }
		    	
	 if(my.NODE_NEXT < 1) // if entity is past first 
                              //    node on top of 
                              //    staircase, that node 
                              //    is set as my.NODE_NEXT
	 {
	    my.NODE_NEXT = 1;	
	 }
      }
		
      path_getnode(my,my.NODE_NEXT,vec_next_node,NULL);  
         
      vec_to_angle( my.pan, vec_diff(NULL, 
         vec_next_node.x, my.x)); // THIS SEEMS TO BE 
                                  //    WHERE THE CHECK 
                                  //    MARK MOVEMENT 
                                  //    PATTERN OCCURS 
                                  //    WITH THE WIZARD?
         // face the new node
         
      wait(1);
   }
}



Anyone have a clue why the wizard is making the check mark pattern when starting on the first path node in "path_001"? Any help would be appreciated. Thank you.

Last edited by Ruben; 05/24/16 03:06.
Re: Wizard not moving straight [Re: Ruben] #459493
05/24/16 09:44
05/24/16 09:44
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Perhaps you placed the path nodes to high? Try to place them right above the ground/floor. You could also set the entity's tilt to 0 after doing vec_to_angle.

Last edited by Reconnoiter; 05/24/16 09:44.
Re: Wizard not moving straight [Re: Reconnoiter] #459517
05/24/16 14:53
05/24/16 14:53
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
The path nodes are in the ground. Seems no matter where I place the wizard, he still does that check mark pattern in the air before moving toward path node 1. The ogre does not seem to do this. Strange.

Re: Wizard not moving straight [Re: Ruben] #459518
05/24/16 15:10
05/24/16 15:10
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Does setting "my.tilt = 0;" after doing the vec_to_angle help?

Re: Wizard not moving straight [Re: Reconnoiter] #459546
05/25/16 02:37
05/25/16 02:37
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
It kind of does. The wizard is not moving in a check mark pattern in the air, but the wizard is moving the exact opposite direction from the path node 1.

Re: Wizard not moving straight [Re: Ruben] #459553
05/25/16 09:53
05/25/16 09:53
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
I am wondering if your VECTOR vec_next_node has something to do with it. Perhaps you haven't set vec_next_node correctly the first time. Try debugging its xyz values to if they are set wrong throughout the Wizards walking trip.

Last edited by Reconnoiter; 05/25/16 09:54.
Re: Wizard not moving straight [Re: Reconnoiter] #459619
05/28/16 11:44
05/28/16 11:44
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Well, I kind of figured out what was making the wizard move in a checkmark formation in the air. In the past, I opened the wizard's MED file, and moved the wizard to a different location in relation to the center point, and saved it. That is when the checkmark formation in the air started occurring. I brought back the original MED file of the wizard into my game, without it being moved the different location in relation to the center point, and now the wizard moves fine without the check mark pattern in the air.


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