Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » AI Helpers
Re: AI Helpers [message #257876 is a reply to message #257529] Tue, 08 May 2007 17:41 Go to previous messageGo to previous message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma:
General (2 Stars)

void z_FollowPoker::Created(GameObject *obj)
{
	AllowPoke = true;
	FollowID = 0;
	Following = false;
	Commands->Enable_HUD_Pokable_Indicator(obj,true);
}

void z_FollowPoker::Poked(GameObject *obj, GameObject *poker)
{
	if (AllowPoke)
	{
		Commands->Enable_HUD_Pokable_Indicator(obj,false);
		FollowID = Commands->Get_ID(poker);
		Commands->Start_Timer(obj,this,0.5,789);
	}
}
void z_FollowPoker::Custom(GameObject *obj,int message,int param,GameObject *sender)
{
	if (message == Get_Int_Parameter("Stop_Following_Msg"))
	{
		Commands->Enable_HUD_Pokable_Indicator(obj,true);
		AllowPoke = true;
		Following = false;
		FollowID = 0;
	}
}
void z_FollowPoker::Timer_Expired(GameObject *obj,int number)
{
	if (number == 789)
	{
		Commands->Innate_Disable(obj);
		GameObject *GotoObject = Commands->Find_Object(FollowID);
		if (GotoObject)
		{
			ActionParamsStruct params;
			params.Set_Basic(this,100,100,-1);
			params.Set_Goto_Following(GotoObject,5.0f,1.0f,true);
			Commands->Action_Goto(obj,params);
			Commands->Start_Timer(obj,this,0.5,789);
		}
	}
}
void z_FollowPoker::Register_Auto_Save_Variables()
{
	Auto_Save_Variable(1,4,&FollowID);
}

Note sure what the bot will do if it encounters enemies, wether
it will continue to follow the player once that enemy is killed for example..
You can send a custom to the bot if you want it to stop following
the player, or attach another script to the player that will send
a custom to the bot when that player dies so it stops following
until someone else pokes him again.
May have to modify it a bit to enable/disable innate where needed..

ie: when destination reached, following=false, followid=0, and enable innate again etc.. that may work


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png

[Updated on: Tue, 08 May 2007 17:52]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Requesting Map Maker
Next Topic: Teleport Failure
Goto Forum:
  


Current Time: Sat Feb 22 19:12:20 MST 2025

Total time taken to generate the page: 0.01412 seconds