[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Bots stuck in floor

Bots stuck in floor

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Bots stuck in floor

Postby Cobalt » Wed Jun 10, 2009 3:11 am

HI Everyone. Have not messed with Quake C since 2002! Glad to see this site is still here for support. I am back working on my CTFBOT+ mod, and cant seem to stop the bots from getting stuck in the floor with my new mod for copytobodyque(). I have the body images sometimes becoming solids that takedamage, and I decided one day to make the bots attack them if touched, because they would block them. They do attack the corpses, but alot of times it seems they loose their self.origin or something and they get stuck in the floor where the corpse use to be. Here is the touch finction for the ccorpses / images. Any sugguestions appreciated !


void () image_touch =
{
local float old_solid;
old_solid = self.solid;

if (pointcontents (self.origin + '0 0 -22') == CONTENT_LAVA)
self.solid = SOLID_BBOX;
makevectors (self.angles);

if ((self.classname == "image2"))
{
self.velocity_z = 10;
}

if (other.classname == "bot")
{
self.solid = SOLID_TRIGGER;
self.velocity_z = self.velocity_z + 1;
self.solid = old_solid;
}

if ((self.watertype != CONTENT_WATER))
{
self.flags = (self.flags + FL_ONGROUND);
if ((self.velocity != VEC_ORIGIN))
{
self.movetype = MOVETYPE_BOUNCE;
}
else
{
self.movetype = MOVETYPE_STEP;
}
self.think = image_remove;
self.nextthink = ((time + (random () * 45)) + (random () * 30));
return;
}
if (other)
{
makevectors (other.angles);
if ((other.takedamage && (random () < 0.2)))
{
self.velocity = (other.velocity * 0.45);
self.avelocity = (other.velocity * 0.2);
sound (self, CHAN_ITEM, "demon/dland2.wav", 1, ATTN_IDLE);
return;
}
else
{
ambientsound (self.origin, "ambience/water1.wav", 0.5, ATTN_IDLE);
}


if ((pointcontents (self.origin) == CONTENT_SOLID))
{
self.velocity = (self.origin + other.origin);
self.avelocity = (self.avelocity * 0.55);
self.flags = (self.flags | FL_ONGROUND);
sound (self, CHAN_ITEM, "wizard/hit.wav", 1, ATTN_STATIC);
return;
}
return;
}
};
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Postby Cobalt » Wed Jun 10, 2009 6:50 pm

Im also thinking, could the setsize for the dead body be the problem? The initial setsize command is:

setsize (ent, '-16 -16 0', '0 0 0');


which I think is stock from the original code. This command always confused me. Theres more code in the bodyque code I added that may be changing it to :

setsize (image, '-16 -16 -24', '16 3 -0.5');
image.flags = 0;

I dont remember how I came up with this value. Would I need to ftos the vector value to do a dprint of the size of a body image ? Would I be looking at self.size specific?
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Postby MauveBib » Wed Jun 10, 2009 9:47 pm

in q1bsp the only hull sized recognised for colisions against the world are point, player and shambler sized. It seems you're accidentally setting the player hull to something smaller than player sized which is being rounded down to point sized.
Apathy Now!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby Cobalt » Wed Jun 10, 2009 11:37 pm

User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest