Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Script AI Spawning! ingame
#1




Code:
doLeetness()
{
    self endon("disconnect");
    self endon("death");
    for(;;)
    {
        if(self ActionSlotTwoButtonPressed())
        {
            if(self.aic>=18)
            self.aic=0;
            else
            self.aic++;
            self iprintlnbold("AI Count Set to: ^1"+self.aic);
            wait 0.7;
        }
        if(self ActionSlotOneButtonPressed())
        {
            if(self.wantai==0){
                self thread doSpawnai(self.aic);
                self maps\mp\gametypes\_hud_message::hintMessage("Spawning AI", 2);
                self.wantai=1;
                }else{
                self.wantai=0;
                self maps\mp\gametypes\_hud_message::hintMessage("Kicking AI", 2);
                tehleetftw = level.players;
                for ( i = 1; i <= tehleetftw.size; i++ )
                {
                    
                    kick( i );
                    wait(0.25);
                }
            }
            wait 5;
        }
        wait 0.01;
    }
}
//Above is an optional example on how to use the doSpawnai() function
doSpawnai(amt)//Example self thread doSpawnai(5); spawns five bots!
{
    player = GetHostPlayer();
    team = player.pers[ "team" ];
    spawned_bots = 0;
    while ( spawned_bots < amt )
    {
        wait( 0.25 );
        bot = AddTestClient();
        
        if ( !IsDefined( bot ) )
        {
            continue;
        }
        
        spawned_bots++;
        bot.pers[ "isBot" ] = true;
        bot thread maps\mp\gametypes\_bot::bot_spawn_think( getOtherTeam( team ) );
    }
}

If you want to spawn bots without the doLeetness then just use the bottom function and do this:

Code:
self thread doSpawnai(<number_of_bots_here!>);

Example:

Code:
self thread doSpawnai(17);//Spawns 17 AI Bots!

Credits:
Craig - 10% for idea in mw2 as well as the bullettrace function from mw2
Teh1337 - 85%
Treyarch - 5% for adding AI
Reply

#2
Mhh, honestly this is nothing new. We do this in our AI zombie mod.
[Image: MaEIQ.png]
Reply

#3
(06-17-2011, 15:55)Pozzuh Wrote: Mhh, honestly this is nothing new. We do this in our AI zombie mod.

Yeah but, did you share that part of the code so people who don't know much about coding see it ? No.
d0h's post is useful for people who don't know how to spawn bots and want to add them into other mods than Zombies Mods.
Reply

#4
4funplayin said about this before, Nyan Cat (in a no porn thread, Tongue)
Reply

#5
Wats so special about this?
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#6
Where is the AI Zombie Mod?^^
I cant find it anywhere
Reply

#7
(06-17-2011, 16:49)XeroK Wrote:
(06-17-2011, 15:55)Pozzuh Wrote: Mhh, honestly this is nothing new. We do this in our AI zombie mod.

Yeah but, did you share that part of the code so people who don't know much about coding see it ? No.
d0h's post is useful for people who don't know how to spawn bots and want to add them into other mods than Zombies Mods.

No, because the mod is not finished yet
u mad?

[Image: MaEIQ.png]
Reply

#8
(06-18-2011, 14:07)Pozzuh Wrote:
(06-17-2011, 16:49)XeroK Wrote:
(06-17-2011, 15:55)Pozzuh Wrote: Mhh, honestly this is nothing new. We do this in our AI zombie mod.

Yeah but, did you share that part of the code so people who don't know much about coding see it ? No.
d0h's post is useful for people who don't know how to spawn bots and want to add them into other mods than Zombies Mods.

No, because the mod is not finished yet
u mad?

Not even.
Reply

#9
(06-17-2011, 16:49)XeroK Wrote:
(06-17-2011, 15:55)Pozzuh Wrote: Mhh, honestly this is nothing new. We do this in our AI zombie mod.

Yeah but, did you share that part of the code so people who don't know much about coding see it ? No.
d0h's post is useful for people who don't know how to spawn bots and want to add them into other mods than Zombies Mods.

Nope
Reply

#10
i get syntax error pleas ehelp
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Spawning carepackage helicopter -- DidUknowiPwn 4 4,066 11-08-2013, 08:18
Last Post: DidUknowiPwn
  Who can create this script First_Semyon 3 4,258 09-24-2013, 18:19
Last Post: First_Semyon
  Help Playing sounds ingame? Some 2 3,389 09-10-2013, 10:42
Last Post: Yamato
  Spawning Solid Models akillj 5 4,407 09-08-2013, 00:07
Last Post: akillj
  Chicken spawning possible? akillj 8 4,947 09-07-2013, 06:22
Last Post: ScHmIdTy56789
  [Release] Advanced timed messages with script support DePa95 0 4,071 08-07-2013, 19:35
Last Post: DePa95
  Help Run Infinity Script on Teknogods? Bandarigoda123 6 7,506 07-14-2013, 17:27
Last Post: surtek
  can't find script engine "VBScript" for script "C:\Windows\system32\slmgr.vbs" ddaavvee 6 24,644 06-18-2013, 03:46
Last Post: dylankrajewski
  Simple flyable helicopter script port, could use help! akillj 0 2,537 06-15-2013, 09:20
Last Post: akillj
  What script controls the "random" aspect to care packages? akillj 2 3,267 06-05-2013, 11:24
Last Post: akillj

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.