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
1 registered members (opm), 778 guests, and 4 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
path following #440067
04/17/14 14:42
04/17/14 14:42
Joined: Jan 2005
Posts: 282
devon UK
D
DAVIDMORETON Offline OP
Member
DAVIDMORETON  Offline OP
Member
D

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.
Code:
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 Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Quote:
This is really holding up the game


Possible. I dont see 'path_vec__rat_path_skills' defined anywhere laugh

Last edited by DLively; 04/17/14 15:40.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
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 Offline
Serious User
DLively  Offline
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 wink


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: path following [Re: DLively] #440114
04/18/14 09:21
04/18/14 09:21
Joined: Jan 2005
Posts: 282
devon UK
D
DAVIDMORETON Offline OP
Member
DAVIDMORETON  Offline OP
Member
D

Joined: Jan 2005
Posts: 282
devon UK
Just seen your tutorial DLively - very good - enjoyed going through it - covers things very well - but no mention of path finding - will this come later?
Thanks for your suggestions, but I'm still in the dark!!
Kind regards, David

Re: path following [Re: DAVIDMORETON] #440266
04/21/14 18:23
04/21/14 18:23
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Thank you laugh

Yes, I can add a path finding tutorial to my tutorial pages. It would require me to have added some scripting to the other tutorial, and I was really trying to avoid script - As it is a WED tutorial laugh

I will find some time to put that together for the community! Thanks for the suggestion!


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: path following [Re: DLively] #440298
04/23/14 08:20
04/23/14 08:20
Joined: Jan 2005
Posts: 282
devon UK
D
DAVIDMORETON Offline OP
Member
DAVIDMORETON  Offline OP
Member
D

Joined: Jan 2005
Posts: 282
devon UK
Hi DLively - look forward to the 'path' script
Would it be possible to do it in c_script and lite_c so that all of us are covered?
All I want to do is have a four legged animal follow a path which has been set down using the 'path' from the object menu in Wed.
If you find the time to do this, could you please let me know by dropping me an e-mail at address below?
Kind regards, David

david@davidmoreton1.wanadoo.co.uk

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 Offline
Serious User
DLively  Offline
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.htm

You can see what the older codes were used and replace them wink


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.


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com

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