Page 1 of 1

Forcing characters in and out of vehicles [Solved]

Posted: Fri Oct 16, 2009 6:16 pm
by elfie
Hey guys,

I got quite a mess of trying to put together a code for forcing characters in and out of vehicles (ai and humans to be specific) I first tried the solution in the FAQ thread:

Code: Select all

  
      ActivateRegion("forceoutreg")
  local VehspawnNum = 1
  local VehspawnMaxNum = 6

  testfunction = OnEnterRegion
  function("forceoutreg", player)
  if IsCharacterInRegion(player, "forceoutreg") and VehspawnNum <= VehspawnMaxNum then
  ExitVehicle(player, "Vehspawn" .. VehspawnNum)
  VehspawnNum = VehspawnNum + 1
  else if IsCharacterInRegion(player, "forceoutreg") and VehspawnNum > VehspawnMaxNum then
  VehspawnNum = 1
  ExitVehicle(player, "Vehspawn" .. VehspawnNum)
  VehspawnNum = VehspawnNum + 1
end
  end
    end

However, when I loaded the map with this script (the original script in the FAQ thread kept giving me errors in my mungelog and crashed my map so I decided to modify it) the map crashes the split second it loads. I get a very small error log:
Hidden/Spoiler:
Opened logfile BFront2.log 2009-10-16 1751
ingame stream movies\crawl.mvs
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
num, Selection = 1 table: 03CF128C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 1
EraSelection.subst = c era_c
EraSelection.subst = g era_g
play movie GRV 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment GRV0.000000ly

this.CurButton = nil
cur_button = nil
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 10
EraSelection.subst = c era_c
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 11
EraSelection.subst = g era_g
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 16
EraSelection.subst = c era_c
EraSelection.subst = g era_g
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 17
EraSelection.subst = c era_c
EraSelection.subst = g era_g
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 18
EraSelection.subst = c era_c
EraSelection.subst = g era_g
EraSelection.subst = c era_c
EraSelection.subst = g era_g
num, Selection = 1 table: 03CF128C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 25
EraSelection.subst = c era_c
EraSelection.subst = g era_g
play movie GRV 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment GRV0.000000ly

this.CurButton = check_era1
cur_button = nil
bEra_CloneWar = nil bEra_Galactic = 1
clonewar_visable = true galactic_visable = true
Adding map: NORg_con idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil
(none):0: attempt to call global `IsCharacterInRegion' (a nil value)
I noted the last line looked suspicious, so i canceled it out with '--'. However, once I fixed that line it said the same thing about another line and another line in the code. I read Mav's post on the FAQ topic that suggested using the entity function. So I tried that and came up with this code:

Code: Select all

    ActivateRegion("forcevehiclereg")
testfunction = OnEnterRegion(
   function(region, player)
      if IsCharacterInRegion(player, "forcevehiclereg") then
          EnterVehicle(player, CreateEntity("rep_fly_ride_gunship"))
      end
   end,
"forcevehiclereg"
)

    ActivateRegion("forceoutreg")
testfunction = OnEnterRegion(
   function(region, player)
      if IsCharacterInRegion(player, "forcevehiclereg") then
          ExitVehicle(player, CreateEntity("rep_fly_ride_gunship"))
      end
   end,
"forcevehiclereg"
However, this code also crahsed the exact same way as the other one did. If anyone at all can find any flaw in this script please post, because it is really stumping me. Thanks for all the help everyone here has given me! Thanks in advance :D

Re: Lua code problem

Posted: Sat Oct 17, 2009 12:19 am
by Maveritchell
I know ExitVehicle only has one input:

Code: Select all

ExitVehicle(player)
But the real problem is the IsCharacterInRegion. I don't know why it seems to be done this way, but any examples of it in the stock script write it like this:

Code: Select all

IsCharacterInRegion (player, "CP1Control")
instead of like:

Code: Select all

IsCharacterInRegion(player, "CP1Control")
The difference is the space between the "region" and the opening parenthesis. Try it with the space and see if it works. And also fix ExitVehicle.

Re: Lua code problem

Posted: Sat Oct 17, 2009 10:28 am
by elfie
Thanks for replying, Mav. I made the changes you suggested, and it seemed like it should work, but I got another crash on the same spot with a similar BF2log:
Hidden/Spoiler:
Opened logfile BFront2.log 2009-10-17 1015
ingame stream movies\crawl.mvs
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
num, Selection = 1 table: 03CF128C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 1
EraSelection.subst = c era_c
EraSelection.subst = g era_g
play movie GRV 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment GRV0.000000ly

+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 4
EraSelection.subst = c era_c
EraSelection.subst = g era_g
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 5
EraSelection.subst = c era_c
EraSelection.subst = g era_g
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 6
EraSelection.subst = c era_c
EraSelection.subst = g era_g
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 7
EraSelection.subst = c era_c
EraSelection.subst = g era_g
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 8
EraSelection.subst = c era_c
EraSelection.subst = g era_g
EraSelection.subst = c era_c
EraSelection.subst = g era_g
num, Selection = 1 table: 03CF128C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 25
EraSelection.subst = c era_c
EraSelection.subst = g era_g
play movie GRV 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment GRV0.000000ly

this.CurButton = nil
cur_button = nil
this.CurButton = check_era1
cur_button = nil
bEra_CloneWar = nil bEra_Galactic = 1
clonewar_visable = true galactic_visable = true
Adding map: NORg_con idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil
(none):0: attempt to call global `ActivateRegion' (a nil value)
I also tried playing the map without the script, and it ran fine so I know the script is the problem at least.
Here is what the current script looks like:
Hidden/Spoiler:
ActivateRegion("forcevehiclereg")
testfunction = OnEnterRegion(
function(region, player)
if IsCharacterInRegion (player, "forcevehiclereg") then
EnterVehicle(player, CreateEntity("rep_fly_ride_gunship"))
end
end,
"forcevehiclereg"
)

ActivateRegion("forceoutreg")
testfunction = OnEnterRegion(
function(region, player)
if IsCharacterInRegion (player, "forcevehiclereg") then
ExitVehicle(player)
end
end,
"forceoutreg"
)
Any help is appreciated. I think I'm getting closer now.

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:07 pm
by [RDH]Zerted
You're supposed to put the code inside of the ScriptPostLoad function.

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:30 pm
by elfie
Wait... Do you mean inside the parenthesis?

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:36 pm
by [RDH]Zerted
No, the parameters/arguments go inside the parenthesis. Inside the function is after the parenthesis and before the function's end.

Structure of a function:

Code: Select all

--before the function
function_name( argument1, argument2, ...)
    --the inside of a function
end
--after the function

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:41 pm
by elfie
[RDH]Zerted wrote:No, the parameters/arguments go inside the parenthesis. Inside the function is after the parenthesis and before the function's end.

Structure of a function:

Code: Select all

--before the function
function_name( argument1, argument2, ...)
    --the inside of a function
end
--after the function
Okay, I'm sorry but I dont think I really understand what you are saying. The function in my code is:

Code: Select all

   function(region, player)
and I have region and player in parenthesis. I also have testfunction too, but I don't know if that is the same as function. So function_name goes inside the blue part of scriptpost load?:
function ScriptPostLoad()

I'm sorry if I sound stupid, but I am no coding expert. Also, thanks for replying. :)

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:41 pm
by Maveritchell
Post your .lua.

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:43 pm
by elfie
Maveritchell wrote:Post your .lua.
Sure:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

-- Imp Attacking (attacker is always #1)
ALL = 1
IMP = 2
-- These variables do not change
ATT = 1
DEF = 2

WookieTeam= 3

---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2",
multiplayerRules = true,
isUberMode = true,
uberScoreLimit = 350,
}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)
AddAIGoal(ALL, "Defend", 30, "gatepanel")
AddAIGoal(IMP, "Destroy", 30, "gatepanel")
AddAIGoal(ALL, "Destroy", 10, "woodl")
AddAIGoal(ALL, "Destroy", 10, "woodc")
AddAIGoal(ALL, "Destroy", 10, "woodr")
AddAIGoal(IMP, "Defend", 10, "woodl")
AddAIGoal(IMP, "Defend", 10, "woodc")
AddAIGoal(IMP, "Defend", 10, "woodr")

