(adsbygoogle = window.adsbygoogle || []).push({});
hello everyone, today I'm bringing you a basic script for AI pathing, now I've experimented many different methods such as using a magic bullet function to prevent colliding with solid objects and used player origins which lead to spawn overflow errors. I've currently found 3 ways you can do this without any errors so i hope you enjoy!
Firstly I'd like to say that most of these functions are not new, so credit goes to the original founders.
The first method is using node origins (script_model) which are spread out, here's an example of what it'll look like. This method isnt fully working and will need more functions added too it, I'll leave you to add the rest.
modela = spawn("script_model",(697, 1057, 185)); //change the co-ords, modela,b,c can be anything.
if((self.name == "bot1")) self linkto( modela); //the bot you will be using
wait 0.5;
modela MoveTo( modelb, 20, .05, .05 );
waittill ("movedone");
modelb = spawn("script_model",(697, 1057, 185)); //change the co-ords
modelb MoveTo( modelc, 20, .05, .05 );
waittill ("movedone");
modelc = spawn("script_model",(697, 1057, 185)); //change the co-ords
self waittill ("death");
self unlink();
modela delete();
The second method is to spawn a script origin and using a movex,y or z function, for example.
self endon("death");
self freezecontrols(true);
modela = spawn("script_model",(697, 1057, 185)); //base origin
modela RotateYaw( 90, 0.3, 0.1, 0.1 );
if((self.name == "bot1")) self setOrigin((697,1057,185)); //must be the same as the base origin
if((self.name == "bot1")) self linkto( modela);
wait 0.5;
modela movey ( 700, 30, 0.1, 0.1);
self waittill ("death");
self unlink();
modela delete();
How it works: it spawn's a script_model with co-ords assigned to it, then the player is linked to the script_model and moved to a position (or to other script_models), pretty basic aye?
The third method is spawning a script_model, linking the ai to it and moveto a player's origin, this is similar to hawkin's UnDead patch but it's not finished just yet.
I'll update the third method when i get it fully working, since there will be two versions of my ai zombie modes currently unfinished. I hope to have a release date for it soon. Thanks for reading and hope these comes to some sort of use in the future!