View Single Post
Re: "LINK_ENTITY_TO_FUNC" Help
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
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