-- TDM.OnStart = function(self)
-- ctf.goal1 = AddAIGoal(ALL, "Defend", 30, "gatepanel")
-- ctf.goal2 = AddAIGoal(IMP, "Destroy", 30, "gatepanel")
-- ctf.goal3 = AddAIGoal(IMP, "Destroy", 10, "woodl")
-- ctf.goal4 = AddAIGoal(IMP, "Destroy", 10, "woodc")
-- ctf.goal5 = AddAIGoal(IMP, "Destroy", 10, "woodr")
-- ctf.goal6 = AddAIGoal(ALL, "Defend", 10, "woodl")
-- ctf.goal7 = AddAIGoal(ALL, "Defend", 10, "woodc")
-- ctf.goal8 = AddAIGoal(ALL, "Defend", 10, "woodr")
-- end

--Gate Stuff --
BlockPlanningGraphArcs("seawall1")
BlockPlanningGraphArcs("woodl")
BlockPlanningGraphArcs("woodc")
BlockPlanningGraphArcs("woodr")
DisableBarriers("disableme");

SetProperty("woodl", "MaxHealth", 15000)
SetProperty("woodl", "CurHealth", 15000)
SetProperty("woodr", "MaxHealth", 15000)
SetProperty("woodr", "CurHealth", 15000)
SetProperty("woodc", "MaxHealth", 15000)
SetProperty("woodc", "CurHealth", 15000)
SetProperty("gatepanel", "MaxHealth", 1000)
SetProperty("gatepanel", "CurHealth", 1000)


OnObjectKillName(PlayAnimDown, "gatepanel");
OnObjectRespawnName(PlayAnimUp, "gatepanel");
OnObjectKillName(woodl, "woodl");
OnObjectKillName(woodc, "woodc");
OnObjectKillName(woodr, "woodr");
OnObjectRespawnName(woodlr, "woodl");
OnObjectRespawnName(woodcr, "woodc");
OnObjectRespawnName(woodrr, "woodr");
end

--ActivateRegion("forcevehiclereg")
--testfunction = OnEnterRegion(
--function(region, player)
--if IsCharacterInRegion (player, "forcevehiclereg") then
--EnterVehicle(player, CreateEntity("rep_fly_ride_gunship"))
--end
--end,
--"forcevehiclereg"
--)

ActivateRegion("forceoutreg")
testfunction = OnEnterRegion(
function(region, player)
if IsCharacterInRegion (player, "forceoutreg") then
ExitVehicle(player)
end
end,
"forceoutreg"
)


--ActivateRegion("forcevehiclereg")
--local VehspawnNum = 1
--local VehspawnMaxNum = 6

--testfunction = OnEnterRegion
--function("forcevehiclereg", player)
--if IsCharacterInRegion(player, "forcevehiclereg") and VehspawnNum <= VehspawnMaxNum then
--EnterVehicle(player, "Vehspawn" .. VehspawnNum)
--VehspawnNum = VehspawnNum + 1
--else if IsCharacterInRegion(player, "forcevehiclereg") and VehspawnNum > VehspawnMaxNum then
--VehspawnNum = 1
--EnterVehicle(player, "Vehspawn" .. VehspawnNum)
--VehspawnNum = VehspawnNum + 1
--end
--end
--end

--ActivateRegion("forceoutreg")
--local VehspawnNum = 1
--local VehspawnMaxNum = 6

--testfunction = OnEnterRegion
--function("forceoutreg", player)
--if IsCharacterInRegion(player, "forceoutreg") and VehspawnNum <= VehspawnMaxNum then
--ExitVehicle(player, "Vehspawn" .. VehspawnNum)
--VehspawnNum = VehspawnNum + 1
--else if IsCharacterInRegion(player, "forceoutreg") and VehspawnNum > VehspawnMaxNum then
--VehspawnNum = 1
--ExitVehicle(player, "Vehspawn" .. VehspawnNum)
--VehspawnNum = VehspawnNum + 1
--end
--end
--end

