2 registered members (ozgur, TipmyPip),
722
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: A7 support for pathfinding by Hendrik Felix Pohl?
[Re: Superku]
#415557
01/20/13 13:19
01/20/13 13:19
|
Joined: Jan 2013
Posts: 30
Romin
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 30
|
I am using A7 and it doesn't seems to support str_printf and sys_markers. Here is the error... What is workaround please?
|
|
|
Re: A7 support for pathfinding by Hendrik Felix Pohl?
[Re: Superku]
#415664
01/22/13 02:26
01/22/13 02:26
|
Joined: Jan 2013
Posts: 30
Romin
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 30
|
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)
///////////////////////////////
#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?
|
|
|
Re: A7 support for pathfinding by Hendrik Felix Pohl?
[Re: Romin]
#415671
01/22/13 05:19
01/22/13 05:19
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
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
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|