Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (howardR), 503 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Create path in WED? #453558
08/01/15 00:23
08/01/15 00:23
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
I am trying to create a path in WED for an ogre to walk to three areas, in a loop. I totally knew how to do this like a year or more ago, but I totally forgot, and I cannot find the information I had on how I did it.

I know that when I open WED, I click the "Object" tab and select "Add Path". I get a node. Now I want to add two other nodes that will connect to the first node, and all three will become one path for the ogre.

Can anyone tell me how to connect the two other nodes to the first node to create a path, or at least point me in the right direction? Thank you in advance.

Re: Create path in WED? [Re: Ruben] #453559
08/01/15 00:31
08/01/15 00:31
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
in WED, click vertex mode in the tool bar
then just click in the direction you'd like the path go until it loops. (from the top view)


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Create path in WED? [Re: DLively] #453560
08/01/15 02:42
08/01/15 02:42
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Thank you DLively. It worked.

Am I required to use the ent_movepath() function in SED for the ogre, in order to make it follow the path I created in WED? Or is there another way I can make the ogre follow the WED path?

For example, lets say I create a path of three nodes in WED titled "path_000". I then use this code in SED to make the ogre follow that path:

Code:
action ogre_action
{
   ...

   ent_movepath(me, "path_000", 2, 1+2);

   ...
}



...is there another way to make the ogre follow the "path_000" without using the ent_movepath() function?

Re: Create path in WED? [Re: Ruben] #453561
08/01/15 03:22
08/01/15 03:22

M
Malice
Unregistered
Malice
Unregistered
M




Re: Create path in WED? [Re: ] #453562
08/01/15 03:57
08/01/15 03:57
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Hello Malice. Is it okay if I can see how you declared the variables in the code that you referred me to? It will help me visualize better what is going on in your code.





Last edited by Ruben; 08/01/15 03:57.
Re: Create path in WED? [Re: Ruben] #453563
08/01/15 04:14
08/01/15 04:14

M
Malice
Unregistered
Malice
Unregistered
M



vec_next_node is clearly a vector
my.NODE_NEXT is a renamed skill

Re: Create path in WED? [Re: ] #453565
08/01/15 05:42
08/01/15 05:42
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
What does "skill3" and "skill10" refer to?

Re: Create path in WED? [Re: Ruben] #453570
08/01/15 16:56
08/01/15 16:56
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
basically, my.node_next is my.skill3 or whatever.. didn't actually look at the code.

so instead of saying my.skill3 = 1;
with the use of a define, you can 'rename' your skills ex: my.node_next = 1;

Last edited by DLively; 08/01/15 16:56.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Create path in WED? [Re: DLively] #453578
08/02/15 00:33
08/02/15 00:33

M
Malice
Unregistered
Malice
Unregistered
M



omg

skill10 is skill10 and it locks turning to the a node. You could remove

skill3 is skill3 it is use in a c_move command as a speed vector so it is clearly a speed on the x- axis of the c_move rel_vec

Re: Create path in WED? [Re: ] #453602
08/03/15 01:43
08/03/15 01:43

M
Malice
Unregistered
Malice
Unregistered
M



Code:
my.NODE_NEXT=path_nextnode(my,1,1); // SET THE NODE
	while(1)
	{
         // PATH NODE DETECTION AND RANDOMIZATION AND FACING //////////////////////////////////
		
		
		if(vec_dist(my.x,vec_next_node.x) < my.max_x)    // Is next node within 160 units 
		{
			path_next(my); // will jump from current path to new path// Jump to new path
			my.NODE_NEXT=path_nextnode(my,my.NODE_NEXT,1); // Grab Next node on new path -- NOTE ALL PATHS MUST HAVE THE SAME NUM NODE IN SAME GEN LOCATION
			my.skill10=0; // only enable facing the path node if changing the path.   
		}
		
		path_getnode(my,my.NODE_NEXT,vec_next_node,NULL);  // Get next node actual vector location 
		
		if(my.skill10 ==0)
		{
			vec_to_angle(my.pan,vec_diff(NULL,vec_next_node,my.x)); // face the new node
		}

		///////////////////////////////////////////////////////////////////////////
		
		// SOFT AND HARD MOVEMENTs /////////////////////////////////////////////////////////////
		
		c_move(my,vector(my.skill3*time_step,0,0),nullvector,GLIDE | IGNORE_PASSABLE);
		
wait(1);
}
}




Ok lets walk through the logic of my code so you can learn to modify it.
1)my.Node_next=path_nextnode(my,1,1);
we are setting a skill to the return value of path_nextnode.
path_nextnode manual notes "Finds the next node along a given edge."
So we are finding the next node in the orges path and returning it to the skill my.NODE_NEXT

2)if(vec_dist(my.x,vec_next_node.x) < my.max_x) // Is next node within 160 units
check if the next node is close

3)path_next(my); // will jump from current path to new path// Jump to new path
Will jump to the next closest path... In your cause you have only one path, so this command should not be here, but instead used to attach the orge to the path before all this code

4)my.NODE_NEXT=path_nextnode(my,my.NODE_NEXT,1); // Grab Next node on new path -- NOTE ALL PATHS MUST HAVE THE SAME NUM NODE IN SAME GEN LOCATION
Ok this is little tricky, my.node_next at this point holds the a node number, we use it to get the number of the next node, and replace it with the return value or the next node we wanted

5)my.skill10=0; // only enable facing the path node if changing the path.
We open the lock so that we may turn to the new node

6)path_getnode(my,my.NODE_NEXT,vec_next_node,NULL); // Get next node actual vector location
Now we take the node number my.Nodenext and from it we fill it's xyz into vec_next_node.

7)if(my.skill10 ==0)
{
vec_to_angle(my.pan,vec_diff(NULL,vec_next_node,my.x)); // face the new node
}

We have a new node location and we have opened the lock, so now we make the ogre turn to the new node

8)c_move(my,vector(my.skill3*time_step,0,0),nullvector,GLIDE | IGNORE_PASSABLE);

A automatic move that keeps the ogre walking forward, when used with the above code the ogre will walk the path.

Thats the logic


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