function PlayAnimDown()
PauseAnimation("thegateup");
RewindAnimation("thegatedown");
PlayAnimation("thegatedown");
ShowMessageText("level.kas2.objectives.gateopen",1)
ScriptCB_SndPlaySound("KAS_obj_13")
SetProperty("gatepanel", "MaxHealth", 2200)
-- SetProperty("gatepanel", "CurHealth", 50000)
-- PlayAnimation("gatepanel");
--SetProperty("gatepanel", "MaxHealth", 1e+37)
--SetProperty("gatepanel", "CurHealth", 1e+37)


-- Allowing AI to run under gate
UnblockPlanningGraphArcs("seawall1");
DisableBarriers("seawalldoor1");
DisableBarriers("vehicleblocker");

end

function PlayAnimUp()
PauseAnimation("thegatedown");
RewindAnimation("thegateup");
PlayAnimation("thegateup");


-- Allowing AI to run under gate
BlockPlanningGraphArcs("seawall1");
EnableBarriers("seawalldoor1");
EnableBarriers("vehicleblocker");
SetProperty("gatepanel", "MaxHealth", 1000)
SetProperty("gatepanel", "CurHealth", 1000)

end

function woodl()
UnblockPlanningGraphArcs("woodl");
DisableBarriers("woodl");
SetProperty("woodl", "MaxHealth", 1800)
-- SetProperty("woodl", "CurHealth", 15)
end

function woodc()
UnblockPlanningGraphArcs("woodc");
DisableBarriers("woodc");
SetProperty("woodc", "MaxHealth", 1800)
-- SetProperty("woodc", "CurHealth", 15)
end

function woodr()
UnblockPlanningGraphArcs("woodr");
DisableBarriers("woodr");
SetProperty("woodr", "MaxHealth", 1800)
-- SetProperty("woodr", "CurHealth", 15)
end

function woodlr()
BlockPlanningGraphArcs("woodl")
EnableBarriers("woodl")
SetProperty("woodl", "MaxHealth", 15000)
SetProperty("woodl", "CurHealth", 15000)
end

function woodcr()
BlockPlanningGraphArcs("woodc")
EnableBarriers("woodc")
SetProperty("woodc", "MaxHealth", 15000)
SetProperty("woodc", "CurHealth", 15000)
end

function woodrr()
BlockPlanningGraphArcs("woodr")
EnableBarriers("woodr")
SetProperty("woodr", "MaxHealth", 15000)
SetProperty("woodr", "CurHealth", 15000)
end

function ScriptInit()
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(3550000)

SetUberMode(1);

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(70)


ReadDataFile("sound\\kas.lvl;kas2gcw")
ReadDataFile("dc:SIDE\\all.lvl",
"amer_inf_rifleman",
"amer_inf_support",
"amer_inf_smg",
"rep_fly_ride_gunship")

ReadDataFile("dc:SIDE\\all.lvl",
"ger_inf_rifleman",
"ger_inf_smg",
"ger_inf_officer")

--ReadDataFile("SIDE\\wok.lvl",
--"wok_inf_basic")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_beam",
"tur_bldg_recoilless_kas")


SetupTeams{

all={
team = ALL,
units = 160,
reinforcements = -1,
soldier = {"amer_inf_rifleman",10, 40},
assault = {"amer_inf_support",1, 30},
engineer = {"amer_inf_smg",1, 30},
sniper = {"all_inf_sniper_jungle",1, 20},
officer = {"all_inf_officer",1, 20},
special = {"all_inf_wookiee",1, 20},

},

imp={
team = IMP,
units = 160,
reinforcements = -1,
soldier = {"ger_inf_rifleman",10, 40},
assault = {"ger_inf_smg",1, 30},
engineer = {"ger_inf_officer",1, 20},

}
}

-- Alliance Stats
--SetHeroClass(ALL, "all_hero_chewbacca")

-- Imperial Stats
--SetHeroClass(IMP, "imp_hero_bobafett")


--SetTeamName(3, "locals")
--SetTeamIcon(3, "all_icon")
--AddUnitClass(3, "wok_inf_warrior",2)
--AddUnitClass(3, "wok_inf_rocketeer",2)
--AddUnitClass(3, "wok_inf_mechanic",1)


