Ambush + Force-into-Vehicle scripts crashes map, please help

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
stardestroyer001
Sergeant Major
Sergeant Major
Posts: 239
Joined: Fri Apr 16, 2010 7:02 pm
Projects :: Space Coruscant [before it corrupted]
Games I'm Playing :: World of Warships
xbox live or psn: StarDestroyer75
Location: Canada
Contact:

Ambush + Force-into-Vehicle scripts crashes map, please help

Post by stardestroyer001 »

I've tried adding an ambush script to my map so some droids can spawn in. However, when I add the script, the map immediately crashes upon launch. I've also tried adding the force-into-vehicle script to force troopers into ships, but that crashes immediately too.
No severity 3's, no this-that, nothing. Just this:
Hidden/Spoiler:
Opened logfile BFront2.log 2010-10-31 0843
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: Found custom_gc_5.lvl
custom_gc_5: Entered
ifs_freeform_init_jcw.lua
ifs_freeform_start_jcw.lua
custom_gc_5: Taking control of custom_GetGCButtonList()...
custom_gc_5: Taking control of custom_PressedGCButton()...
custom_gc_5: Exited
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_gc_5: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_5: custom_GetGCButtonList(): Exited
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
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
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
this.CurButton = check_mode4
cur_button = nil
this.CurButton = nil
cur_button = nil
this.CurButton = nil
cur_button = nil
Checkbox for check_era3 clicked
this.CurButton = check_era3
cur_button = nil
custom_AddMapNew()
custom_printTable(): table: 0510C138
The key is mapluafile, the formated value is: SC1<A>_<B>
The key, value is: era_c1
The key, value is: mode_assault_c 1
The key, value is: isModLevel 1
The key, value is: bSelected 1
The key, value is: mode_1flag_c 1
custom_printTable(): Returning
custom_printTable(): table: 04CF6D2C
The key, value is: key mode_1flag
The key, value is: subst 1flag
The key, value is: showstr modename.name.1flag
The key, value is: descstr modename.description.1flag
The key, value is: icon mode_icon_ctf
custom_printTable(): Returning
gMapEras.key = era_c Era = era_c subst = c
Adding map: SC1c_Diet Dr. Pepper idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil


Apparently no one else had this problem when I was searching via Search. So, what have I done wrong?

SC1c_cmn.lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- stardestroyer001's Common file for Space Coruscant v1.0
-- Common script that shares all setup information

ScriptCB_DoFile("setup_teams")

-- Republic Attacking (attacker is always #1)
REP = 1
CIS = 2

-- These variables do not change
ATT = 1
DEF = 2

AmbushTeam = 4
ATM = AmbushTeam

function SetupUnits()
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_fly_anakinstarfighter_sc",
"rep_fly_arc170fighter_sc",
"rep_fly_gunship_sc",
"rep_fly_vwing",
"rep_hero_anakin",
"rep_hero_obiwan",
"rep_inf_ep3_pilot",
"rep_inf_ep3_marine",
"rep_veh_remote_terminal")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_droideka",
"cis_inf_pilot",
"cis_inf_marine",
"cis_inf_rifleman",
"cis_fly_droidfighter_sc",
"cis_fly_droidgunship",
"cis_fly_greviousfighter",
"cis_hero_grievous",
"cis_hero_countdooku",
"cis_fly_tridroidfighter")

ReadDataFile("dc:SIDE\\imp.lvl",
"imp_fly_ai_trooptrans")

ReadDataFile("dc:SIDE\\jed.lvl",
"jed_knight_04",
"jed_master_01")

ReadDataFile("dc:SIDE\\SC1.lvl",
"cis_inf_magnaguard_ptc",
"rep_fly_obiwanstarfighter_sc")

ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_spa_cis_beam",
"tur_bldg_spa_cis_chaingun",
"tur_bldg_spa_rep_beam",
"tur_bldg_spa_rep_chaingun",
"tur_bldg_chaingun_roof"
)
end

myTeamConfig = {
rep = {
team = REP,
units = 40,
reinforcements = -1,
pilot = { "rep_inf_ep3_pilot",20},
soldier = { "rep_inf_ep3_marine",40},
engineer = { "jed_master_01",1, 3},
sniper = { "jed_knight_04",1, 5},
jedi = { "rep_hero_anakin",0, 1},
jedimajor = { "rep_hero_obiwan",0, 1},

},
cis = {
team = CIS,
units = 30,
reinforcements = -1,
pilot = { "cis_inf_pilot",10},
soldier = { "cis_inf_rifleman",10},
--officer = { "cis_inf_droideka",1, 5},
special = { "cis_inf_magnaguard_ptc",1, 3},
jedi = { "cis_hero_grievous",0, 1},
jedimajor = { "cis_hero_countdooku",0, 1},
marine = { "cis_inf_marine",5},

},

atm = {
team = ATM,
units = 6,
reinforcements = -1,
soldier = { "cis_inf_pilot",6, 6},
},
}

--SetTeamName (3, "jawas")
--AddUnitClass (3, "cis_inf_pilot",10, 15)
--SetUnitCount (3, 15)
--AddAIGoal(3, "Deathmatch", 100)
--SetTeamAsEnemy(ATT,3)
--SetTeamAsEnemy(3,ATT)
--SetTeamAsFriend(DEF,3)
--SetTeamAsFriend(3,DEF)

SetTeamAsEnemy(ATM, REP)
SetTeamAsEnemy(REP, ATM)
SetTeamAsFriend(ATM, CIS)
SetTeamAsFriend(CIS, ATM)
ClearAIGoals(ATM)
AddAIGoal(ATM, "Deathmatch", 100)
SetTeamName(ATM, CIS)



ScriptCB_DoFile("LinkedTurrets")
function SetupTurrets()
--CIS turrets
turretLinkageCIS = LinkedTurrets:New{ team = CIS, mainframe = "cis-defense",
turrets = {"cis_turr_1", "cis_turr_2", "cis_turr_3", "cis_turr_4", "cis_turr_5", "cis_turr_6"} }
turretLinkageCIS:Init()

function turretLinkageCIS:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", REP)
ShowMessageText("level.spa.hangar.mainframe.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_20", REP )
BroadcastVoiceOver( "COSMP_obj_21", CIS )
end
function turretLinkageCIS:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", REP)
ShowMessageText("level.spa.hangar.mainframe.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_22", REP )
BroadcastVoiceOver( "COSMP_obj_23", CIS )
end

--REP turrets
turretLinkageREP = LinkedTurrets:New{ team = REP, mainframe = "rep-defense",
turrets = {"rep_turr_1", "rep_turr_2", "rep_turr_3", "rep_turr_4", "rep_turr_5", "rep_turr_6"} }
turretLinkageREP:Init()

function turretLinkageREP:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", CIS)
ShowMessageText("level.spa.hangar.mainframe.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_21", REP )
BroadcastVoiceOver( "COSMP_obj_20", CIS )
end
function turretLinkageREP:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", CIS)
ShowMessageText("level.spa.hangar.mainframe.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_23", REP )
BroadcastVoiceOver( "COSMP_obj_22", CIS )
end
end

function ScriptPreInit()
SetWorldExtents(10000)
end

---------------------------------------------------------------------------
-- 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 ScriptInit()

ReadDataFile("dc:Load\\common.lvl")

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",600) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",3000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo -- should be ~1x #combo

-- Designers, this line *MUST* be first!
ReadDataFile("ingame.lvl")

SetMinFlyHeight(-600)
SetMaxFlyHeight(500)
SetMinPlayerFlyHeight(-600)
SetMaxPlayerFlyHeight(500)
SetAIVehicleNotifyRadius(1000)

ReadDataFile("dc:sound\\efx.lvl;efxcw")
ReadDataFile("sound\\spa.lvl;spa2cw")
ReadDataFile("SIDE\\\\cis.lvl",
"cis_inf_pilot")

ScriptCB_SetDopplerFactor(0.4)
ScaleSoundParameter("tur_weapons", "MinDistance", 3.0);
ScaleSoundParameter("tur_weapons", "MaxDistance", 3.0);
ScaleSoundParameter("tur_weapons", "MuteDistance", 3.0);
ScaleSoundParameter("Ordnance_Large", "MinDistance", 3.0);
ScaleSoundParameter("Ordnance_Large", "MaxDistance", 3.0);
ScaleSoundParameter("Ordnance_Large", "MuteDistance", 3.0);
ScaleSoundParameter("explosion", "MaxDistance", 5.0);
ScaleSoundParameter("explosion", "MuteDistance", 5.0);

SetupUnits()
SetupTeams(myTeamConfig)

-- Level Stats
ClearWalkers()
AddWalkerType(0, 5) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

local weaponCnt = 380
local guyCnt = 32
local units = 200
SetMemoryPoolSize("Aimer", 350)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 200)
SetMemoryPoolSize("Combo::DamageSample", 2861)
SetMemoryPoolSize("ConnectivityGraphFollower", 30)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityDroideka",5)
SetMemoryPoolSize("EntityDroid",0)
SetMemoryPoolSize("EntityHover", 16)
SetMemoryPoolSize("EntityFlyer", 48)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1600)
SetMemoryPoolSize("ParticleTransformer::ColorTrans" , 2100)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1250)
SetMemoryPoolSize("EntityLight", 170)
SetMemoryPoolSize("EntityRemoteTerminal", 12)
SetMemoryPoolSize("EntitySoldier",guyCnt)
SetMemoryPoolSize("SoldierAnimation", 800)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 180)
SetMemoryPoolSize("Music", 35)
SetMemoryPoolSize("Navigator", guyCnt)
SetMemoryPoolSize("Obstacle", 150)
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PassengerSlot", 0)
SetMemoryPoolSize("PathFollower", 60)
SetMemoryPoolSize("PathNode", 92)
SetMemoryPoolSize("RedOmniLight", 178)
SetMemoryPoolSize("TentacleSimulator", 10)
SetMemoryPoolSize("TreeGridStack", 270)
SetMemoryPoolSize("UnitAgent", units)
SetMemoryPoolSize("UnitController", units)
SetMemoryPoolSize("Weapon", weaponCnt)


SetSpawnDelay(10.0, 0.25)

-- do any pool allocations, custom loading here
if myScriptInit then
myScriptInit()
myScriptInit = nil
end

ReadDataFile("dc:SC1\\spa_sky.lvl", "cor")

ReadDataFile("dc:SC1\\SC1.lvl", myGameMode)

SetDenseEnvironment("false")

SetParticleLODBias(15000)

-- Sound Stats
local voiceSlow = OpenAudioStream("sound\\global.lvl", "spa1_objective_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "rep_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

local voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("dc:sound\\efx.lvl", "efxcw_music")
OpenAudioStream("sound\\global.lvl", "cw_music")
OpenAudioStream("sound\\spa.lvl", "spa")
OpenAudioStream("sound\\spa.lvl", "spa")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
-- OpenAudioStream("sound\\tat.lvl", "tat1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(REP, "Repleaving")
SetOutOfBoundsVoiceOver(CIS, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_kam_amb_start", 0,1);
--SetAmbientMusic(REP, 0.99, "rep_kam_amb_middle", 1,1);
--SetAmbientMusic(REP, 0.1,"rep_kam_amb_end", 2,1);
SetAmbientMusic(CIS, 1.0, "cis_kam_amb_start", 0,1);
--SetAmbientMusic(CIS, 0.99, "cis_kam_amb_middle", 1,1);
--SetAmbientMusic(CIS, 0.1,"cis_kam_amb_end", 2,1);

SetVictoryMusic(REP, "rep_kam_amb_victory")
SetDefeatMusic (REP, "all_tat_amb_defeat")
SetVictoryMusic(CIS, "cis_kam_amb_victory")
SetDefeatMusic (CIS, "imp_tat_amb_defeat")

SetAmbientMusic(REP, 1.0, "rep_spa_amb_start", 0,1)
SetAmbientMusic(REP, 0.99, "rep_spa_amb_middle", 1,1)
SetAmbientMusic(REP, 0.1,"rep_spa_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_spa_amb_start", 0,1)
SetAmbientMusic(CIS, 0.99, "cis_spa_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.1,"cis_spa_amb_end", 2,1)

SetVictoryMusic(REP, "rep_spa_amb_victory")
SetDefeatMusic (REP, "rep_spa_amb_defeat")
SetVictoryMusic(CIS, "cis_spa_amb_victory")
SetDefeatMusic (CIS, "cis_spa_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")

-- Camera Stats Battle over Felucia
-- ARC170Carrier Hangar Exterior Shot
AddCameraShot(0.962752, 0.242761, -0.115453, 0.029112, 1190.458984, 130.080994, -1005.170349);
-- Invisible Hand w/Autoturret looking at battle
AddCameraShot(0.999775, 0.007066, -0.019991, 0.000141, -301.363434, 124.240158, 2267.915527);
-- ERASE AND PLACE NEW ONE
AddCameraShot(-0.335210, 0.057062, -0.927078, -0.157814, 1372.964233, 1940.014038, -2266.423828);
-- Overall from left side of map
AddCameraShot(0.911880, -0.246677, -0.316680, -0.085667, -2183.282471, 1940.014038, 2760.666748);

AddDeathRegion("deathregion1")
AddDeathRegion("deathregion4")
AddLandingRegion("rep-CP1Con")
AddLandingRegion("rep-CP2Con")
AddLandingRegion("rep-CP3Con")
AddLandingRegion("cis-CP1Con")
AddLandingRegion("cis-CP2Con")
AddLandingRegion("cis-CP3Con")
AddLandingRegion("cisfighter1_con")
end

The commented out lines about a team 3 were an attempt to add locals, which also crashed the map immediately.

SC1c_Diet Dr. Pepper.lua:
Hidden/Spoiler:
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- stardestroyer001's Assault file for Space Coruscant v1.0
-- Governs all Assault Mode-related stuff not covered in SC1c_cmn.lua
-- Also, if you need ScriptPostLoad, it's here too :D

ScriptCB_DoFile("teleport")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ambush")
ScriptCB_DoFile("SC1c_cmn")

ScriptCB_DoFile("ObjectiveSpaceAssault")
ScriptCB_DoFile("LinkedShields")
ScriptCB_DoFile("LinkedDestroyables")

myGameMode = "SC1_CW-Assault"

function myScriptInit()
SetMemoryPoolSize("CommandFlyer", 3)
SetMemoryPoolSize("CommandWalker", 0)
end


function ScriptPostLoad()

SetupObjectives()

SetupShields()
SetupDestroyables()
SetupTurrets()

SetupAmbushTrigger("ambushregion1", "ambushpath1",6, 4)

AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(CIS, "Deathmatch", 100)

DisableSmallMapMiniMap()

-- Animations: Blast Door
OnObjectRespawnName(PlayAnimUp, "spa2_prop_ihanimtrigger");
OnObjectKillName(PlayAnimDrop, "spa2_prop_ihanimtrigger");

function PlayAnimDrop()
RewindAnimation("spa_cisdoormove1animup");
PauseAnimation("spa_cisdoormove1animdown");
PlayAnimation("spa_cisdoormove1animdown");
end

function PlayAnimUp()
RewindAnimation("spa_cisdoormove1animdown");
PauseAnimation("spa_cisdoormove1animup");
PlayAnimation("spa_cisdoormove1animup");
end

--ActivateRegion("cis-ambushersregion1")
--local VehspawnNum = 1
--local VehspawnMaxNum = 5

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

ActivateRegion("rep_bridge_in_reg")
OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"rep_bridge_in_node")
end,
"rep_bridge_in_reg"
)

--A single teleport
local region = GetRegionLocation( "rep_bridge_in_reg" )
local destination = GetPathNodeDestination( "rep_bridge_in_node", 0 )
SetupEnterRegionTeleport( region, destination, 0, 0 )
ActivateRegion( "rep_bridge_in_reg" )

end

function SetupObjectives()
assault = ObjectiveSpaceAssault:New{
teamATT = REP, teamDEF = CIS,
multiplayerRules = true
}

local repTargets = {
engines = { "cis_drive_1", "cis_drive_2" },
lifesupport = "cis-life-ext",
bridge = "cis-bridge",
comm = "cis-comms",
sensors = "cis-sensors",
frigates = "cis-frigate",
internalSys = { "cis-life-int", "cis-engines" },
}

local cisTargets = {
engines = "rep_drive_1",
lifesupport = "rep-life-ext",
bridge = "rep-bridge",
comm = "rep-comms",
sensors = "rep-sensors",
frigates = "rep-frigate",
internalSys = { "rep-life-int", "rep-engines" },
}

assault:SetupAllCriticalSystems( "rep", repTargets, true )
assault:SetupAllCriticalSystems( "cis", cisTargets, false )

assault:Start()
end

function SetupShields()
-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_ship_1", "cis_ship_2", "cis_ship_3", "cis_ship_4",
"cis-bridge", "cis-comms", "cis-life-ext", "cis-sensors",
"cis_drive_1", "cis_drive_2", "cis-frigate6"}
shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "cis-shield"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end

-- REP Shielded objects
local linkedShieldObjectsREP = { "rep_ship_1", "rep_ship_2", "rep_ship_3", "rep_ship_4",
"rep-bridge", "rep-comms", "rep-life-ext", "rep-sensors",
"rep_drive_1", "rep-frigate"}
shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep-shield"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )
end
end


function SetupDestroyables()
--CIS destroyables
lifeSupportLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis-life-int"}, {"cis-life-ext"}} }
lifeSupportLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_drive_1", "cis_drive_2"}, {"cis-engines"}} }
engineLinkageCIS:Init()

-- shieldLinkageCIS = LinkedDestroyables:New{ objectSets = {{cis_shield"}, {"externalEasterEgg}} }
-- shieldLinkageCIS:Init()

--REP destroyables
lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep-life-int"}, {"rep-life-ext"}} }
lifeSupportLinkageREP:Init()

engineLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_drive_1"}, {"rep-engines"}} }
engineLinkageREP:Init()
end

function MoveEntityToNode(entIn,pathIn,nodeIn)
if not entIn then
print("Warning!: Entity not specified for move")
return false
elseif not pathIn then
print("Warning!: Path not specified for Entity " .. entIn .. " move")
return false
end

local node
if nodeIn then
node = nodeIn
else
node = 0
end

local locDest = GetPathPoint(pathIn,node)
local charUnit = GetCharacterUnit(entIn)
if charUnit then
SetEntityMatrix(charUnit,locDest)
return true
end
return false
end

Some of the region stuff in there was an attempt to make a teleporter, which didn't teleport. Also, there's some animation stuff but that doesn't work either (I destroy the object and nothing happens).

Additional Info:
-I have Windows 7 (Windows 7 is not my idea :funny2: )
-I'm also having problems with starfighters, where I think I'm doing everything right, and a Sev 3 error happens. Somewhere inside, could this map's files be defective in some way?
-If you need any other files, I'll post them.

I really need the ambush and force-into-vehicle scripts working. Please post soon.
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Ambush + Force-into-Vehicle scripts crashes map, please

Post by linksith »

I'm not sure about your ambush and force-into-vehicle script problems but I might be able to help on your transporter.

You will want to change this
Hidden/Spoiler:
[quote="stardestroyer001"]local locDest = GetPathPoint(pathIn,node)
local charUnit = GetCharacterUnit(entIn)
if charUnit then
SetEntityMatrix(charUnit,locDest)
return true
end
return false
end[/quote]
to this
Hidden/Spoiler:
local locDest = GetPathPoint(pathIn,node)
local charUnit = GetCharacterUnit(entIn)
local charVeh = GetCharacterVehicle(entIn)
if charVeh then
SetEntityMatrix(charVeh,locDest)
elseif charUnit then
SetEntityMatrix(charUnit,locDest)
return true
end
return false
end
or else vehicles won't be transported.

I'm not sure why you did this
Hidden/Spoiler:
[quote="stardestroyer001"]ActivateRegion("rep_bridge_in_reg")
OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"rep_bridge_in_node")
end,
"rep_bridge_in_reg"
)

