.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   bot donīt spawn (http://forums.bots-united.com/showthread.php?t=542)

cctnt 27-01-2004 21:34

bot donīt spawn
 
hi
iīm pretty new to botcoding
iīve an annoying bug

when i type addbot in the console
only the weapons of the bot spawn but not the bot itself
i edited the bot_start.cpp that he uses the class system of the mod.

can anyone help me?

-=RAV=-AdrianShephard 28-01-2004 00:35

Re: bot donīt spawn
 
i think this is in the wrong section

Pierre-Marie Baty 28-01-2004 07:00

Re: bot donīt spawn
 
yes... I'm moving this to the bot coding discussions forum.

Are you sure you updated the linkfunc.cpp file of the HPB_bot with the entities of your mod ?

cctnt 28-01-2004 09:54

Re: bot donīt spawn
 
yep i did

could the cause be that iīm using a map with the old fgd of my mod?
i mean with other start points than yet

and why wrong section??
iīm using hpb-bot

Pierre-Marie Baty 28-01-2004 10:53

Re: bot donīt spawn
 
you're using the HPB_bot SOURCE CODE to make your own bot, not the official HPB_bot release... so this is a coding question :)

Actually all the HL bots out here are more or less based on the HPB_bot, you know :)

Anyway... is there a menu selection in your mod ? (to join a class, to choose a skin, whatever)
Maybe the bots are stuck in this menu that's why they don't appear...

Check if their entity has the EF_NODRAW flag set.

cctnt 28-01-2004 11:13

Re: bot donīt spawn
 
ah ok
yeah i have a vgui menu
but ingame they arenīt showed as spectators
where should i look for EF_NODRAW
in my spawn function for the bot?
there isnīt one

Pierre-Marie Baty 28-01-2004 12:55

Re: bot donīt spawn
 
check if (pBot->pEdict->v.effects & EF_NODRAW) is TRUE... that would mean that the bot is spawned, but its model is not rendered by the engine.

Else are you 100% sure you fill the infobuffer correctly in BotCreate() ? Some mods like Counter-Strike need to have a lot more stuff in it than others like HL.

cctnt 28-01-2004 14:13

Re: bot donīt spawn
 
works now
thx to u pierre

edit
it only works in free fight
how can i force the bot to leave spectator in team mode?

bluesy 03-02-2004 22:42

Re: bot donīt spawn
 
Hi!

Maybe there`s an extra menu for team mode? try forcing the bots to fire (in_attack) and see if it works...

@$3.1415rin 03-02-2004 22:46

Re: bot donīt spawn
 
welcome bluesy :)

cctnt 26-04-2004 21:02

Re: bot donīt spawn
 
sry for bringing this old topic up again but i canīt get a rid of this bug

it now spawns in free fight but it doesnīt in team mod
maybe i when i post my botstart for my dll someone could help me

Code:

if (mod_id == NWN_DLL)
{
        if ((pBot->start_action == MSG_TFC_IDLE) &&
                (pBot->create_time + 3.0 <= gpGlobals->time))
        {
                pBot->start_action = MSG_TFC_TEAM_SELECT; // force team selection
        }
        // handle Team Fortress Classic stuff here...
        if (pBot->start_action == MSG_TFC_TEAM_SELECT)
        {
                pBot->start_action = MSG_TFC_IDLE; // switch back to idle
                pBot->create_time = gpGlobals->time; // reset
                if ((pBot->bot_team != 1) && (pBot->bot_team != 2))
                        pBot->bot_team = -1;
                if (pBot->bot_team == -1)
 
for(index=1;index<=gpGlobals->maxClients;index++)
{
        pPlayer = INDEXENT(index);
}
 
                retry_count = 0;
 
                // select the team the bot wishes to join...
                if (pBot->bot_team == 1)
                        strcpy(c_team, "1");
                else if (pBot->bot_team == 2)
                        strcpy(c_team, "2");
                else
                        strcpy(c_team, "5");
                FakeClientCommand(pEdict, "jointeam", c_team, NULL);
                pBot->start_action = MSG_TFC_CLASS_SELECT;
                return;
        }
        if (pBot->start_action == MSG_TFC_CLASS_SELECT)
        { char *cvar_gamemode = (char *)CVAR_GET_STRING("mp_gamemode");
                pBot->start_action = MSG_TFC_IDLE; // switch back to idle
                pBot->create_time = gpGlobals->time; // reset
                if ((pBot->bot_class < 0) || (pBot->bot_class > 8))
                        pBot->bot_class = -1;
                if (pBot->bot_class == -1)
                        pBot->bot_class = RANDOM_LONG(0, 7);
                team = UTIL_GetTeam(pEdict);
if ((cvar_gamemode && cvar_gamemode[0]) && (strncmp(cvar_gamemode, "1", 1) == 0))
                {
if (pBot->bot_team == 1)
        {
        if ((pBot->bot_class != 0)&&(pBot->bot_class != 1) && (pBot->bot_class != 2) && (pBot->bot_class != 3) )
        {
        if (RANDOM_LONG(1, 2) < 2)
        pBot->bot_class = RANDOM_LONG(0, 3);
        else
        pBot->bot_class = RANDOM_LONG(4, 7);
        }
        }
        else
        {
        if ((pBot->bot_class != 4) && (pBot->bot_class != 5) && (pBot->bot_class != 6) && (pBot->bot_class != 7) )       
        {
        int i = RANDOM_LONG(1, 3);
                                        switch (i)
        {
        case 1:
                pBot->bot_class = 0;
        break;
        case 2:
        pBot->bot_class = 3;
        break;
        case 3:
        pBot->bot_class = RANDOM_LONG(4, 7);
        break;
        default:
        break;
        }
        }
        }
}
// select the class the bot wishes to use...
                if (pBot->bot_class == 0)
                        strcpy(c_class, "naruto");
                else if (pBot->bot_class == 1)
                        strcpy(c_class, "sasuke");
                else if (pBot->bot_class == 2)
                        strcpy(c_class, "kakashi");
                else if (pBot->bot_class == 3)
                        strcpy(c_class, "sakura");
                else if (pBot->bot_class == 4)
                        strcpy(c_class, "garaa");
                else if (pBot->bot_class == 5)
                        strcpy(c_class, "orichimaru");
                else if (pBot->bot_class == 6)
                        strcpy(c_class, "kankaru");
                else if (pBot->bot_class == 7)
                        strcpy(c_class, "temari");
else
        strcpy(c_class, "randompc");
                FakeClientCommand(pEdict, c_class, NULL, NULL);
                // bot has now joined the game (doesn't need to be started)
                pBot->not_started = 0;
                return;
        }
}
else
{
        // otherwise, don't need to do anything to start game...
        pBot->not_started = 0;
}

someone that may help me?


All times are GMT +2. The time now is 05:41.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.