Frikbots & Skins

Discuss Artificial Intelligence and Bot programming.
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Frikbots & Skins

Post by redrum »

Does anyone know how to give custom skins to Frikbots?
When I spawn them in QW the always use the base skin.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

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.
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

Can you explain how to create / modify the player.mdl file?
I tried to read the file but it was all garbled :( .
Thanks.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

quakeworld doesn't use the player.mdl skin hack
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

CheapAlert wrote:quakeworld doesn't use the player.mdl skin hack
...It doesn't?

God, I loathe QuakeWorld. :/
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

You need to change this code found in bot_qw.qc:

Code: Select all

	// FIXME: do teams properly
	// note this has no effect on infokey
	WriteByte(2, 92 );  // \
	WriteByte(2, 115); // s
	WriteByte(2, 107); // k
	WriteByte(2, 105); // i
	WriteByte(2, 110); // n
	WriteByte(2, 92);  // \
	WriteByte(2, 98);  // b
	WriteByte(2, 97);  // a
	WriteByte(2, 115); // s
	WriteByte(2, 101); // e
	WriteByte(2, 92);  // \
Good luck!
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

Is there a way for each bot to have their own skin?
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 »

Yes.
Supa
Posts: 164
Joined: Tue Oct 26, 2004 8:10 am

Post by Supa »

First a disclaimer:
1) My only real experience in QW modding is from my stupid QW speedmod, FishQuake.
2) I'm not actually looking at the FBX code right now, just working from FrikaC's post, thusly I have no way of actualy checking wheter or not this will work.
3) I am a muppet.

That said:

Code: Select all

97	 a	104	h	111	o	118	v
98	 b	105	i	112	p	119	w
99	 c	106	j	113	q	120	x
100	d	107	k	114	r	121	y
101	e	108	l	115	s	122	z
102	f	109	m	116	t
103	g	110	n	117	u
So if you want one bot to use skin 'foo', you'd do:

Code: Select all

   WriteByte(2, 92 ); // \
   WriteByte(2, 115); // s
   WriteByte(2, 107); // k
   WriteByte(2, 105); // i
   WriteByte(2, 110); // n
   WriteByte(2, 92);  // \
   WriteByte(2, 102); // f
   WriteByte(2, 111); // o
   WriteByte(2, 111); // o
   WriteByte(2, 92);  // \ 
Taking this further you could try this:

Code: Select all

   WriteByte(2, 92 ); // \
   WriteByte(2, 115); // s
   WriteByte(2, 107); // k
   WriteByte(2, 105); // i
   WriteByte(2, 110); // n
   WriteByte(2, 92);  // \

   if (somenumber == 0)
   {
         WriteByte(2, 98);  // b
         WriteByte(2, 97);  // a
         WriteByte(2, 115); // s
         WriteByte(2, 101); // e
   }
   else if (somenumber == 1)
   {
         WriteByte(2, 102); // f
         WriteByte(2, 111); // o
         WriteByte(2, 111); // o
   }
   else if (somenumber == 2)
   {
         WriteByte(2, 98);  // b
         WriteByte(2, 97);  // a
         WriteByte(2, 114); // r
   }

   WriteByte(2, 92);  // \ 
(And so on..)

Of course, I could be wrong. =)
Electro
Posts: 312
Joined: Wed Dec 29, 2004 11:25 pm
Location: Brisbane, Australia
Contact:

Post by Electro »

Another step to take that to would be to make use of string manipulation stuff in newer engines

but of course that's probably not desirable because backwards compatibility would be shot

If it's not an issue then you could rather easily write a function that iterates through every letter in the skin and substitues it for the number and does the writebyte accordingly.

What a hassle!
Benjamin Darling
http://www.bendarling.net/

Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

FrikaC, how would you do it?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

And the next question you would ask is, hmm. But how would Jesus do it?
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.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

he'd say use quake2.
Teiman
Posts: 311
Joined: Sun Jun 03, 2007 9:39 am

Post by Teiman »

Jesus is a crank. He will use a hack like totally different models.

http://en.wikipedia.org/wiki/Crank_%28person%29
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Supa wrote:First a disclaimer:
1) My only real experience in QW modding is from my stupid QW speedmod, FishQuake.
2) I'm not actually looking at the FBX code right now, just working from FrikaC's post, thusly I have no way of actualy checking wheter or not this will work.
3) I am a muppet.

That said:

Code: Select all

97	 a	104	h	111	o	118	v
98	 b	105	i	112	p	119	w
99	 c	106	j	113	q	120	x
100	d	107	k	114	r	121	y
101	e	108	l	115	s	122	z
102	f	109	m	116	t
103	g	110	n	117	u
So if you want one bot to use skin 'foo', you'd do:

Code: Select all

   WriteByte(2, 92 ); // \
   WriteByte(2, 115); // s
   WriteByte(2, 107); // k
   WriteByte(2, 105); // i
   WriteByte(2, 110); // n
   WriteByte(2, 92);  // \
   WriteByte(2, 102); // f
   WriteByte(2, 111); // o
   WriteByte(2, 111); // o
   WriteByte(2, 92);  // \ 
Taking this further you could try this:

Code: Select all

   WriteByte(2, 92 ); // \
   WriteByte(2, 115); // s
   WriteByte(2, 107); // k
   WriteByte(2, 105); // i
   WriteByte(2, 110); // n
   WriteByte(2, 92);  // \

   if (somenumber == 0)
   {
         WriteByte(2, 98);  // b
         WriteByte(2, 97);  // a
         WriteByte(2, 115); // s
         WriteByte(2, 101); // e
   }
   else if (somenumber == 1)
   {
         WriteByte(2, 102); // f
         WriteByte(2, 111); // o
         WriteByte(2, 111); // o
   }
   else if (somenumber == 2)
   {
         WriteByte(2, 98);  // b
         WriteByte(2, 97);  // a
         WriteByte(2, 114); // r
   }

   WriteByte(2, 92);  // \ 
(And so on..)

Of course, I could be wrong. =)
You are absolutely correct. As far as actual implementation, somenumber can be self.b_num, which is the bot template number for names & colors. Also, if you want to make the code FrikQCC/fteqcc specific you can use single quoted letters instead of the ascii-code.
Post Reply