Stackbot Raw Files

Have a question you need to ask? Need help? Ask here!

Moderator: Core Staff

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Stackbot Raw Files

Post by mik3yb » December 7th, 2010, 5:23 am

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?
Image

User avatar
R4d0xZz
CJ Fan
CJ Fan
Posts: 199
Joined: August 24th, 2009, 2:08 am
Location: Berlin
Contact:

Re: Stackbot Raw Files

Post by R4d0xZz » December 7th, 2010, 2:53 pm

why don't you just decompile the .ff ??
Image|Image
Image|Image
Image|Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Stackbot Raw Files

Post by Drofder2004 » December 7th, 2010, 5:53 pm

R4d0xZz wrote:why don't you just decompile the .ff ??
Because some people don't appreciate you stealing their work... >.>
Image
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

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Re: Stackbot Raw Files

Post by mik3yb » December 7th, 2010, 9:21 pm

rofl
Image

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Re: Stackbot Raw Files

Post by mik3yb » December 7th, 2010, 11:13 pm

This is what i have in the way of bots so far

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 >:(
Image

_DanTheMan_
PC Team
PC Team
Posts: 294
Joined: September 6th, 2008, 2:14 am

Re: Stackbot Raw Files

Post by _DanTheMan_ » December 7th, 2010, 11:19 pm

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).
You do not have the required permissions to view the files attached to this post.
Image

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Re: Stackbot Raw Files

Post by mik3yb » December 7th, 2010, 11:32 pm

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
Image

_DanTheMan_
PC Team
PC Team
Posts: 294
Joined: September 6th, 2008, 2:14 am

Re: Stackbot Raw Files

Post by _DanTheMan_ » December 8th, 2010, 11:31 pm

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

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Re: Stackbot Raw Files

Post by mik3yb » December 9th, 2010, 12:41 am

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

User avatar
Opel
CJ Fan
CJ Fan
Posts: 188
Joined: September 15th, 2008, 12:28 pm
Location: Scotland

Re: Stackbot Raw Files

Post by Opel » December 9th, 2010, 2:11 pm

Code: Select all

onPlayerDisconnect()
{
	self waittill("disconnect");
        deletebots();
}
like that?

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Re: Stackbot Raw Files

Post by mik3yb » December 10th, 2010, 1:12 am

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

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Re: Stackbot Raw Files

Post by mik3yb » December 10th, 2010, 4:21 am

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);
}
The thread heckBot() is called on playerSpawned just before _init_bots(). The bots spawn but then are imdeately kicked after. I think this is because i am running the serverside kickBots() thread wrong if anyone has any information on whether or not you can do self kick() or any other suggestions i would great apreciate it.

Thnx ,
Mike
Image

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Re: Stackbot Raw Files

Post by [SoE]_Zaitsev » December 10th, 2010, 12:37 pm

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

User avatar
mik3yb
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 4th, 2010, 1:18 am
Location: Ontario

Re: Stackbot Raw Files

Post by mik3yb » December 10th, 2010, 6:03 pm

i don't want bots that attack... lol
Image

User avatar
Opel
CJ Fan
CJ Fan
Posts: 188
Joined: September 15th, 2008, 12:28 pm
Location: Scotland

Re: Stackbot Raw Files

Post by Opel » December 10th, 2010, 6:15 pm

Someones ripped the gsc files out of black ops so someone could have a look at the bots code.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests