Getting Frikbots to work in Quakeworld.

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

Post by redrum »

It worked! :o

Next problem, getting 2 lines of MOTD. This is what I tried:

float modelindex_eyes, modelindex_player;
void() CheckMOTD =
{
if ((self.motd_count < 7) && (self.motd_time < time)) // 7 == seconds MOTD will display
{
self.motd_time = time + 1;
self.motd_count = self.motd_count + 1;
centerprint(self, "Welcome to Spisi's fragfest!"\n"FFA 15 fraglimit 7 timelimit\"); //Type in you're message here "\n" = new line
return;

}


I can't get that second line to work. "FFA 15 fraglimit 7 timelimit"
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
scar3crow
InsideQC Staff
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Post by scar3crow »

You had

Code: Select all

 centerprint(self, "Welcome to Spisi's fragfest!"\n"FFA 15 fraglimit 7 timelimit\");
I believe, and Im no expert, it should be

Code: Select all

 centerprint(self, "Welcome to Spisi's fragfest!\nFFA 15 fraglimit 7 timelimit\");
Notice that I removed the inside quotes from the line, because its all the same text message being passed to centerprint. Telling it to end the quote before telling it to linebreak with \n confuses it, and besides, you werent done with the quote yet =)

You might also want to spruce up the language, like "Fraglimit is 15 and the timelimit is 7", its easier to read.

For further example, take a look at the end of episode text here and jump down to void() ExitIntermission =

From that you can see the use of breaklines in quotes as done by id for the epic poetry it displays when you successfully grab a rune. Hope that helps.
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

Sweet! Now we're cooking! You guys are extremely helpfull!

Let's see, I've learned to use the compiler :o
and I've learned to create a MOTD :o Nice!

Now, I read in a frikbot readme file that I could change the name of the bots by editing bot_misc.qc which I did. But it did not work. Now I know why, it needed to be compiled!

Now that I am an expert compiler :), I tried to re-compile the frikbot qwprog.dat file. Of course it won't work.

I copied fteqcc.exe and the frikbot qwprog.dat to the folder with all the frikbot.qc files. Then I ran the compiler. It did not create a new qwprog.dat file.

I looked in my qw folder and saw a progs.cfg file. So I copied that as well and changed the filenames within the file to match the frikbot .qc files. That failed as well. What am I doing wrong?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
scar3crow
InsideQC Staff
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Post by scar3crow »

Compiling qwprogs is different because of how QW changes things to make it more optimized for bandwidth - and thus is out of my range, Ive never compiled a qwprogs before (never tried to, never wondered how honestly). I assume its done via command line argument in the compilers, but couldnt say what. Hopefully someone else will respond on that matter.
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

What do you make of this:

* Comment out the following functions in defs.qc
sound, stuffcmd, sprint, aim, centerprint, setspawnparms
WriteByte, WriteChar, WriteShort, WriteLong, WriteCoord
WriteAngle, WriteString, WriteEntity


I'm following FrikaC's directions of getting his bots in Quakeworld.
I was doing pretty good until this.

What does he mean comment out?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
scar3crow
InsideQC Staff
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Post by scar3crow »

This is some code

Code: Select all

makevectors (self.v_angle);
	source = self.origin + '0 0 16';
This is the same code with a line commented out

Code: Select all

// makevectors (self.v_angle);
	source = self.origin + '0 0 16';
A // tells the compiler "ignore everything on this line past this point
It is used, obviously, to comment your code with what youre intending to do in that spot, or labeling for quick reference.

For example there is a line in defs.qc that is

Code: Select all

void(entity e) setspawnparms		= #78;
To comment out that line, as I believe he is wanting, I may be wrong, would be

Code: Select all

// void(entity e) setspawnparms		= #78;
Heres a little extra, if you wanted to leave a larger comment in some code, say a paragraph, you would use blockquotes, like this

Code: Select all

/* This is my comment, but it may wrap around some or just be too long to look orderly in a qc file and so for organization's sake I am putting it in this block quote. I hope I didnt get it wrong because it would make a fool out of myself on these forums in front of all of my friends */
The compiler will ignore all of that- but it will remain for the coder to see and bring back at a later point if they wish to by removing any form of the comment tags.
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

Maybe you should first try to compile the bots for NQ (non-quakeworld) first, to make sure you have compiling down.

In your source directory (with all the *.qc files), you should have another file called progs.src. This contains where to output the compiled file (progs.dat/qwprogs.dat), and the list of files to compile. If your source files are in /quake/frikbot/qc, then the first line should read '../progs.dat', which would place it one directory up, where the progs.dat is supposed to be.

Don't copy the progs.dat beforehand, you can delete progs.dat before compiling, because compiling will create a new one and if you deleted it it will be easy to see if it worked.

The compiler (FTEQCC.exe, whatever) goes in the same directory as the source files (and the progs.src). If there's something wrong with your code, the compiler will tell you the error (and if nothing is wrong, it will tell you that it succeeded).

Now if you're using a console version of a compiler, the window might close right away so you can't read it. So, try opening up a DOS prompt window (assuming you're on Windows), and running FTEQCC.exe from there, so you can see the output.

And one last thing, in your MOTD centerprint, there is one thing scar3crow forgot to fix.

Code: Select all

centerprint(self, "Welcome to Spisi's fragfest!\nFFA 15 fraglimit 7 timelimit\");
should be

Code: Select all

centerprint(self, "Welcome to Spisi's fragfest!\nFFA 15 fraglimit 7 timelimit");
Without that backslash near the end.



EDIT: Nevermind this last bit, scar3crow beat me to it :p

You can comment out lines of code by putting '//' before them. For example:

Code: Select all

self.health = 100;
//self.ammo_shells = 25;
self.ammo_shells = 100;
The // at the beginning tells the compiler to ignore that line. You can use this to annotate your code, or temporarily disable code as above in case you might want to bring it back later, or whatever
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.
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

OK, I'll give it a go. Thanks to the both of you!
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

Hey guys, I'm going insane now.
I followed FrikaC's instructions:

======================================
These installation instructions only apply to QuakeWorld (as does this entire
file). For Normal Quake, please refer to bot.qc

--------------------------------------
To install on a new mod, do all this:
--------------------------------------
Place all included bot*.qc files in the subdirectory "frikbot"
in your source folder, then...

* Add the following lines to progs.src right after the defs.qc line
frikbot/bot_qw.qc
frikbot/bot_way.qc
frikbot/bot_fight.qc
frikbot/bot_ai.qc
frikbot/bot_misc.qc
frikbot/bot_phys.qc
frikbot/bot_move.qc
--------------------------------------
* Comment out the following functions in defs.qc
sound, stuffcmd, sprint, aim, centerprint, setspawnparms
WriteByte, WriteChar, WriteShort, WriteLong, WriteCoord
WriteAngle, WriteString, WriteEntity
--------------------------------------
* Add this to worldspawn() in world.qc, right at the very top, before InitBodyQue();
BotInit(); // FrikBot
--------------------------------------
* add this line to StartFrame() in world.qc, at the very top
BotFrame(); // FrikBot
--------------------------------------
* Add these two lines to PlayerPreThink in client.qc at the very top
if (BotPreFrame()) // FrikBot
return;
--------------------------------------
* Add this line to PlayerPostThink in client.qc at the very top
if (BotPostFrame()) // FrikBot
return;
--------------------------------------
* Add the following line to the very top of Client Connect in client.qc
ClientInRankings(); // FrikBot
--------------------------------------
* Add these lines to the very top of ClientDisconnect in client.qc
ClientDisconnected(); // FrikBot
--------------------------------------
* Add these lines to the very top of SpectatorConnect in spectate.qc
ClientFixRankings(); // FrikBot
--------------------------------------


I'm confident that I edited correctly. Still won't compile.
I'm getting errors:

Couldn't open file frikbot\bot_qw.qc
Error in defs.qc on line 739

I have all .qc files and fteqcc.exe in the same folder with progs.src.

My progs.src looks like this:

./qwprogs.dat

defs.qc
frikbot/bot_qw.qc
frikbot/bot_way.qc
frikbot/bot_fight.qc
frikbot/bot_ai.qc
frikbot/bot_misc.qc
frikbot/bot_phys.qc
frikbot/bot_move.qc
subs.qc
combat.qc
items.qc
weapons.qc
world.qc
client.qc
spectate.qc
player.qc
doors.qc
buttons.qc
triggers.qc
plats.qc
misc.qc

server.qc


All of this is in my C:\Quakeworld\Frikbot folder.

subs.qc
combat.qc
items.qc
weapons.qc
world.qc
client.qc
spectate.qc
player.qc
doors.qc
buttons.qc
triggers.qc
plats.qc
misc.qc

These files are in my C:\Quakeworld\qw folder as well. (I copied them from here to the Frikbot folder, seemed like the compiler was looking for them)

Does anyone have the qwprogs.dat file thats created from this process? Can FrikaC help?

The bots are really good, I really want them on my server. :D

Thank you guys for all your help!
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

You keep mentioning you want frikbots on your server. I hope you're aware of that you don't need to mess with any code or compiling whatsoever if that's all you want to do. You just run the frikbot mod on your server. But if you still want to mess with compiling, here goes some info I think you've missed:

You sure you have the non-frikbot related files in a folder above the frikbot folder? As you can see, progs.src states that the frikbot related files are to be in a folder called "frikbot", and the rest are in the same folder the "frikbot" folder exists in. In other words, your files should look like this:

Code: Select all

#Quake/modfolder/qc/
                    defs.qc
                    client.qc
                    progs.src
                    blah...
                    /frikbot/
                             bot_qw.qc
                             bot_way.qc
                             bot_blah...
Modfolder can be replaced with whatever you like to call the mod, if that's "Frikbot" or whatever you wish.
As you should see, I called the source-code folder "qc", you could call it "src", or "source", or whatever tickles your fancy. There you have all the Quake related files (this includes progs.src). Then there's a subfolder called "frikbot", in there you have all the files which begin with "bot". The compiler is to reside in the "qc" folder, not the "frikbot" folder. That should cure your problems, if you've followed the rest of Frik's instructions correctly :)
I was once a Quake modder
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

Thanks, I think that should help. I had the compiler in the wrong folder! I'll give it a go when I get home from work.

The reason why I have to do this is b/c the progs.dat as is, does not allow the bots to transfer between maps. So i'm hoping by following those instructions that it will allow them to transfer. Also, the server crashes alot when I run the mod, so I hope it helps there too. Thanks :o :)
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 »

Make sure you're watching the output from the compiler, which tells you whether it actually compiled properly or not.
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.
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

ok, i'm running it under the dos prompt window now. Thanks.
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 »

redrum wrote:The reason why I have to do this is b/c the progs.dat as is, does not allow the bots to transfer between maps.
See Advanced Options under Playing here:

http://www.inside3d.com/frikbot/fbx/readme.html
redrum
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Post by redrum »

I tried that. It didn't work.
I put localinfo b_options 1 in my server.cfg file.
I then restarted the server, loaded a new map, and the bots still did not transfer.
Did I miss something?


I keep getting compiler errors in the file bot_qw.qc in line 945.
Which should be the last line of code. Here is the last lines of code in the file. Does anyone see an error?


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Bot Impulses. Allows the player to perform bot
related functions.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*/

void() BotImpulses =
{
local float f;
local string h;

if (self.impulse == 100)
{
h = infokey(world, "skill");
f = stof(h);
BotConnect(0, f);
}
else if (self.impulse == 102)
KickABot();
else
return;
self.impulse = 0;
};
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
Post Reply