3 registered members (Akow, AndrewAMD, Quad),
733
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
path following
#440067
04/17/14 14:42
04/17/14 14:42
|
Joined: Jan 2005
Posts: 282 devon UK
DAVIDMORETON
OP
Member
|
OP
Member
Joined: Jan 2005
Posts: 282
devon UK
|
Sorry gamers – I’m here again. I have at long last got my ‘rat’ to go through it’s animations and actually move – problem is, it won’t go along the path I have laid down from the object menu, although it is attached to the path – it just goes in a straight line until it hits the wall.(other models from the object menu follow the path) Also the legs still move thought! How do I stop the animation?. Below is the code I’ve used – could someone PLEASE tell me where I have gone wrong.
var walk_percentage;
entity* rat;
define _path_node__01E, SKILL53; // cur target node
define _path_vec__01E, SKILL54; // cur target pos
define _path_vec_x__01E, SKILL54;
define _path_vec_y__01E, SKILL55;
define _path_vec_z__01E, SKILL56;
var rat_path_skills[6]; // used to store the skills of the current path
action bone_anm
{
// Check for path
if(path_getnode(my,1,my._path_vec__rat_path_skills) != 0)
{
my._path_node__01E = 1; // start at first node
if(my._path_node__01E != 0) // we have a valid node in a path
{
// move to start
//path_nodepos(my,my._path_node__01E,my.x);
vec_set(my.x,my._path_vec__01E);
// mark this node as occuped
// set this as the current waypoint
path_setnode(my,my._path_node__01E,my._path_vec__rat_path_skills);
}
wait(1); // we should wait at least one frame so other pathfollow entities
//can see that we own this node during setup
}
{
while (1)
{
rat=me;
c_move (me, vector(5 * time_step, 0, 0), nullvector, GLIDE);
ent_animate(me, "walk", walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage += 10 * time_step; // 3 = animation speed for "walk"
wait (1);
}}}
When I add the above ‘heavy’ to find the path, I get;- (SORRY,THE HEAVY TYPE DOES NOT COME OUT IN THIS BOX-BUT THE RAT MOVES FROM 'WHILE(1)' DOWN.) When I use all the code, I get this error Parameter unknown_path_vec__rat_path_skills This is really holding up the game – can someone please help? As you can see, I’m not very good at coding !! –but I want to learn. Yours hopefully David.
Last edited by rayp; 04/21/14 21:55. Reason: only added code tags
|
|
|
Re: path following
[Re: DAVIDMORETON]
#440070
04/17/14 15:39
04/17/14 15:39
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
This is really holding up the game Possible. I dont see 'path_vec__rat_path_skills' defined anywhere
Last edited by DLively; 04/17/14 15:40.
|
|
|
Re: path following
[Re: DLively]
#440071
04/17/14 15:42
04/17/14 15:42
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Yep From my understanding, path_vec__rat_path_skills is actually two defines? path_getnode(ENTITY*,var node,VECTOR* pos,var* skills) You dont have enough perameters in your getnode
|
|
|
Re: path following
[Re: DAVIDMORETON]
#440528
04/27/14 14:15
04/27/14 14:15
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
I do know that the comunity likes to keep things up to date - keeps things less confusing for the rest of the users. However, if you have a look at Superku's Path finding http://opserver.de/pwik7/index.php?title=Pathfinding tip of the week article, and also have a look at: http://www.conitec.net/beta/aAnhang_Syntax.htmYou can see what the older codes were used and replace them My pathfinding will not be nearly as complex and well done as his until many years to come. However I do intend on continuing my tutorials page and this will be covered to some degree in my own tutorialized way.
|
|
|
|