Force enter vehicle on first 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
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Force enter vehicle on first spawn

Post by bobfinkl »

Hello there Gametoast, it's been a long time since I have asked a question here, but as I cannot move along after spending hours working on this myself without any help I am once again forced to ask a question.

I have been trying to force your character into a vehicle on the first spawn and keep you in that vehicle (really it is just turret which will be animated) until I want it to let you leave. I know this is possible as it happened in Mav's 3rd Rebel Ops mission, I have my script so far here:
Hidden/Spoiler:
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
EnterVehicle(character, "uta_fly_ride_gunship")
objectives_timer = CreateTimer("objectives_timer")
SetTimerValue(objectives_timer, 2)
StartTimer(objectives_timer)
begin_objectives = OnTimerElapse(
function(timer)
StartObjectives ()
ScriptCB_EnableCommandPostVO(0)
end,
objectives_timer
)
end
end
)

Objective1 = ObjectiveGoto:New{TeamATT = ATT, -- objective made
text = "level.hoth.c.2", popupText = "level.hoth.c.pop.2", -- show objective on screen
regionName = "cp1_capture", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective1.OnStart = function(self)
ATT_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
ATT_obj1_aigoal2 = AddAIGoal(ATT, "Defend", 200, "objective")
MapAddEntityMarker("goto", "hud_objective_icon", 3.0, 1, "YELLOW", true) -- AI objective
Objective1.OnComplete = function(self)
ATT_ReinforcementCount = GetReinforcementCount(ATT)
SetReinforcementCount(ATT, ATT_ReinforcementCount + 1)
end
end
Currently You aren't even forced into the vehicle after you spawn, it is just there and you can walk up and enter it and complete the only objective I have set so far and win, but you aren't forced in when you spawn.

Thanks in advance.
Post Reply