Post: AI Pathing [Script]
09-07-2013, 03:11 PM #1
(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! Smile

The following 8 users say thank you to Uk_ViiPeR for this useful post:

Alex-George-HnM, Choco, codybenti, Beats, Jacob-And-Britt, M0T1VAT10N, ICS Vortex, sirsmokealotENG
09-11-2013, 10:10 PM #11
Originally posted by codybenti View Post
Thank you Uk_ViiPeR for this!Smile
I'm think of making an A.G.R. Killstreak script.
The hard part is creating a path for every COD4 map (not looking forward to that).:\


You could try using bullet traces and when it detects a wall or object it turns 90 degrees and carries on its way.. Might work Winky Winky
09-12-2013, 06:41 PM #12
Originally posted by x View Post
You could try using bullet traces and when it detects a wall or object it turns 90 degrees and carries on its way.. Might work Winky Winky


Me and Karoolus tried that about a year ago and had no luck what so ever, it would be useful if we got it to work properly :p
09-12-2013, 09:39 PM #13
Originally posted by ViiPeR View Post
Me and Karoolus tried that about a year ago and had no luck what so ever, it would be useful if we got it to work properly :p
Piece of piss Winky Winky

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo