Unit "Battallions"

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Blade
Captain
Captain
Posts: 496
Joined: Fri Apr 04, 2008 11:02 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Unit "Battallions"

Post by Blade »

I'm kinda thinking about making a more "Tactical" type map, and I'm wondering something.
I know there are ways to make units follow you during battle, but I've never found these methods to be very useful in the heat of battle. Is there any way to make it so that a certain group of units follows you, but not necessarily right on your tale... just sort of a common connection, but they stick around you instead of simply charging into battle? If there is, could someone tell me how it would be done? I'd kinda like to make something like a Shuttle crash, and you being the only survivors, or something like that :mrgreen:

Thanks
-Blade
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Unit "Battallions"

Post by Maveritchell »

You can script AI to sort've do that, but it's never going to be much more than what you see when you administer the AI command. To do it you'd set AI behavior to "follow" or "defend" and set your unit as the target. It would look something like this (this may or may not be entirely correct, I haven't tested it.):

Code: Select all

unitgroup = OnCharacterSpawn(
	function(player)
		if IsCharacterHuman(player) then
			ClearAIGoals(1)
			AddAIGoal(1, "follow", GetCharacterUnit(player))
		end
	end
)
Post Reply