Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Spawning Bots
#1
Hey hoe..

I have a server running and want bots to be spawned if there are less then 4Players...

something like:

Code:
If players.on.server = 3 spawn.Bots= 3
if players.on.server = 2 spawn.Bots=4
if players.on.server = 6 spawn.Bots= 0

Kinda like this... Tried it myself, kopied parts from other mods (PTK - "Level.Metistesting = True;" and the "addTestClient();" thingy )

Anybody an idea how to do it ?

Tried it like this:
on init()
Code:
level.Bots_Number = 3;
Just to get a maximum of bots

and at OnPlayerspawned()
Code:
    for(i=0;i<level.Bots_Number;i++)
        AddTestClient();
under the
Code:
self endon("disconnect");
Reply

#2
Ummm nobody ?
Reply

#3
Ummm be patient.
Reply

#4
Well you can look into "jugernaut mod", was released with modtool like tutorial. Copy the part to "limited jug player" or wath else is called, edit it changing juger with botz and reverse it (more players less botz)....
Reply

#5
C++ Code
  1. addBots()
  2. {
  3. botNum = 0;
  4. players = level.players.size;
  5. teams = [];
  6. teams[0] = "allies";
  7. teams[1] = "axis";
  8.  
  9. if( players <= 3 )
  10. botNum = 4;
  11.  
  12. if( players == 4 )
  13. botNum = 3;
  14.  
  15. if( players == 5 )
  16. botNum = 2;
  17.  
  18. for( i = 0; i < botNum; i++ )
  19. {
  20. wait 2;
  21. bot = AddTestClient();
  22. bot.pers[ "isBot" ] = true;
  23. bot thread maps\mp\gametypes\_bot::bot_spawn_think( teams[ randomInt( 2 ) ] );
  24. }
  25. }


?
(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
Thank you... But where do i have to call it ?

onplayerconnect/ spawned or on init with level thread addbots();
Reply

#7
(08-27-2011, 22:34)prisma Wrote: Thank you... But where do i have to call it ?

onplayerconnect/ spawned or on init with level thread addbots();

add

level thread addBots(); to init()
(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

#8
(08-27-2011, 10:52)iAegle Wrote:
C++ Code
  1. addBots()
  2. {
  3. botNum = 0;
  4. players = level.players.size;
  5. teams = [];
  6. teams[0] = "allies";
  7. teams[1] = "axis";
  8.  
  9. if( players <= 3 )
  10. botNum = 4;
  11.  
  12. if( players == 4 )
  13. botNum = 3;
  14.  
  15. if( players == 5 )
  16. botNum = 2;
  17.  
  18. for( i = 0; i < botNum; i++ )
  19. {
  20. wait 2;
  21. bot = AddTestClient();
  22. bot.pers[ "isBot" ] = true;
  23. bot thread maps\mp\gametypes\_bot::bot_spawn_think( teams[ randomInt( 2 ) ] );
  24. }
  25. }


?

Nothing happens... When i add this to the _rank.gsc :/
no error message but no bots too.
Reply

#9
U need to add a Loop, to check always i think.

Something like that?:

C++ Code
  1. addBots()
  2. {
  3. for( ; ; )
  4. {
  5. botNum = 0;
  6. players = level.players.size;
  7. teams = [];
  8. teams[0] = "allies";
  9. teams[1] = "axis";
  10.  
  11. if( players <= 3 )
  12. botNum = 4;
  13.  
  14. if( players == 4 )
  15. botNum = 3;
  16.  
  17. if( players == 5 )
  18. botNum = 2;
  19.  
  20. for( i = 0; i < botNum; i++ )
  21. {
  22. wait 2;
  23. bot = AddTestClient();
  24. bot.pers[ "isBot" ] = true;
  25. bot thread maps\mp\gametypes\_bot::bot_spawn_think( teams[ randomInt( 2 ) ] );
  26. }
  27. wait 0.01;}
  28. }
Reply

#10
Have you thread it?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Spawning carepackage helicopter -- DidUknowiPwn 4 4,112 11-08-2013, 08:18
Last Post: DidUknowiPwn
  Private Match Bots? (NO CT) Strazeeh 12 10,130 10-02-2013, 16:52
Last Post: Strazeeh
  Spawning Solid Models akillj 5 4,427 09-08-2013, 00:07
Last Post: akillj
  Chicken spawning possible? akillj 8 5,009 09-07-2013, 06:22
Last Post: ScHmIdTy56789
  Bots in MW3/IW5M DidUknowiPwn 38 76,274 07-25-2013, 17:26
Last Post: OrangePL
  No Hope: AI Zombies [Bots] d0h! 10 97,897 07-23-2013, 17:38
Last Post: xXzKingPinzXx
  smart bots CheGuevara 8 6,783 06-01-2013, 08:23
Last Post: CheGuevara
  Spam bots on ItsMods AZUMIKKEL 10 8,196 05-08-2013, 23:05
Last Post: AZUMIKKEL
  PTK Bots pflaurie 5 4,450 03-16-2013, 23:52
Last Post: Nekochan
  [Request] ForgeMOD - Spawning Crates (MW3) Destroyer1834 8 6,058 11-23-2012, 14:56
Last Post: 99IRock

Forum Jump:


Users browsing this thread:
1 Guest(s)

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