How to make units follow ME
Moderator: Moderators
-
genaral_mitch
- Jedi

- Posts: 1056
- Joined: Fri Aug 14, 2009 12:32 am
How to make units follow ME
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.
- sim-al2
- 2nd Lieutenant

- Posts: 412
- Joined: Mon Jul 06, 2009 10:26 pm
- Projects :: Mapping on occasion
- Location: In the cockpit of some vehicle...
-
genaral_mitch
- Jedi

- Posts: 1056
- Joined: Fri Aug 14, 2009 12:32 am
Re: How to make units follow ME
Where in my lua does this line go?
Code: Select all
AddAIGoal( team, "Follow", weight, gameObjectPtr);
- sim-al2
- 2nd Lieutenant

- Posts: 412
- Joined: Mon Jul 06, 2009 10:26 pm
- Projects :: Mapping on occasion
- Location: In the cockpit of some vehicle...
Re: How to make units follow ME
It's either:
OR
I seem to have set it up in two different places
but I guess try both. I set up a death match goal for my local team because an acklay keep trying to capture cps.
Hidden/Spoiler:
Hidden/Spoiler:
- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: How to make units follow ME
You should have a look in some of the stock lua's, but i think it goes in scriptpostload.
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: How to make units follow ME
is there a way to make them just follow one unit type like a new commander unit?
- sim-al2
- 2nd Lieutenant

- Posts: 412
- Joined: Mon Jul 06, 2009 10:26 pm
- Projects :: Mapping on occasion
- Location: In the cockpit of some vehicle...
Re: How to make units follow ME
genaral_mitch wrote:Code: Select all
AddAIGoal( team, "Follow", weight, gameObjectPtr);
- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: How to make units follow ME
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);
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: How to make units follow ME
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.
- skelltor
- Sith

- Posts: 1431
- Joined: Fri Dec 11, 2009 6:24 pm
- Projects :: BFSM
- xbox live or psn: skelltor95
- Location: minisnowta
- Contact:
Re: How to make units follow ME
ahh ok thx (sorry if that might have been some form of thread highjacking)
by index does he just mean the units name or is there some index code that i have never sean before?
by index does he just mean the units name or is there some index code that i have never sean before?