--A single teleport
local region = GetRegionLocation( "rep_bridge_in_reg" )
local destination = GetPathNodeDestination( "rep_bridge_in_node", 0 )
SetupEnterRegionTeleport( region, destination, 0, 0 )

ActivateRegion( "rep_bridge_in_reg" )

end[/quote]
but I'll give you my LUA for comparing the two. I've also highlighted the teleporter parts so they are easy to find. It might help you solve the teleporter problem.

My LUA (land battle)
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)

conquest:Start()

EnableSPHeroRules()
OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"transnotestout")
end,
"transregtestout"
)
ActivateRegion("transregtestout")

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"utanoout")
end,
"utaregout"
)
ActivateRegion("utaregout")

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"transnodkas")
end,
"transvehkas"
)
ActivateRegion("transvehkas")

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"transnodgeo")
end,
"transvehgeo"
)
ActivateRegion("transvehgeo")


AddDeathRegion("deathregion1")
AddDeathRegion("deathregion2")
end

function ScriptPreInit()
SetWorldExtents(5000)
end


---------------------------------------------------------------------------
-- 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 ScriptInit()

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(999)
SetMaxPlayerFlyHeight (999)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hover_fightertank",
"rep_hero_anakin",
"rep_hover_barcspeeder")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul",
"cis_hover_aat",
"cis_fly_greviousfighter")


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

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_rifleman",9, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
}
}

SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(REP, "rep_hero_anakin")


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:CWG\\CWG.lvl", "CWG_conquest")
ReadDataFile("dc:CWG\\CWG.lvl", "CWG_conquest")
SetDenseEnvironment("false")




-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")


--OpeningSateliteShot
AddCameraShot(0.908386, -0.209095, -0.352873, -0.081226, -45.922508, -19.114113, 77.022636);

AddCameraShot(-0.481173, 0.024248, -0.875181, -0.044103, 14.767292, -30.602322, -144.506851);
AddCameraShot(0.999914, -0.012495, -0.004416, -0.000055, 1.143253, -33.602314, -76.884430);
AddCameraShot(0.839161, 0.012048, -0.543698, 0.007806, 19.152437, -49.802273, 24.337317);
AddCameraShot(0.467324, 0.006709, -0.883972, 0.012691, 11.825212, -49.802273, -7.000720);
AddCameraShot(0.861797, 0.001786, -0.507253, 0.001051, -11.986043, -59.702248, 23.263165);
AddCameraShot(0.628546, -0.042609, -0.774831, -0.052525, 20.429928, -48.302277, 9.771714);
AddCameraShot(0.765213, -0.051873, 0.640215, 0.043400, 57.692474, -48.302277, 16.540724);
AddCameraShot(0.264032, -0.015285, -0.962782, -0.055734, -16.681797, -42.902290, 129.553268);
AddCameraShot(-0.382320, 0.022132, -0.922222, -0.053386, 20.670977, -42.902290, 135.513001);
end

function MoveEntityToNode(entIn,pathIn,nodeIn)
if not entIn then
print("Warning!: Entity not specified for move")
return false
elseif not pathIn then
print("Warning!: Path not specified for Entity " .. entIn .. " move")
return false
end

local node
if nodeIn then
node = nodeIn
else
node = 0
end

local locDest = GetPathPoint(pathIn,node)
local charUnit = GetCharacterUnit(entIn)
local charVeh = GetCharacterVehicle(entIn)
if charVeh then
SetEntityMatrix(charVeh,locDest)
elseif charUnit then
SetEntityMatrix(charUnit,locDest)
return true
end
return false
end
stardestroyer001
Sergeant Major
Sergeant Major
Posts: 239
Joined: Fri Apr 16, 2010 7:02 pm
Projects :: Space Coruscant [before it corrupted]
Games I'm Playing :: World of Warships
xbox live or psn: StarDestroyer75
Location: Canada
Contact:

Re: Ambush + Force-into-Vehicle scripts crashes map, please

Post by stardestroyer001 »

I'm not sure why you did this
--A single teleport
local region = GetRegionLocation( "rep_bridge_in_reg" )
local destination = GetPathNodeDestination( "rep_bridge_in_node", 0 )
SetupEnterRegionTeleport( region, destination, 0, 0 )
ActivateRegion( "rep_bridge_in_reg" )
That's an alternate script to get the teleporter working, using the teleport.lua script available (available somewhere, I forget where). Neither one worked. But thanks for the vehicle edit.
Post Reply