.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   "LINK_ENTITY_TO_FUNC" Help (http://forums.bots-united.com/showthread.php?t=4271)

Mike 28-07-2005 19:49

"LINK_ENTITY_TO_FUNC" Help
 
Hey everyone,
Im working on basic bots for a hl1 mod, using botmans framework, I've got the LINK_ENTITY_TO_FUNC's (62 of them), but i cant find where im supposed to input them into the frame so i can get a working basic bot going, can someone help me with this?
Much appreciated,
- Mike.

Lazy 28-07-2005 19:55

Re: "LINK_ENTITY_TO_FUNC" Help
 
It's been a while, but if I remember correctly they go in linkfunc.cpp.

Mike 28-07-2005 20:10

Re: "LINK_ENTITY_TO_FUNC" Help
 
-_- I feel like a spastic, thanks alot lazy, but it feels as if somethings been left out, i dont have the source code, but i know i have to edit the new liblist to use the HP_BOT.dll, is there something('s) im missing out?

The Storm 28-07-2005 21:40

Re: "LINK_ENTITY_TO_FUNC" Help
 
After you are 100% sure that the linkfunc.cpp is updated correctly you must modify the h_export.cpp to make it to load the MOD .dll file that you want(this will make the bots to join in game but it will be very basic and if in this mod must be selected a team or class or both you must update the bot_start.cpp). After that to make HPB to fully support the MOD that you want you must modify a lot of things. Better read the botman readme text document that come with the HPB bot source.

Mike 28-07-2005 22:09

Re: "LINK_ENTITY_TO_FUNC" Help
 
I cant find what im supposed to edit in the h_export.cpp =/
But in the bot_start.cpp ive re-edited the following code, and its found 5 errors, it originally found 12 errors altohugh i found and fixed 7, but i cant find the remaining 5, if anyone can help heres the code:

" else if ((mod_id == FP_DLL)
{
// handle Final Power stuff here...

if (pBot->start_action == MSG_FP_TEAM_SELECT)
{
pBot->start_action = MSG_FP_IDLE; // switch back to idle

if ((pBot->bot_team != 1) && (pBot->bot_team != 2))
pBot->bot_team = -1;

if (pBot->bot_team == -1)
pBot->bot_team = RANDOM_LONG(1, 2);

// select the team the bot wishes to join...
if (pBot->bot_team == 1)
strcpy(c_team, "Z-Fighter");
else if (pBot->bot_team == 2)
strcpy(c_team, "Evil Guys");

FakeClientCommand(pEdict, "jointeam", c_team, NULL);

return;
}

if (pBot->start_action == MSG_FP_CLASS_SELECT)
{
pBot->start_action = MSG_FP_IDLE; // switch back to idle

if ((pBot->bot_class < 0) || (pBot->bot_class > 7))
pBot->bot_class = -1;

if (pBot->bot_class == -1)
pBot->bot_class = RANDOM_LONG(1, 7);

// select the class the bot wishes to use...
if (pBot->bot_class == 1)
strcpy(c_class, "Goku");
else if (pBot->bot_class == 2)
strcpy(c_class, "Gohan");
else if (pBot->bot_class == 3)
strcpy(c_class, "Goten");
else if (pBot->bot_class == 4)
strcpy(c_class, "Vegeta");
else if (pBot->bot_class == 5)
strcpy(c_class, "Brolly");
else if (pBot->bot_class == 6)
strcpy(c_class, "Buu");

FakeClientCommand(pEdict, "selectchar", c_class, NULL);

// bot has now joined the game (doesn't need to be started)
pBot->not_started = 0;

return;
}"

The Storm 28-07-2005 23:38

Re: "LINK_ENTITY_TO_FUNC" Help
 
In bot.cpp find this code lines :
Code:

          if (mod_id == TFC_DLL)
                pBot->start_action = MSG_TFC_IDLE;
          else if (mod_id == CSTRIKE_DLL)
                pBot->start_action = MSG_SOW_IDLE;
          else if ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect != NULL))
                pBot->start_action = MSG_OPFOR_IDLE;
          else if (mod_id == FRONTLINE_DLL)
                pBot->start_action = MSG_FLF_IDLE;
          else
                pBot->start_action = 0;  // not needed for non-team MODs

and add this
Code:

else if (mod_id == FP_DLL)
                  pBot->start_action = MSG_FP_IDLE;

And after that the code must be like this if you are defined FP_DLL
Code:

if (mod_id == TFC_DLL)
                pBot->start_action = MSG_TFC_IDLE;
          else if (mod_id == FP_DLL)
                pBot->start_action = MSG_FP_IDLE;
          else if (mod_id == CSTRIKE_DLL)
                  pBot->start_action = MSG_CS_IDLE;
          else if ((mod_id == GEARBOX_DLL) && (pent_info_ctfdetect != NULL))
                pBot->start_action = MSG_OPFOR_IDLE;
          else if (mod_id == FRONTLINE_DLL)
                pBot->start_action = MSG_FLF_IDLE;
          else
                pBot->start_action = 0;  // not needed for non-team MODs

After that the code for team and class select must be like this :
Code:

else if (mod_id == FP_DLL)
  {
        if ((pBot->start_action == MSG_FP_IDLE) &&
                (pBot->create_time + 3.0 <= gpGlobals->time)) //Give some time between every bot(maybe to avoid crashes?)
          {
                pBot->start_action = MSG_FP_TEAM_SELECT;  // force team selection
          }

          if (pBot->start_action == MSG_FP_TEAM_SELECT)
          {
                pBot->create_time = gpGlobals->time;  // reset

                if ((pBot->bot_team != 1) && (pBot->bot_team != 2))
                        pBot->bot_team = -1;

                if (pBot->bot_team == -1)
                        pBot->bot_team = RANDOM_LONG(1, 2);

                // select the team the bot wishes to join...
                if (pBot->bot_team == 1)
                        strcpy(c_team, "Z-Fighter");
                else if (pBot->bot_team == 2)
                        strcpy(c_team, "Evil Guys");

                FakeClientCommand(pEdict, "jointeam", c_team, NULL);
                pBot->start_action = MSG_FP_CLASS_SELECT;

                return;
          }
          if (pBot->start_action == MSG_FP_CLASS_SELECT)  // counter terrorist
          {
                  pBot->start_action = MSG_FP_IDLE;  // switch back to idle
                  pBot->create_time = gpGlobals->time;  // reset

                  if ((pBot->bot_class < 1) || (pBot->bot_class > 7))
                        pBot->bot_class = -1;  // use random if invalid

                  if (pBot->bot_class == -1)
                        pBot->bot_class = RANDOM_LONG(1, 7);

                            // select the class the bot wishes to use...
                  if (pBot->bot_class == 1)
                        strcpy(c_class, "Goku");
                  else if (pBot->bot_class == 2)
                        strcpy(c_class, "Gohan");
                  else if (pBot->bot_class == 3)
                        strcpy(c_class, "Goten");
                  else if (pBot->bot_class == 4)
                        strcpy(c_class, "Vegeta");
                  else if (pBot->bot_class == 5)
                        strcpy(c_class, "Brolly");
                  else if (pBot->bot_class == 6)
                        strcpy(c_class, "Buu");

                  FakeClientCommand(pEdict, "selectchar", c_class, NULL);

                  // bot has now joined the game (doesn't need to be started)
                  pBot->not_started = 0;

                  return;
          }
  }

And please next time put you code in code tags. And maybe post you h_export.cpp here.

Mike 28-07-2005 23:48

Re: "LINK_ENTITY_TO_FUNC" Help
 
Wow thats got rid of the errors and it builds fine now thanks, i just have to try it and see if it works ingame, thanks alot for your help =)

The Storm 29-07-2005 00:48

Re: "LINK_ENTITY_TO_FUNC" Help
 
Np man. ;) Post here the result. :) It will be good if you tell me whatt is the mod that you try to add a bot support?

Mike 30-07-2005 12:58

Re: "LINK_ENTITY_TO_FUNC" Help
 
Hmmm, it gives some error with fopen.c and the bots dont spawn =/
The mod is for FinalPower, its not released public yet, but thats whats being added for, how can the fopen.c be fixed?

The Storm 30-07-2005 17:07

Re: "LINK_ENTITY_TO_FUNC" Help
 
What is this fopen.c ? When the mod is released I will add a basic bot support for it if you want?


All times are GMT +2. The time now is 19:20.

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