Force AI vehicle spawn

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
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Force AI vehicle spawn

Post by Commander_Fett »

I'm working on a campaign map, and for one of the objectives, I want the player to destroy a vheicle. the vehicle doesn't spawn until after the player completes objective1, however (capturing command post rep2) and I'vebeen having trouble with forcing ai into the vehicle (otherwise you can blow it up before anybody gets in). Bobfinkl gave me this code, but he's not sure what goes at the beggining.Something about it seems off, too, though I'm not so great at this, so I could be wrong.( the team the command post for the vehice is team 5, command post is cis_inv1) I fyou need any more info, please ask

Code: Select all

		 something(
function(player)
if GetCharacterTeam(player) == 1 and GetCharacterClass(player) == "cis_inf_marine" then
EnterVehicle(player, "hag_spawn")
end
end
)
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Force AI vehicle spawn

Post by Maveritchell »

Just make it an autopiloted vehicle.
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: Force AI vehicle spawn

Post by Commander_Fett »

How would I do that?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Force AI vehicle spawn

Post by DarthD.U.C.K. »

you can use these lines:

Code: Select all

PilotType               = "self"
Controllable 			= "0"
AutoFire 				= "1"
autofire is probably obsolete though
Post Reply