A7 support for pathfinding by Hendrik Felix Pohl?

Posted By: Romin

A7 support for pathfinding by Hendrik Felix Pohl? - 01/19/13 16:08

Hi,

I downloaded the pathfinding by Hendrik Felix Pohl which is in goodies8 zip file from the 3dgs download site. But found it was not compatible with a7 because it included lots of stuff from a8 like str_printf and sys_marker etc.

Can someone help me to make it work with a7 please?

Thanks in advance.
Posted By: Superku

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/19/13 16:19

Oops, sys_marker is not supposed to be there, you can delete that line.
However, all instructions are A7 instructions including str_printf and sys_marker. Do you mean to use the script with C-Script instead?
Posted By: Romin

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/20/13 13:19

I am using A7 and it doesn't seems to support str_printf and sys_markers.
Here is the error...


What is workaround please?
Posted By: Superku

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/20/13 16:32

Update your A7 version:
http://www.3dgamestudio.com/download.php
(at the bottom of the page)
Posted By: Romin

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 02:26

Ok i updated my A7 and it works now. But i have a problem and need your help please.

I modified the level and put a warlock model in the corner of the level. so to make the main warlock model to reach it.

here is the modified code...(I made it as simple as possible to understand how your pathfinding works)
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include "pathfinding.c"
///////////////////////////////

ENTITY* getme;
VECTOR mouse_target,temp,temp2;

void main()
{
	fps_max = 60;
	video_mode = 9;
	ent_path_init();
	level_load("test.WMB");
}

action dummy()
{
	getme=my;
}

action path_test2()
{
	while(1)
	{
		ent_path_get_target(my,getme.x,temp);
		
		if(vec_dist(temp,my.x) > 16)
		{
			//turn to temp;
			//move to temp;
			
			vec_diff(temp2,temp,my.x);
			vec_to_angle(temp,temp2);
			my.pan += ang(temp.x-my.pan)*0.5*time_step;
			result = c_move(me,vector(maxv(10-0.1*abs(ang(temp.x-my.pan)),0)*time_step,0,0),nullvector,IGNORE_PASSABLE | GLIDE);
			my.skill1 += result;
			my.skill1 %= 100;
			ent_animate(me,"run",my.skill1,ANM_CYCLE);
			
		}
		wait(1);
	}
}



It doesn't work. can you correct the code and post it here please?
Posted By: Superku

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 02:31

Quote:
It doesn't work.

Explain.
Posted By: Romin

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 03:00

It says... Crash in path_test2

Can you test this code, make it work and repost it here please.
Thanks in advance.
Posted By: WretchedSid

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 05:19

Make sure that your pointers are valid first!
Superkus code has been throughly tested and used by others and thus far it did work for all of them. Your code on the other hand is prone to pointer errors due to race conditions wink
Posted By: rayp

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 05:27

The code is working like a clockwork ! fact.
Posted By: Romin

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 15:45

It is not working for me. Can someone fix it and post it here please?
I need it urgently.
Posted By: Superku

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 17:14

Quote:
Make sure that your pointers are valid first!

Obviously you don't need the code urgently or otherwise you would have tried JustSid's solution already:

action path_test2()
{
while(!getme) wait(1); // wait for the pointer to become valid
while(1)
...
Posted By: WretchedSid

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 18:38

Originally Posted By: Romin
It is not working for me. Can someone fix it and post it here please?
I need it urgently.

Sorry pal, but this isn't how it works. What's urgently and what is not is highly subjective, just because something is urgent for you doesn't mean that we are obliged to help you with in minutes. Much less it means that we fix and write your code!
If you need help, we are here to give you pointers in the right direction. We do this in our free time, instead of working on our own projects or doing other things. We don't owe you an answer, and much less owe we work to you.
Posted By: Romin

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 21:04

Originally Posted By: Superku

Obviously you don't need the code urgently or otherwise you would have tried JustSid's solution already:


I am sorry guys i am not very good at explaining things. I already mentioned in my previouse code that JustSid's solution didn't work.

I am uploading the level so you can check it yourself and see what is wrong.

DOWNLOAD
Posted By: Superku

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 21:59

You did not say that, you didn't even write that it does not crash anymore. The reason why the pathfinding does not seem to work is obvious when you press F11 twice. Then compare your code with the original pathfinding example from the goodies archive.
Posted By: Romin

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/22/13 23:03

Originally Posted By: Superku
You did not say that, you didn't even write that it does not crash anymore. The reason why the pathfinding does not seem to work is obvious when you press F11 twice. Then compare your code with the original pathfinding example from the goodies archive.


I tested the same code with the level included in your pathfinding and it works but the same code with this level which i included in my previouse post doesn't work?

I pressed f11 twice and saw there was smaller bounding box around my player so i copied these 3 lines from your code to my code and it still doesn't work.

Code:
c_setminmax(my);
vec_fill(my.min_x,-24);
vec_fill(my.max_x,24);



Please can you download my level and fix it? I will be very thanks full.
Posted By: Romin

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/23/13 15:09

Helloooooooooooooooo Anyone?
Posted By: Uhrwerk

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/23/13 16:23

You're impertinent. You cannot expect others to do your work!

http://www.conitec.net/litec/work16.htm !
http://www.conitec.net/litec/work17.htm !
Posted By: Ch40zzC0d3r

Re: A7 support for pathfinding by Hendrik Felix Pohl? - 01/23/13 17:25

Why dont you comment out code and see where exactly it crashes?
Would take 5 mins. Do your own stuff and dont c&p code and when it crashes let others fix it...
Its normal to have problems, and to need help but c&ping code here and expect that we fix it is simply rude.
© 2024 lite-C Forums