True client bots?
True client bots?
Is there a way to implement bot functions (AI, waypointing, ...) on a true client?
Let's say I'm playing QW DM and I want to get a beer?
Can I switch to auto-pilot until I get back?
Let's say I'm playing QW DM and I want to get a beer?
Can I switch to auto-pilot until I get back?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
shockbot has this option already
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/
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/
nope, i'm currently without internet at home (i check this occassionally at work)
Redoing a heap of the core navigation stuff in shockbot at the moment. There's a bunch of things I want to make nicer, and how I was doing things was really limiting (pick a goal, then route to a goal).
Whereas with the new system, i should hopefully be able to get it working where it can know how to get to everything, then decide which one it wants to go for. The difference being that real travel distances can be taken into account rather than just a straight distance check to items. Also this will allow for a better way to do item respawn prediction.
Redoing a heap of the core navigation stuff in shockbot at the moment. There's a bunch of things I want to make nicer, and how I was doing things was really limiting (pick a goal, then route to a goal).
Whereas with the new system, i should hopefully be able to get it working where it can know how to get to everything, then decide which one it wants to go for. The difference being that real travel distances can be taken into account rather than just a straight distance check to items. Also this will allow for a better way to do item respawn prediction.
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/
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, I just made a human bot.
BUT, it's not smart as a player, and it has perfect aim with instant weapons, so the shotguns and sniper rifle are undodgeable.
Impulse 150 will toggle between on and off.
It will respawn automatically when dead and will shoot the enemies.
Another thing is that he won't choose a weapon too, he'll fire with the current weapon until the ammo depletes.
I made it to be simple.
So let's do it.
Open world.qc and add this before StartFrame():
Ok, now add this at the very bottom of StartFrame(), before framecount line:
Now go to the very top of world.qc, and add these 2 lines:
Now save and close the file. Open defs.qc and add this to the very bottom:
Save and close.
Now open client.qc, scroll down to PlayerPreThink() and find:
Replace the whole statement with this:
Now scroll up to PutClientInServer(), and add this before DecodeLevelParms():
Save and close client.qc and open player.qc, scroll down to player_nail1().
Replace these 4 functions with these:
Lastly, save and close player.qc and open weapons.qc, add this to ImpulseCommands():
There you go!
BUT, it's not smart as a player, and it has perfect aim with instant weapons, so the shotguns and sniper rifle are undodgeable.
Impulse 150 will toggle between on and off.
It will respawn automatically when dead and will shoot the enemies.
Another thing is that he won't choose a weapon too, he'll fire with the current weapon until the ammo depletes.
I made it to be simple.
So let's do it.
Open world.qc and add this before StartFrame():
Code: Select all
float() FindEnemy =
{
local entity head;
head = findradius(self.origin, 2000);
while (head)
{
if (head != self)
if (!(head.flags & FL_ITEM))
if (head.health > 0)
if (head.takedamage == DAMAGE_AIM)
if (visible(head))
self.enemy = head;
head = head.chain;
}
if (self.enemy != world)
return TRUE;
return FALSE;
};
.float goleft, goright;
void() Autopilot =
{
if (self.health <= 0)
{
stuffcmd (self, "-forward\n");
stuffcmd (self, "-moveleft\n");
stuffcmd (self, "-moveright\n");
return;
}
self.fixangle = TRUE;
if (self.enemy == world)
{
if (FindEnemy())
return;
self.angles_x = 0;
stuffcmd (self, "+forward\n");
stuffcmd (self, "-moveleft\n");
stuffcmd (self, "-moveright\n");
if (random() < 0.02)
{
if (self.turndir == 45)
self.turndir = -45;
else
self.turndir = 45;
}
traceline (self.origin, self.origin + v_forward*320, TRUE, self);
if (trace_fraction < 0.2)
self.angles_y = self.angles_y - self.turndir;
}
if (self.enemy != world)
{
if (self.enemy.health <= 0 || !visible(self.enemy))
{
self.enemy = world;
return;
}
stuffcmd (self, "-forward\n");
traceline (self.origin, self.origin + v_right*320, TRUE, self);
if (trace_fraction < 0.2)
{
self.goleft = TRUE;
self.goright = FALSE;
}
traceline (self.origin, self.origin - v_right*320, TRUE, self);
if (trace_fraction < 0.2)
{
self.goleft = FALSE;
self.goright = TRUE;
}
self.angles = vectoangles(self.enemy.origin - self.origin);
self.angles_x = self.angles_x * -1;
if (self.goleft)
{
stuffcmd (self, "+moveleft\n");
stuffcmd (self, "-moveright\n");
}
if (self.goright)
{
stuffcmd (self, "-moveleft\n");
stuffcmd (self, "+moveright\n");
}
if (infront(self.enemy) && self.attack_finished < time)
W_Attack ();
}
};
Code: Select all
local entity plr, oself;
plr = find(world, classname, "player");
while (plr != world)
{
if (plr.autopilot)
{
oself = self;
self = plr;
Autopilot ();
self = oself;
}
plr = find(plr, classname, "player");
}
Code: Select all
float(entity targ) visible;
float(entity targ) infront;
Now save and close the file. Open defs.qc and add this to the very bottom:
Code: Select all
.float autopilot, turndir;
Now open client.qc, scroll down to PlayerPreThink() and find:
Code: Select all
if (self.deadflag >= DEAD_DEAD)
{
PlayerDeathThink ();
return;
}
Code: Select all
if (self.deadflag >= DEAD_DEAD)
{
if (self.autopilot)
{
respawn();
return;
}
PlayerDeathThink ();
return;
}
Code: Select all
self.enemy = world;
self.turndir = 45;
Replace these 4 functions with these:
Code: Select all
void() player_nail1 =[$nailatt1, player_nail2 ]
{
muzzleflash();
if (self.autopilot)
{
if (self.enemy == world || intermission_running || self.impulse || self.ammo_nails < 1)
{player_run ();return;}
}
else
{
if (!self.button0 || intermission_running || self.impulse || self.ammo_nails < 1)
{player_run ();return;}
}
self.weaponframe = self.weaponframe + 1;
if (self.weaponframe == 9)
self.weaponframe = 1;
SuperDamageSound();
W_FireSpikes (4);
self.attack_finished = time + .2;
self.fired_nails = self.fired_nails + 1;
};
void() player_nail2 =[$nailatt2, player_nail1 ]
{
muzzleflash();
if (self.autopilot)
{
if (self.enemy == world || intermission_running || self.impulse || self.ammo_nails < 1)
{player_run ();return;}
}
else
{
if (!self.button0 || intermission_running || self.impulse || self.ammo_nails < 1)
{player_run ();return;}
}
self.weaponframe = self.weaponframe + 1;
if (self.weaponframe == 9)
self.weaponframe = 1;
SuperDamageSound();
W_FireSpikes (-4);
self.attack_finished = time + .2;
self.fired_nails = self.fired_nails + 1;
};
//============================================================================
void() player_light1 =[$light1, player_light2 ]
{
muzzleflash();
if (self.autopilot)
{
if (self.enemy == world || intermission_running || self.impulse || self.ammo_cells < 1)
{player_run ();return;}
}
else
{
if (!self.button0 || intermission_running || self.impulse || self.ammo_cells < 1)
{player_run ();return;}
}
self.weaponframe = self.weaponframe + 1;
if (self.weaponframe == 5)
self.weaponframe = 1;
SuperDamageSound();
W_FireLightning();
self.attack_finished = time + 0.2;
};
void() player_light2 =[$light2, player_light1 ]
{
muzzleflash();
if (self.autopilot)
{
if (self.enemy == world || intermission_running || self.impulse || self.ammo_cells < 1)
{player_run ();return;}
}
else
{
if (!self.button0 || intermission_running || self.impulse || self.ammo_cells < 1)
{player_run ();return;}
}
self.weaponframe = self.weaponframe + 1;
if (self.weaponframe == 5)
self.weaponframe = 1;
SuperDamageSound();
W_FireLightning();
self.attack_finished = time + 0.2;
};
Code: Select all
if (self.impulse == 150)
{
if (!self.autopilot)
{
self.autopilot = 1;
sprint (self, PRINT_HIGH, "Autopilot engaged.\n");
}
else
{
self.autopilot = 0;
sprint (self, PRINT_HIGH, "Autopilot disengaged.\n");
stuffcmd (self, "-forward\n");
stuffcmd (self, "-moveleft\n");
stuffcmd (self, "-moveright\n");
}
}
There you go!
Means that the crc inside the progs.dat was not recognised for that platform. You get this error if you run an nq mod in a qw server.redrum wrote:SV_Error: You must have the progs.dat from QuakeWorld installed
The message should actually read 'qwprogs.dat'... The engine uses qwprogs.dat first if it can, and progs.dat after. But that's just a naming convention.
If it worked before, then you've probably wrongly modified defs.qc and added/removed/changed something before end_sys_fields. Restore the top two sections of that file to the previous version.