0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: More then 1 Actor
[Re: Romin]
#415920
01/25/13 16:30
01/25/13 16:30
|
Joined: Jan 2013
Posts: 30
Romin
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 30
|
After digging all the old and dusty posts i found 1 solution offered by a user named snake67 in 2010. Here is his solution...
Its so simple. You leave the A* files as they are, just include them. Then add this pices where you need them:
// define this
#define _path_n skill30
#define PATH_POINT_MAX 20 // or what you want
typedef struct
{
var x,y,z;
} POINT;
// insert this in actor action
POINT* path_point=malloc(PATH_POINT_MAX*sizeof(POINT)); // allocate buffer to store path points
// scan path to player and copy it in buffer
if(asFindasPath(my.x, player.x))
{
for(my._path_n=0; asPath.head!=NULL && my._path_n<PATH_POINT_MAX; my._path_n++)
{
vec_set(path_point[my._path_n].x, asPath.head.pos);
asPath.itr=asPath.head;
asRemoveNode(asPath);
}
}
But unfortunately i couldn't understand it. Does anybody knows how to use it? Please your answer worths millions for me, i am stuck badly with it.
|
|
|
Re: More then 1 Actor
[Re: 3run]
#415927
01/25/13 18:18
01/25/13 18:18
|
Joined: Jan 2013
Posts: 30
Romin
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 30
|
There is a way to make it move without structure and stuff! Just don't be such a lazy ass and make all global stuff local! And stop spamming everything and everyone! I am not very expert in coding. Which global variables i should set to local? Can you provide me your modified code please? Please someone tell me how to make it work for multiple bots?
Last edited by Romin; 01/25/13 18:23.
|
|
|
Re: More then 1 Actor
[Re: MasterQ32]
#415929
01/25/13 18:41
01/25/13 18:41
|
Joined: Jan 2013
Posts: 30
Romin
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 30
|
In 2 words he just said to "change global stuff to local" whithout considering how hard it is for a newbie to change source of a pathfinding. I still don't have any clue what to do. A guru help me please.
|
|
|
Re: More then 1 Actor
[Re: Romin]
#415930
01/25/13 18:46
01/25/13 18:46
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
belive me i am very good at coding in gamestudio This shouldn't be too much of a problem for someone very good at coding... You just have the wrong attitude towards this. http://tutorial.3dgamestudio.net/
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: More then 1 Actor
[Re: Uhrwerk]
#415931
01/25/13 18:54
01/25/13 18:54
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
belive me i am very good at coding in gamestudio lol, so I'm not the only one getting this kind of messages from him! coding guru Romin, here are the differences between local and global:
VECTOR temp_vec; // fucking global shit!
// useful function goes here:
function killYouSeft(){
VECTOR temp_vec; // fucking local shit!
}
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|