.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
"LINK_ENTITY_TO_FUNC" Help
Old
  (#1)
Mike
Member
 
Status: Offline
Posts: 6
Join Date: Jul 2005
Default "LINK_ENTITY_TO_FUNC" Help - 28-07-2005

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.
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#2)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: "LINK_ENTITY_TO_FUNC" Help - 28-07-2005

It's been a while, but if I remember correctly they go in linkfunc.cpp.
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#3)
Mike
Member
 
Status: Offline
Posts: 6
Join Date: Jul 2005
Default Re: "LINK_ENTITY_TO_FUNC" Help - 28-07-2005

-_- 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?
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#4)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: "LINK_ENTITY_TO_FUNC" Help - 28-07-2005

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.
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#5)
Mike
Member
 
Status: Offline
Posts: 6
Join Date: Jul 2005
Default Re: "LINK_ENTITY_TO_FUNC" Help - 28-07-2005

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;
}"
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: "LINK_ENTITY_TO_FUNC" Help - 28-07-2005

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.

Last edited by The Storm; 28-07-2005 at 23:40..
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#7)
Mike
Member
 
Status: Offline
Posts: 6
Join Date: Jul 2005
Default Re: "LINK_ENTITY_TO_FUNC" Help - 28-07-2005

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
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#8)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: "LINK_ENTITY_TO_FUNC" Help - 29-07-2005

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?

Last edited by The Storm; 29-07-2005 at 00:49..
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#9)
Mike
Member
 
Status: Offline
Posts: 6
Join Date: Jul 2005
Default Re: "LINK_ENTITY_TO_FUNC" Help - 30-07-2005

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?
  
Reply With Quote
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#10)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: "LINK_ENTITY_TO_FUNC" Help - 30-07-2005

What is this fopen.c ? When the mod is released I will add a basic bot support for it if you want?
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com