Stackbot Raw Files
Moderator: Core Staff
Stackbot Raw Files
Any chance i could get the raw files for the stackbot mod from _DanTheMan_?
If thats not possible could anyone explain to me how to code connecting dummy bots and having them join a team?
If thats not possible could anyone explain to me how to code connecting dummy bots and having them join a team?

-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Stackbot Raw Files
Because some people don't appreciate you stealing their work... >.>R4d0xZz wrote:why don't you just decompile the .ff ??

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Stackbot Raw Files
This is what i have in the way of bots so far
But i keep getting this error in my server feed and i'm RLLY lost..
The reason i want to freeze controls is they keep running around when they needa be blocking me >:(
Code: Select all
bots()
{
wait 5;
bots = [];
num_Bots = 5;
for(i = 0;i<num_Bots;i++)
{
bots[i] = addtestclient();
bots[i].pers["isBot"] = true;
wait 0.1;
bots[i] notify("menuresponse", "bot", "player");
}
self thread freezeBots();
}
freezeBots()
{
wait 15;
for(;;)
{
players = getentarray("player", "classname"); //ONLY FOR PLAYER ENTITYY
tempGuid = self getGuid();
for(i=0;i<=players.size;i++)
{
if(tempGuid == "")
{
players[i] freezecontrols(true);
wait 0.05;
}
wait 0.05;
}
wait 10;
}
}
But i keep getting this error in my server feed and i'm RLLY lost..
Code: Select all
PunkBuster Server: Preparing to Disable PB Server... (C:\Program Files (x86)\Activision\COD4 Server Hosting\pb\)
Hitch warning: 2316 msec frame time
SV_DirectConnect()
Connecting player #0 has an unknown GUID
Going from CS_FREE to CS_CONNECTED for (num 0 guid "")
SV_SendClientGameState() for bot0
Going from CS_CONNECTED to CS_CLIENTLOADING for bot0
Sending 13432 bytes in gamestate to client: 0
Going from CS_CLIENTLOADING to CS_ACTIVE for bot0
SV_DirectConnect()
Connecting player #1 has an unknown GUID
Going from CS_FREE to CS_CONNECTED for (num 1 guid "")
SV_SendClientGameState() for bot1
Going from CS_CONNECTED to CS_CLIENTLOADING for bot1
Sending 13432 bytes in gamestate to client: 1
Going from CS_CLIENTLOADING to CS_ACTIVE for bot1
SV_DirectConnect()
Connecting player #2 has an unknown GUID
Going from CS_FREE to CS_CONNECTED for (num 2 guid "")
SV_SendClientGameState() for bot2
Going from CS_CONNECTED to CS_CLIENTLOADING for bot2
Sending 13432 bytes in gamestate to client: 2
Going from CS_CLIENTLOADING to CS_ACTIVE for bot2
SV_DirectConnect()
Connecting player #3 has an unknown GUID
Going from CS_FREE to CS_CONNECTED for (num 3 guid "")
SV_SendClientGameState() for bot3
Going from CS_CONNECTED to CS_CLIENTLOADING for bot3
Sending 13432 bytes in gamestate to client: 3
Going from CS_CLIENTLOADING to CS_ACTIVE for bot3
SV_DirectConnect()
Connecting player #4 has an unknown GUID
Going from CS_FREE to CS_CONNECTED for (num 4 guid "")
SV_SendClientGameState() for bot4
Going from CS_CONNECTED to CS_CLIENTLOADING for bot4
Sending 13432 bytes in gamestate to client: 4
Going from CS_CLIENTLOADING to CS_ACTIVE for bot4
******* script runtime error *******
struct is not an entity: (file 'maps/mp/gametypes/_codjumper.gsc', line 1551)
tempGuid = self getGuid();
*
Error: started from:
(file 'maps/mp/gametypes/_codjumper.gsc', line 1547)
wait 15;
*
Error: ************************************
********************
ERROR: script runtime error
(see console for details)
struct is not an entity
********************
----- Server Shutdown -----
==== ShutdownGame (1) ====
Going to CS_ZOMBIE from 4 for bot0
0:bot0 EXE_DISCONNECTED
Going to CS_ZOMBIE from 4 for bot1
1:bot1 EXE_DISCONNECTED
Going to CS_ZOMBIE from 4 for bot2
2:bot2 EXE_DISCONNECTED
Going to CS_ZOMBIE from 4 for bot3
3:bot3 EXE_DISCONNECTED
Going to CS_ZOMBIE from 4 for bot4
4:bot4 EXE_DISCONNECTED
The reason i want to freeze controls is they keep running around when they needa be blocking me >:(

-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Stackbot Raw Files
Added the only relevant file to the attachment below, if you want to look at what I did.
The init() function in this script is threaded after the line [[level.onStartGameType]](); in the function Callback_StartGameType() in _globallogic.gsc.
The part of the code you are looking for is at the function init_bot(). Also, make sure when you are using bots to turn Punkbuster off, because otherwise you will get errors (at least, I always did).
The init() function in this script is threaded after the line [[level.onStartGameType]](); in the function Callback_StartGameType() in _globallogic.gsc.
The part of the code you are looking for is at the function init_bot(). Also, make sure when you are using bots to turn Punkbuster off, because otherwise you will get errors (at least, I always did).
You do not have the required permissions to view the files attached to this post.
Re: Stackbot Raw Files
lol thnx man.
aghhh, taking what i can from ur script i get a bot but he doesn't spawn
do i need to do _bot.setsessionstate playing or something
aghhh, taking what i can from ur script i get a bot but he doesn't spawn

do i need to do _bot.setsessionstate playing or something

-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Stackbot Raw Files
To be honest, I don't know that much about bots, and I haven't done anything with them for some time now. You'll either have to ask someone else, or play around with the script in the .gsc file I posted until it works, because I'm not very sure on spawning bots.
Re: Stackbot Raw Files
Aight i finalyl got it! the damn bots kept cheating and ggetting kicked which was anoyying but we fixed that. One other question: is there a thread i can create ie. like onPlayerConnect() called onPlayerDisconnect()? obvisouly to use to kick the bots if there is nobody on the server.

Re: Stackbot Raw Files
Code: Select all
onPlayerDisconnect()
{
self waittill("disconnect");
deletebots();
}
Re: Stackbot Raw Files
almost .... i was hoping more along the lines i could use ie during a map change ie. onMapChanged() ..
just idk if a thread like that exists or not lol.
just idk if a thread like that exists or not lol.

Re: Stackbot Raw Files
Code: Select all
_init_bots()
{
level.botCount++;
bot_count = 1;
bots = [];
level.botEnt = [];
for(i=0;i<bot_count;i++)
{
bots[i] = addtestclient();
if(!isdefined(bots[i]))
{
println("Couldn't add bots");
wait 1;
continue;
}
bots[i].pers["isBot"] = true;
//bots[i] notify("menuresponse", "bot", "player");
while(!isdefined(bots[i].pers["team"]))
wait .05;
bots[i] thread _botSpawned();
bots[i] [[level.axis]]();
level.botEnt[i] = bots[i] getEntityNumber();
}
}
_kickBots(guid,ent)
{
if(guid == "")
kick(ent);
}
_botSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self FreezeControls(true);
wait 1;
}
}
checkBot()
{
wait 0.5;
tempEnt = self getEntityNumber();
tempGuid = self getGuid();
thread maps\mp\gametypes\_mik3yb::_kickBots(tempGuid,tempEnt);
}
Thnx ,
Mike

-
- Core Staff
- Posts: 14220
- Joined: October 21st, 2004, 7:17 pm
- Location: Holland
- Contact:
Re: Stackbot Raw Files
Black Ops has really good bots in that testing thing. Once modtools are released for that shouldn't people be able to look up that code and improve bots for CoD4 ?
matt101harris wrote:big cock was the first thing that came to my head lol
Re: Stackbot Raw Files
Someones ripped the gsc files out of black ops so someone could have a look at the bots code.
Who is online
Users browsing this forum: No registered users and 3 guests