Creating space XL script
Posted: Thu Mar 06, 2014 4:31 pm
by AnthonyBF2
I'm planning to make an XL mode for a space map but I know I'm messing up the script in many ways. Any one who can do scripting please review this and correct issues, thanks!
I took the Hoth XL script and modified so far to fit a space level:
I took the Hoth XL script and modified so far to fit a space level:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")
-- Empire Attacking (attacker is always #1)
ALL = 2
IMP = 1
-- These variables do not change
ATT = 1
DEF = 2
---------------------------------------------------------------------------
-- 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()
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2",
multiplayerRules = true,
isUberMode = true,
uberScoreLimit = 1000,
}
TDM:Start()
EnableSPHeroRules()
--
end
function ScriptInit()
if(ScriptCB_GetPlatform() == "PS2") then
StealArtistHeap(1024*1024) -- steal 1MB from art heap
end
-- Designers, these two lines *MUST* be first.
--SetPS2ModelMemory(4500000)
SetPS2ModelMemory(3300000)
SetUberMode(1);
ReadDataFile("ingame.lvl")
-- Empire Attacking (attacker is always #1)
--local ALL = 2
--local IMP = 1
-- These variables do not change
--local ATT = 1
--local DEF = 2
--SetAttackingTeam(ATT)
SetMaxFlyHeight(2000)
SetMaxPlayerFlyHeight(2000)
SetGroundFlyerMap(1);
ReadDataFile("sound\\spa.lvl;spa1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_fly_snowspeeder",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_engineer_snow",
"all_inf_sniper_snow",
"all_inf_officer_snow",
"all_hero_luke_pilot",
"all_inf_wookiee_snow",
"all_inf_pilot",
"all_inf_marine",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_fly_awing",
"all_fly_gunship_sc",
"all_veh_remote_terminal",
"all_walk_tauntaun")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman_snow",
"imp_inf_rocketeer_snow",
"imp_inf_sniper_snow",
"imp_inf_dark_trooper",
"imp_inf_engineer_snow",
"imp_inf_officer",
"imp_hero_bobafett",
"imp_walk_atat",
"imp_inf_pilot",
"imp_inf_marine",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_veh_remote_terminal",
"imp_walk_atst_snow")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_spa_all_beam",
"tur_bldg_spa_all_recoilless",
"tur_bldg_spa_all_chaingun",
"tur_bldg_spa_imp_beam",
"tur_bldg_spa_imp_recoilless",
"tur_bldg_spa_imp_chaingun",
"tur_bldg_chaingun_roof")
SetupTeams{
all={
team = ALL,
units = 150,
reinforcements = -1,
soldier = {"all_inf_rifleman_fleet",9, 30},
assault = {"all_inf_rocketeer_fleet",1, 30},
engineer = {"all_inf_engineer",1, 30},
sniper = {"all_inf_sniper_fleet",1, 30},
officer = {"all_inf_officer_",1, 30},
special = {"all_inf_wookiee_",1, 30},
pilot = { "all_inf_pilot",30},
marine = { "all_inf_marine",30},
},
imp={
team = IMP,
units = 150,
reinforcements = -1,
soldier = {"imp_inf_rifleman",9, 30},
assault = {"imp_inf_rocketeer",1, 30},
engineer = {"imp_inf_engineer",1, 30},
sniper = {"imp_inf_sniper",1, 30},
officer = {"imp_inf_officer",1, 30},
special = {"imp_inf_dark_trooper",1, 30},
pilot = { "imp_inf_pilot",30},
marine = { "imp_inf_marine",30},
}
}
)
end
--Setting up Heros--
SetHeroClass(IMP, "imp_hero_bobafett")
SetHeroClass(ALL, "all_hero_luke_pilot")
-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(1, 5) -- 6 atsts with 1 leg pairs each
AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each
local weaponCnt = 221
SetMemoryPoolSize("Aimer", 500)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 175)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 41)
SetMemoryPoolSize("EntityFlyer", 500)
SetMemoryPoolSize("EntityLight", 110)
SetMemoryPoolSize("CommandFlyer", 20)
SetMemoryPoolSize("EntitySoundStatic", 16)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 54)
SetMemoryPoolSize("MountedTurret", 30)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("EntityRemoteTerminal", 12)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("OrdnanceTowCable", 40) -- !!!! need +4 extra for wrapped/fallen cables !!!!
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TreeGridStack", 300)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("Weapon", weaponCnt)
ReadDataFile("SPA\\spa_sky.lvl", world)
ReadDataFile("spa\\spa9.lvl", myGameMode)
SetDenseEnvironment("false")
SetParticleLODBias(15000)
-- Sound Stats
voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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)
OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
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, IMP, "all_hot_transport_away", .75, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .5, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .25, 1)
SetOutOfBoundsVoiceOver(2, "Allleaving")
SetOutOfBoundsVoiceOver(1, "Impleaving")
-- SetAmbientMusic(ALL, 1.0, "all_hot_amb_start", 0,1)
-- SetAmbientMusic(ALL, 0.8, "all_hot_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.2, "all_hot_amb_end", 2,1)
-- SetAmbientMusic(IMP, 1.0, "imp_hot_amb_start", 0,1)
-- SetAmbientMusic(IMP, 0.8, "imp_hot_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.2, "imp_hot_amb_end", 2,1)
SetVictoryMusic(ALL, "all_hot_amb_victory")
SetDefeatMusic (ALL, "all_hot_amb_defeat")
SetVictoryMusic(IMP, "imp_hot_amb_victory")
SetDefeatMusic (IMP, "imp_hot_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 Naboo Again, the following line was here, it's legacy, FUSCO!
SetAttackingTeam(IMP)
-- Internal Alliance hangar
-- this shot is bad, needs to be fixed
AddCameraShot(-0.049495, 0.003922, -0.995646, -0.078892, 24.992880, -22.995819, -1025.940186);
--Flag shot
AddCameraShot(0.546201, 0.047743, 0.833116, -0.072822, 402.610260, -105.474068, -55.044727);
--Internal Imperial hangar
AddCameraShot(0.988295, -0.091070, 0.121873, 0.011230, 33.932011, 10.868500, 1567.624146);
-- Imperial ship overall
AddCameraShot(-0.380690, 0.021761, -0.922940, -0.052756, 1351.167236, 188.651230, -10.971837);
-- Alliance ship overall
AddCameraShot(0.941014, -0.051715, 0.333887, 0.018349, 1053.546143, 188.651230, -51.276745);
AddLandingRegion("imp_hangar1")
AddLandingRegion("all_hangar1")
if (gPlatformStr == "PS2") then
ScriptCB_DisableFlyerShadows()
end
end
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")
-- Empire Attacking (attacker is always #1)
ALL = 2
IMP = 1
-- These variables do not change
ATT = 1
DEF = 2
---------------------------------------------------------------------------
-- 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()
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2",
multiplayerRules = true,
isUberMode = true,
uberScoreLimit = 1000,
}
TDM:Start()
EnableSPHeroRules()
--
end
function ScriptInit()
if(ScriptCB_GetPlatform() == "PS2") then
StealArtistHeap(1024*1024) -- steal 1MB from art heap
end
-- Designers, these two lines *MUST* be first.
--SetPS2ModelMemory(4500000)
SetPS2ModelMemory(3300000)
SetUberMode(1);
ReadDataFile("ingame.lvl")
-- Empire Attacking (attacker is always #1)
--local ALL = 2
--local IMP = 1
-- These variables do not change
--local ATT = 1
--local DEF = 2
--SetAttackingTeam(ATT)
SetMaxFlyHeight(2000)
SetMaxPlayerFlyHeight(2000)
SetGroundFlyerMap(1);
ReadDataFile("sound\\spa.lvl;spa1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_fly_snowspeeder",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_engineer_snow",
"all_inf_sniper_snow",
"all_inf_officer_snow",
"all_hero_luke_pilot",
"all_inf_wookiee_snow",
"all_inf_pilot",
"all_inf_marine",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_fly_awing",
"all_fly_gunship_sc",
"all_veh_remote_terminal",
"all_walk_tauntaun")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman_snow",
"imp_inf_rocketeer_snow",
"imp_inf_sniper_snow",
"imp_inf_dark_trooper",
"imp_inf_engineer_snow",
"imp_inf_officer",
"imp_hero_bobafett",
"imp_walk_atat",
"imp_inf_pilot",
"imp_inf_marine",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_veh_remote_terminal",
"imp_walk_atst_snow")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_spa_all_beam",
"tur_bldg_spa_all_recoilless",
"tur_bldg_spa_all_chaingun",
"tur_bldg_spa_imp_beam",
"tur_bldg_spa_imp_recoilless",
"tur_bldg_spa_imp_chaingun",
"tur_bldg_chaingun_roof")
SetupTeams{
all={
team = ALL,
units = 150,
reinforcements = -1,
soldier = {"all_inf_rifleman_fleet",9, 30},
assault = {"all_inf_rocketeer_fleet",1, 30},
engineer = {"all_inf_engineer",1, 30},
sniper = {"all_inf_sniper_fleet",1, 30},
officer = {"all_inf_officer_",1, 30},
special = {"all_inf_wookiee_",1, 30},
pilot = { "all_inf_pilot",30},
marine = { "all_inf_marine",30},
},
imp={
team = IMP,
units = 150,
reinforcements = -1,
soldier = {"imp_inf_rifleman",9, 30},
assault = {"imp_inf_rocketeer",1, 30},
engineer = {"imp_inf_engineer",1, 30},
sniper = {"imp_inf_sniper",1, 30},
officer = {"imp_inf_officer",1, 30},
special = {"imp_inf_dark_trooper",1, 30},
pilot = { "imp_inf_pilot",30},
marine = { "imp_inf_marine",30},
}
}
)
end
--Setting up Heros--
SetHeroClass(IMP, "imp_hero_bobafett")
SetHeroClass(ALL, "all_hero_luke_pilot")
-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(1, 5) -- 6 atsts with 1 leg pairs each
AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each
local weaponCnt = 221
SetMemoryPoolSize("Aimer", 500)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 175)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 41)
SetMemoryPoolSize("EntityFlyer", 500)
SetMemoryPoolSize("EntityLight", 110)
SetMemoryPoolSize("CommandFlyer", 20)
SetMemoryPoolSize("EntitySoundStatic", 16)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 54)
SetMemoryPoolSize("MountedTurret", 30)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("EntityRemoteTerminal", 12)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("OrdnanceTowCable", 40) -- !!!! need +4 extra for wrapped/fallen cables !!!!
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TreeGridStack", 300)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("Weapon", weaponCnt)
ReadDataFile("SPA\\spa_sky.lvl", world)
ReadDataFile("spa\\spa9.lvl", myGameMode)
SetDenseEnvironment("false")
SetParticleLODBias(15000)
-- Sound Stats
voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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)
OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
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, IMP, "all_hot_transport_away", .75, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .5, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .25, 1)
SetOutOfBoundsVoiceOver(2, "Allleaving")
SetOutOfBoundsVoiceOver(1, "Impleaving")
-- SetAmbientMusic(ALL, 1.0, "all_hot_amb_start", 0,1)
-- SetAmbientMusic(ALL, 0.8, "all_hot_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.2, "all_hot_amb_end", 2,1)
-- SetAmbientMusic(IMP, 1.0, "imp_hot_amb_start", 0,1)
-- SetAmbientMusic(IMP, 0.8, "imp_hot_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.2, "imp_hot_amb_end", 2,1)
SetVictoryMusic(ALL, "all_hot_amb_victory")
SetDefeatMusic (ALL, "all_hot_amb_defeat")
SetVictoryMusic(IMP, "imp_hot_amb_victory")
SetDefeatMusic (IMP, "imp_hot_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 Naboo Again, the following line was here, it's legacy, FUSCO!
SetAttackingTeam(IMP)
-- Internal Alliance hangar
-- this shot is bad, needs to be fixed
AddCameraShot(-0.049495, 0.003922, -0.995646, -0.078892, 24.992880, -22.995819, -1025.940186);
--Flag shot
AddCameraShot(0.546201, 0.047743, 0.833116, -0.072822, 402.610260, -105.474068, -55.044727);
--Internal Imperial hangar
AddCameraShot(0.988295, -0.091070, 0.121873, 0.011230, 33.932011, 10.868500, 1567.624146);
-- Imperial ship overall
AddCameraShot(-0.380690, 0.021761, -0.922940, -0.052756, 1351.167236, 188.651230, -10.971837);
-- Alliance ship overall
AddCameraShot(0.941014, -0.051715, 0.333887, 0.018349, 1053.546143, 188.651230, -51.276745);
AddLandingRegion("imp_hangar1")
AddLandingRegion("all_hangar1")
if (gPlatformStr == "PS2") then
ScriptCB_DisableFlyerShadows()
end
end