--SetUnitCount(3, 5)
--AddAIGoal(WookieTeam, "Deathmatch", 100)
--SetTeamAsFriend(ATT,3)
--SetTeamAsFriend(3,ATT)
--SetTeamAsEnemy(DEF,3)
--SetTeamAsEnemy(3,DEF)

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 3) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each

SetMemoryPoolSize("Aimer", 100)
SetMemoryPoolSize("EntityCloth", 37)
SetMemoryPoolSize("EntityLight", 44)
SetMemoryPoolSize("EntityHover", 11)
SetMemoryPoolSize("EntityFlyer", 7)
SetMemoryPoolSize("EntitySoundStream", 3)
SetMemoryPoolSize("MountedTurret", 25)
SetMemoryPoolSize("Obstacle", 600)
SetMemoryPoolSize("PathNode", 512)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 20)
SetMemoryPoolSize("TreeGridStack", 300)
SetMemoryPoolSize("Weapon", 300)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:NOR\\kas2.lvl", "kas2_xl")
SetDenseEnvironment("true")
SetMaxFlyHeight(65)
SetMaxPlayerFlyHeight(65)

-- Birdies
SetNumBirdTypes(1)
SetBirdType(0,1.0,"bird")

-- Fishies
SetNumFishTypes(1)
SetFishType(0,0.8,"fish")

-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "wok_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)
AudioStreamAppendSegments("sound\\global.lvl", "wok_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\kas.lvl", "kas")
OpenAudioStream("sound\\kas.lvl", "kas")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "Allleaving")
SetOutOfBoundsVoiceOver(2, "Impleaving")

SetAmbientMusic(ALL, 1.0, "all_kas_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_kas_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2,"all_kas_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_kas_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_kas_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2,"imp_kas_amb_end", 2,1)

SetVictoryMusic(ALL, "all_kas_amb_victory")
SetDefeatMusic (ALL, "all_kas_amb_defeat")
SetVictoryMusic(IMP, "imp_kas_amb_victory")
SetDefeatMusic (IMP, "imp_kas_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


SetAttackingTeam(ATT)

--Kas2 Docks
--Wide beach shot
AddCameraShot(0.977642, -0.052163, -0.203414, -0.010853, 66.539520, 21.864969, 168.598495);
AddCameraShot(0.969455, -0.011915, 0.244960, 0.003011, 219.552948, 21.864969, 177.675674);
AddCameraShot(0.995040, -0.013447, 0.098558, 0.001332, 133.571289, 16.216759, 121.571236);
AddCameraShot(0.350433, -0.049725, -0.925991, -0.131394, 30.085188, 32.105236, -105.325264);



-- GOOD SHOTS --
-- Gate to Right


--Kinda Cool --

AddCameraShot(0.163369, -0.029669, -0.970249, -0.176203, 85.474831, 47.313362, -156.345627);
AddCameraShot(0.091112, -0.011521, -0.987907, -0.124920, 97.554062, 53.690968, -179.347076);
AddCameraShot(0.964953, -0.059962, 0.254988, 0.015845, 246.471008, 20.362143, 153.701050);



end

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:48 pm
by Maveritchell
Just like Zerted said, your additional code is located outside of the ScriptPostLoad block. The fact that you're working with a stock Kashyyyk lua is confusing you, but you need to make sure that your code goes between "function ScriptPostLoad()" and "end." Right now it is outside the "end" that ends ScriptPostLoad.

Re: Lua code problem- forcing characters in and out of vehicles

Posted: Sun Oct 18, 2009 5:58 pm
by elfie
Maveritchell wrote:Just like Zerted said, your additional code is located outside of the ScriptPostLoad block. The fact that you're working with a stock Kashyyyk lua is confusing you, but you need to make sure that your code goes between "function ScriptPostLoad()" and "end." Right now it is outside the "end" that ends ScriptPostLoad.
Oh yes!! Thank you so much Mav and Zerted it works perfectly now. All this time I kept thinking it was a problem with what was in the script, but it turns out it was the placement of the script. Thanks again! :D