Frikbots & Skins

Discuss Artificial Intelligence and Bot programming.
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

Holy cow! I saw a few apostrophes in there, scar3crow! :D
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

scar3crow wrote:To be honest, if it doesn't involve custom skins, I do just go with DP, whether the server is QW, NQ or DP protocol... Who cares? Its still Quake. With that line of thought, people who don't switch to something that works well between all of them is furthering the divide (which should have died the moment broadband became widely available and the source was released as well). The only difference, thats real to me, is ease of bunnyhopping in QW and NQ. And if your Quake playing is so reliant on that, then you suck at the game. Same thing goes if you only play on dm3 or dm6 or whatnot. There, I said it, I get tired of that shit.
We should play STC more.
scar3crow
InsideQC Staff
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Post by scar3crow »

That we should, didn't Krimzon make a map for it a few years back?

I miss sneaking around and up walls as a Thief, raiding the enemy base...

Urm... Frikbot skins! Still on topic?
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

I was able to apply the custom skins to the bots!
After I did this, the bots are now removed from the scoreboard.
Why did this happen?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Don't mess up those messages.
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

What messages?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Those messages.
scar3crow
InsideQC Staff
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Post by scar3crow »

>_<
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

OK TERRIFIC!
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
Lightning Hunter
Posts: 169
Joined: Wed Nov 28, 2007 6:15 am

Post by Lightning Hunter »

I stumbled upon this thread after trying to give the Frikbots custom skins as well, except I'm not using Quakeworld. I'm not compiling the code with any mods at all; only with Quake. I was hoping I could do it the "quick hack" way, with a player.mdl and modifying bot_misc.qc, as quoted here:
First, you'll need a player.mdl with some different skins on it. Second, look for BotName in bot_misc.qc. Just stick in some self.skin = X where X is the skin number.
So, I have a player.mdl in the /progs folder with 16 different skins. I changed the BotName section in bot_misc.qc to look like this:

Code: Select all

string(float r) BotName =
{
	self.b_num = r;
	if (r == 1)
	{	
		self.skin = 0;
		return "Vincent";
	}
	else if (r == 2)
	{
		self.skin = 1;
		return "Bishop";
	}
	else if (r == 3)
	{	
		self.skin = 2;
		return "Nomad";
Each bot after just has the next skin number. Obviously, something is wrong - because all I see now is the white team skin... Any ideas? Will the quick hack even work at all?
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

It's white because of the missing bshirt/bpants. Likely somewhere else in the code is setting the skin back to 0. Maybe PutClientInServer?
Lightning Hunter
Posts: 169
Joined: Wed Nov 28, 2007 6:15 am

Post by Lightning Hunter »

Um, I only found The following code doing a search for "putclientinserver":

In Bot_qw.qc

Code: Select all

void(float whatbot, float whatskill) BotConnect =
{
	local float f;
	local string h;
	local entity uself;
	
	f = ClientNextAvailable();
	uself = self;
	if(f == -1)
	{
		bprint(PRINT_HIGH, "Unable to connect a bot, server is full.\n");
		return;
	}

	bot_count = bot_count + 1;
	self = GetClientEntity(f);
	bot_start_topic(1);
	self.b_clientno = f;
	self.colormap = f + 1;
	if (whatbot)
		self.netname = BotName(whatbot);
	else
		self.netname = PickARandomName();
	// players can set skill all weird, so leave these checks in
	whatskill = rint(whatskill);
	if (whatskill > 3)
		whatskill = 3;
	else if (whatskill < 0)
		whatskill = 0;
	self.b_skill = whatskill;
	self.b_entertime = time;
	self.team = self.b_pants + 1;
	UpdateClient(self);
	SetNewParms();
	self.ishuman = 2;
	ClientConnect();
	PutClientInServer();
	if(f > 16)
		active_clients2 = active_clients2 | ClientBitFlag(f - 16);
	else
		active_clients1 = active_clients1 | ClientBitFlag(f);
	self = uself;
};
And in bot.qc

Code: Select all

void(float whichteam, float whatbot, float whatskill) BotConnect =
{
	local float f;
	local string h;
	local entity uself;
	
	f = ClientNextAvailable();
	uself = self;
	if(f == -1)
	{
		bprint("Unable to connect a bot, server is full.\n");
		return;
	}
	
	// chat thing

	bot_count = bot_count + 1;
	self = GetClientEntity(f);
	if (!saved_bots)
		bot_start_topic(1);
	self.b_clientno = f;
	self.colormap = f + 1;
	if (whatbot)
		self.netname = BotName(whatbot);
	else
		self.netname = PickARandomName();


	// players can set skill all weird, so leave these checks in
	whatskill = rint(whatskill);
	if (whatskill > 3)
		whatskill = 3;
	else if (whatskill < 0)
		whatskill = 0;
	self.b_skill = whatskill;

	if (teamplay && !coop)
	{
		if (whichteam)
			self.b_pants = FindAnotherColor(uself.team - 1);
		else
			self.b_pants = uself.team - 1;
		self.b_shirt = self.b_pants;
	}

	self.team = self.b_pants + 1;
	UpdateClient(self);
	SetNewParms();
	self.ishuman = 2;
	ClientConnect();
	PutClientInServer();

	active_clients = active_clients | ClientBitFlag(f);

	// this is risky... could corrupt .way files if done wrong
	// If you're not the gambling type, comment this out

	f = ClientBitFlag(self.b_num - 1);
	current_bots = current_bots | f;

	if (self.b_num <= 8)
		saved_skills1 = (saved_skills1 & (65536 - (3 * f)) | (self.b_skill * f));
	else
	{
		f = ClientBitFlag(self.b_num - 9);
		saved_skills2 = (saved_skills2 & (65536 - (3 * f)) | (self.b_skill * f));
	}

	h = ftos(current_bots);
	cvar_set("scratch1", h);
	h = ftos(saved_skills1);
	cvar_set("scratch2", h);
	h = ftos(saved_skills2);
	cvar_set("scratch3", h);
	self = uself;

};
And of course I found putclientinserver in client.qc, but I shouldn't have to change that, right? None of this seems relevant, but I could be wrong. I've only ever done very trivial coding with QuakeC in the past.
Lightning Hunter
Posts: 169
Joined: Wed Nov 28, 2007 6:15 am

Post by Lightning Hunter »

No responses? I guess it's just too much work to get new skins to work with the Frikbots + regular Quake. :?
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

Lightning Hunter wrote:No responses? I guess it's just too much work to get new skins to work with the Frikbots + regular Quake. :?
Make a fresh function to set the skin, and call that AFTER:

Code: Select all

	ClientConnect();
	PutClientInServer();
in BotConnect(); (This is located inside bot.qc)
Lightning Hunter
Posts: 169
Joined: Wed Nov 28, 2007 6:15 am

Post by Lightning Hunter »

I found what you were talking about in bot.qc, but I'm not sure what "fresh function" I could create. Like I said, I'm absolutely noobish at QuakeC.
Post Reply