How to make units follow ME
Posted: Thu Sep 02, 2010 10:25 pm
What do I need to do to make units AI follow me? I'm doing an RC style map and... you get the picture. I don't want to Commandos going around and doing what they want.
Code: Select all
AddAIGoal( team, "Follow", weight, gameObjectPtr);
genaral_mitch wrote:Code: Select all
AddAIGoal( team, "Follow", weight, gameObjectPtr);
I'm quite sure skelltor noticed that before posting. I'm not sure exactly what you'd put into the field, but you define who they follow in the last field, gameObjectPtr. As i said, I'm not sure whether you just type in the units name, or if its a bit more complicated then that....sim-al2 wrote:genaral_mitch wrote:Code: Select all
AddAIGoal( team, "Follow", weight, gameObjectPtr);
lucasfart wrote:I'm quite sure skelltor noticed that before posting. I'm not sure exactly what you'd put into the field, but you define who they follow in the last field, gameObjectPtr. As i said, I'm not sure whether you just type in the units name, or if its a bit more complicated then that....
Psych0fred's AINotes wrote:Destroy and Defend can specify GameObjects or Character indices:
ClearAIGoals( 1 )
AddAIGoal( 1, "Defend", 100, 0 )
ClearAIGoals( 2 )
AddAIGoal( 2, "Destroy", 50, 0 )
AddAIGoal( 2, "Destroy", 50, atatPtr )
This sets up all of team 1 to defend Character(0), which is the player. Here you could also
put the index of a special character (ie Leia or anyone) you spawn in somewhere. Team 2 is
set to kill Character(0) (the player again) and also destroy the ATAT specified by atatPtr.