Frikbots & Skins

Discuss Artificial Intelligence and Bot programming.
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

Lightning Hunter wrote: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.
/me sighs

Do this:

Step 1 - Open bot_misc.qc and find where the function BotName is declared.

Step 2 - Replace it with the following. (The different names is because I don't have a stock copy of FBX Source handy atm due to recent hard drive failures, so I'm ripping this outta Hellsmash's FBX code.)

Code: Select all

string(float r) BotName =
{
	self.b_num = r;
	if (r == 1)
	{	
		self.b_pants = 11;
		self.b_shirt = 0; 
		return "Optimus";
	}
	else if (r == 2)
	{
		self.b_pants = 1;
		self.b_shirt = 3;
		return "Megatron";
	}
	else if (r == 3)
	{	
		self.b_pants = 13;
		self.b_shirt = 2;
                                return "8";
	}
	else if (r == 4)
	{
		self.b_pants = 7;
		self.b_shirt = 6;
                                return "Haro";
	} 
	else if (r == 5)
	{
		self.b_pants = 12;
		self.b_shirt = 6;
                                return "Ryuuga";
	}
	else if (r == 6)
	{
		self.b_pants = 4;
		self.b_shirt = 4;
                                return "Bender";
	}
	else if (r == 7)
	{
		self.b_pants = 2;
		self.b_shirt = 5;
                                return "Gilliam";
	} 
	else if (r == 8)
	{	
		self.b_pants = 10;
		self.b_shirt = 3;
                                return "Omoikane";
	}
	else if (r == 9)
	{
		self.b_pants = 9;
		self.b_shirt = 4;
                                return "Slash";
	}
	else if (r == 10)
	{
		self.b_pants = 4;
		self.b_shirt = 7;
                                return "Pyroro";
	}
	else if (r == 11)
	{
		self.b_pants = 3;
		self.b_shirt = 11;
                                return "Wingnut";
	} 
	else if (r == 12)
	{
		self.b_pants = 13;
		self.b_shirt = 12;
                                return "Mike";
	}
	else if (r == 13)
	{
		self.b_pants = 11;
		self.b_shirt = 2;
                                return "Al";
	}
	else if (r == 14)
	{
		self.b_pants = 0;
		self.b_shirt = 2;
                                return "Inference";
	}
	else if (r == 15)
	{
		self.b_pants = 8;
		self.b_shirt = 9;
                                return "Lopet";
	}
	else if (r == 16)
	{
		self.b_pants = 5;
		self.b_shirt = 10;
                                return "Wodan Ymir";
	}
};
Step 3 - Put this right after where the function PickARandomName is declared:

Code: Select all

void() SetBotSkin =
{
	if(self.netname =="Optimus")
	 self.skin = 0;
	else if(self.netname == "Megatron")
	 self.skin = 1;
	else if(self.netname == "8")
	 self.skin = 2;
	else if(self.netname == "Haro")
	 self.skin = 3;
	else if(self.netname == "Ryuuga")
	 self.skin = 4;
	else if(self.netname == "Bender")
	 self.skin = 5;
	else if(self.netname == "Gilliam")
	 self.skin = 6;
	else if(self.netname == "Omoikane")
	 self.skin = 7;
	else if(self.netname == "Slash")
	 self.skin = 8;
	else if(self.netname == "Pyroro")
	 self.skin = 9;
	else if(self.netname == "Wingnut")
	 self.skin = 10;
	else if(self.netname == "Mike")
	 self.skin = 11;
	else if(self.netname == "Al")
	 self.skin = 12;
	else if(self.netname == "Inference")
	 self.skin = 13;
	else if(self.netname == "Lopet")
	 self.skin = 14;
	else if(self.netname == "Wodan Ymir")
	 self.skin = 15;
};
Step 4 - Put this just before where the function BotConnect(); is declared in bot.qc:

Code: Select all

void() SetBotSkin;
Step 5 - Put this right under the PutClientInServer(); in bot.qc so that it looks like this:

Code: Select all

	PutClientInServer();
                SetBotSkin();
Compile and run.

Special Bonus cookie if you can name where all the bot names are from. (I can guarantee most people probably can't)
Lightning Hunter
Posts: 169
Joined: Wed Nov 28, 2007 6:15 am

Post by Lightning Hunter »

Thanks, that worked - but there is a slight issue. When the bots die, their skin changes to skin 0. Is there a way to stop this from happening? I know it's supposed to be for Team games, so the dead bodies don't have a team color, but it kind of ruins it with custom skins. :o

I really appreciate you taking the time to put up this code!
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

Lightning Hunter wrote:Thanks, that worked - but there is a slight issue. When the bots die, their skin changes to skin 0. Is there a way to stop this from happening? I know it's supposed to be for Team games, so the dead bodies don't have a team color, but it kind of ruins it with custom skins. :o

I really appreciate you taking the time to put up this code!
/me sighs again

Open world.qc and put at the top of the CopyToBodyQue(); Function:

Code: Select all

bodyque_head.skin = ent.skin;
Lightning Hunter
Posts: 169
Joined: Wed Nov 28, 2007 6:15 am

Post by Lightning Hunter »

Awesome, thanks a lot Shadowborg! I'll give back to the community by releasing some waypoints. Is there any map you would like to request?
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

Lightning Hunter wrote:Awesome, thanks a lot Shadowborg! I'll give back to the community by releasing some waypoints. Is there any map you would like to request?
Dunno, I've been too busy in RL(tm), and Developing / Mapping for Hellsmash (my quake mod) to actually play any new maps these days...

That said, feel free to upload any .way files you create to the FXRC:

http://tlb.quakedev.com/files/fbxways/

Also feel free to download any that catch your fancy, that's what FXRC is there for. :wink:
Team Xlink
Posts: 368
Joined: Thu Jun 25, 2009 4:45 am
Location: Michigan

Post by Team Xlink »

Are they from the Metroid Games?
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

Team Xlink wrote:Are they from the Metroid Games?
Um...What? :?: :? :?:

Edit: Ooooh, you mean the bot names? No. At least three of those should be pretty obvious, and none of them have ever appeared in a metroid game, unless there was a sudden interdimensional rift opened up due to Autobots and Decepticons fighting over Energon with Bender acting referee whilst smoking a cigar and swigging Olde Fortran that nobody told me about. :wink:

Here's a hint: All of them are either robots / androids, fictional quantum / high performance AI computers, with the sole exception being a possessed T-72 Main Battle Tank.
Team Xlink
Posts: 368
Joined: Thu Jun 25, 2009 4:45 am
Location: Michigan

Post by Team Xlink »

Dr. Shadowborg wrote:

Code: Select all

void() SetBotSkin =
{
	if(self.netname =="Optimus")
	 self.skin = 0;
Optimus Prime?

Yeah, he was in some of those games.
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

Team Xlink wrote: Optimus Prime?

Yeah, he was in some of those games.
Seriously?

Screenshots or it never happened!
Post Reply