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-07-2013, 05:47 PM #2
Jacob-And-Britt
I’m too L33T
Originally posted by ViiPeR View Post
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
Nice, its good to see you back in this section for a bit. Also are you talking about making ai zombies for cod4? I wanted to really bad lol i spent like 2 weeks trying to get cod 4 ai bots, but i couldn't ever get them. If you are making it for cod 4 and need help with map edits or somthing like that let me know. (I know u dont need help what i mean by this is maybe theres a map you dont want to screw with lol)
09-07-2013, 08:59 PM #3
Originally posted by Britt View Post
Nice, its good to see you back in this section for a bit. Also are you talking about making ai zombies for cod4? I wanted to really bad lol i spent like 2 weeks trying to get cod 4 ai bots, but i couldn't ever get them. If you are making it for cod 4 and need help with map edits or somthing like that let me know. (I know u dont need help what i mean by this is maybe theres a map you dont want to screw with lol)


Yeah i've been working on an ai zombies patch for awhile now, ive got two versions coming soon. one of them is normal gameplay with ai attached to certain people so it will move towards them where ever they move, and i have a pathed map edit one too but ive only done about 3 map edits so ill give you a shout if i need anymore done Smile

The following user thanked Uk_ViiPeR for this useful post:

Jacob-And-Britt
09-07-2013, 10:07 PM #4
Originally posted by ViiPeR View Post
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


This is also the only way that me and Amanda found to attach yourself to a chopper without it freezing when you detach..

Spawn chopper > attach script_model to chopper tag > attach self to script_model

The following user thanked x_DaftVader_x for this useful post:

Uk_ViiPeR
09-08-2013, 11:09 AM #5
Originally posted by x View Post
This is also the only way that me and Amanda found to attach yourself to a chopper without it freezing when you detach..

Spawn chopper > attach script_model to chopper tag > attach self to script_model


That's exactly true, you can use this to attach your player do any script_origin or script_model which is quite useful! if you can find pre-stocked targetnames on SD bomb's etc... then you can link stuff to them too Smile

Btw are you resuming your work for CoD? or have you stopped completely?
09-08-2013, 07:33 PM #6
Originally posted by ViiPeR View Post
That's exactly true, you can use this to attach your player do any script_origin or script_model which is quite useful! if you can find pre-stocked targetnames on SD bomb's etc... then you can link stuff to them too Smile

Btw are you resuming your work for CoD? or have you stopped completely?


Apart from occasionally helping people with stuff on here I haven't touched it since I finished my Legacy patch a year ago.
Don't have it on PC, don't have a JB PS3 anymore either.


Like I said before, COD is done now, but I still have the occasional idea, so never say never I guess Winky Winky

The following user thanked x_DaftVader_x for this useful post:

Uk_ViiPeR
09-09-2013, 12:08 AM #7
Jacob-And-Britt
I’m too L33T
Originally posted by x View Post
Apart from occasionally helping people with stuff on here I haven't touched it since I finished my Legacy patch a year ago.
Don't have it on PC, don't have a JB PS3 anymore either.


Like I said before, COD is done now, but I still have the occasional idea, so never say never I guess Winky Winky
It would be cool if you could return to the cod4 section. As far as the section being dead is cus nobody has found anything big and new such as clonebrushmodel for cod4 if someone found somthing like that we could start making models that can move and stay solid so this mean lots of new skybases and much much more! I would make allot of stuff with it lol
09-09-2013, 08:39 PM #8
I always assumed that the clonebrush/solid models were tied into the maps.. If you use forge mode to pick up a car, the trigger radius for the solid car stays where it was and you just pick up the non solid model for the car..

But I'm certainly not going to spend any time trying to work it out now and I'm not sure there's much left to do for COD4 after Mine, Amanda's and EliteMods patches.. we pretty much made everything there is to make..
( This is not counting the amazing stuff the PC modders have done over the years of course)
09-10-2013, 05:50 AM #9
Jacob-And-Britt
I’m too L33T
Originally posted by x View Post
I always assumed that the clonebrush/solid models were tied into the maps.. If you use forge mode to pick up a car, the trigger radius for the solid car stays where it was and you just pick up the non solid model for the car..

But I'm certainly not going to spend any time trying to work it out now and I'm not sure there's much left to do for COD4 after Mine, Amanda's and EliteMods patches.. we pretty much made everything there is to make..
( This is not counting the amazing stuff the PC modders have done over the years of course)
Obviously you and the others found and made a buch of new stuff btu there is always new stuff to be made like i am making new stuff and currently working on new stuff for the game and you brought so much new stuff if you come back it would be awesome!
09-10-2013, 05:39 PM #10
Originally posted by ViiPeR View Post
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

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).:\

The following user thanked codybenti for this useful post:

Uk_ViiPeR

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo