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.