Orion

Joined: 12 Jan 2007 Posts: 414 Location: Brazil
|
Posted: Mon May 21, 2007 6:21 pm Post subject: Bot bug on dedicated server |
|
|
Hi.
With my new version of OrionBots, I've implemented auto bot connecting using scratch1 cvar to work on dedicated servers. I've created a dedicated server here, set scratch1 to 4 and 4 bots have spawned. When I connect to the server, if I play for a while, a fake player model with my frame spawns at my origin and I get stuck, even if it is removed. The bots are not client entities, but when they connect, they spawn a .decoy that is a client entity, the decoy updates position and frame at StartFrame(), because the bots are invisible entities, and .think for unconnected client entities is never called, that's why I've created a .decoy for each bot... I've figured out a bug that I've fixed at botInvalidClientNo(), that when I connect to a dedicated server with the bots, I spawn as a bot, the bots loses all his AI, I get his name and colors, and I can control it. But the stucking but is still there...
I've tried to tweak the bodyques, .decoys, but nothing fixed the problem!
When a bot dies or gibs, his decoy is copied at the bodyque, not the bot himself, because he is invisible.
ThrowHead() was changed to set the decoy's model to a head, if the entity is not a human.
But if I connect to my dedicated server before the bots, nothing mentioned above happens and I play normally.
Here's some decoy code:
Decoy spawn function (create_bot/start_bot at bot.qc)
Code: |
entcnt = clientno + 1;
newent = world;
while (entcnt > 0)
{
newent = nextent(newent);
entcnt = entcnt - 1;
}
newent.owner = bot;
bot.decoy = newent;
newent.classname = "decoy";
|
Decoy updating code (StartFrame at world.qc)
Code: |
e = find(world, classname, "decoy");
while (e)
{
e.colormap = e.owner.colormap;
e.skin = e.owner.skin;
e.frame = e.owner.frame;
e.angles = e.owner.angles;
setorigin (e, e.owner.origin);
e = find(e, classname, "decoy");
}
|
Have something wrong?
Thanks! _________________ There's no signature here. Stop looking for one. |
|