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

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

#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.

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

#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


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

#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]

#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.

#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

#10
i get syntax error pleas ehelp



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.