In my map, I'm trying to make it so a shield barrier disappears when I destroy a small generator. I'm using the small generator and collector shield from Mygeeto's campaign.
I sort of followed what was said in the second post of the second page of this thread but the shield disappears only when I destroy it manually instead of when I destroy its generator. Before this, however, I tried using the LinkedDestroyables function, but that did not work.
The shield's name is "Shield-command" in ZE and the generator's name is "PowerCell1".
PI2g_con.lua
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Empire Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
SetupDestroyables()
SetupTurrets()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
--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:Start()
EnableSPHeroRules()
OnObjectKill(function(object, killer)
if GetEntityName(object) == "PowerCell1" then
KillObject("Shield-command")
end
end
)
OnObjectRepair(function(object, repairer)
if GetEntityName(object) == "PowerCell1" then
RespawnObject("Shield-command")
end
end
function SetupTurrets()
--IMP turrets
turretLinkageIMP = LinkedTurrets:New{ team = IMP, mainframe = "TurretMainframe1",
turrets = {"HiPwrTurret1", "HiPwrTurret2", "HothTurret1", "HothTurret2"} }
turretLinkageIMP:Init()
function turretLinkageIMP:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.down", IMP)
BroadcastVoiceOver( "IOSMP_obj_21", IMP )
BroadcastVoiceOver( "AOSMP_obj_20", ALL )
end
function turretLinkageIMP:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.up", IMP)
BroadcastVoiceOver( "IOSMP_obj_23", IMP )
BroadcastVoiceOver( "AOSMP_obj_22", ALL )
end
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(40)
SetMaxPlayerFlyHeight(40)
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
First, remove the MaxHealth and ExplosionName parameter lines from the force shield's ODF; you won't be needing them. Second, in the function at the link above, replace objectBnameinZeroEditor with the name of your shield generator. And last, replace the PlayAnimation function with KillObject(""), where the name of your force shield goes in between the quotation marks.
First, remove the MaxHealth and ExplosionName parameter lines from the force shield's ODF; you won't be needing them. Second, in the function at the link above, replace objectBnameinZeroEditor with the name of your shield generator. And last, replace the PlayAnimation function with KillObject(""), where the name of your force shield goes in between the quotation marks.
Didn't work; here's my LUA:
PI2g_con.lua
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Empire Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
SetupDestroyables()
SetupTurrets()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
--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:Start()
EnableSPHeroRules()
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "PowerCell1" then
KillObject("Shield-command")
end
end
function SetupTurrets()
--IMP turrets
turretLinkageIMP = LinkedTurrets:New{ team = IMP, mainframe = "TurretMainframe1",
turrets = {"HiPwrTurret1", "HiPwrTurret2", "HothTurret1", "HothTurret2"} }
turretLinkageIMP:Init()
function turretLinkageIMP:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.down", IMP)
BroadcastVoiceOver( "IOSMP_obj_21", IMP )
BroadcastVoiceOver( "AOSMP_obj_20", ALL )
end
function turretLinkageIMP:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.up", IMP)
BroadcastVoiceOver( "IOSMP_obj_23", IMP )
BroadcastVoiceOver( "AOSMP_obj_22", ALL )
end
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(40)
SetMaxPlayerFlyHeight(40)
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
AQT wrote:Please don't ever shadow bump your own topic again for no apparent reason.
Sorry!
AQT wrote:You have an extra and unnecessary end here:
Hidden/Spoiler:
[quote] animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "PowerCell1" then
KillObject("Shield-command")
end
end
)
end
[/quote]
The shield still does not disappear and now I get these:
PC_MungeLog.txt
Hidden/Spoiler:
[code]F:\BF2_ModTools\data_PI2\_BUILD\..\..\ToolsFL\Bin\luac.exe: ..\..\common\scripts\PI2\PI2g_con.lua:282: `end' expected (to close `function' at line 17) near `<eof>'
ERROR[scriptmunge scripts\PI2\PI2g_con.lua]:Could not read input file.ERROR[scriptmunge scripts\PI2\PI2g_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
ERROR[levelpack mission\PI2g_con.req]:Expecting bracket, but none was found.
File : munged\pc\pi2g_con.script.req(1)...
ucft <--
ERROR[levelpack mission\PI2g_con.req]:Expecting bracket, but none was found.
File : munged\pc\pi2g_con.script.req(1)...
ucft <--
2 Errors 0 Warnings
[/code][/size]
BFront2.log
Hidden/Spoiler:
[code]Opened logfile BFront2.log 2011-05-01 2153
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: No custom_gc_5.lvl
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_GetGCButtonList()
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
Found side\rvs.lvl. Adding BRO's extra KotOR missions
Found ..\..\addon\BDT\data\_LVL_PC\SIDE\dark.lvl. Adding BRO's extra Dark Times missions
Found ..\..\addon\BDT\data\_LVL_PC\SIDE\lead.lvl. Adding ETR's extra Dark Times missions
Cannot find ..\..\addon\BF1\data\_LVL_PC\SIDE\sen.lvl. Skipping ETR's extra Dark Times + Conversion Pack missions
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit
Message Severity: 2
C:\Battlefront2\main\Battlefront2\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
Checkbox for check_era7 clicked
this.CurButton = check_era7
cur_button = nil
this.CurButton = check_mode1
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 060D0DC4
The key, value is: era_c 1
The key, value is: era_g 1
The key, value is: mode_con_c 1
The key is mapluafile, the formated value is: PI2<A>_<B>
The key, value is: mode_con_g 1
The key, value is: bSelected 1
The key, value is: isModLevel 1
custom_printTable(): Returning
custom_printTable(): table: 05CB6B4C
The key, value is: key mode_con
The key, value is: subst con
The key, value is: showstr modename.name.con
The key, value is: descstr modename.description.con
The key, value is: icon mode_icon_con
custom_printTable(): Returning
gMapEras.key = era_g Era = era_g subst = g
Adding map: PI2g_con idx: 1
this.CurButton = Launch
cur_button = nil
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\HUDElementBitmap.cpp(380)
HUD BitmapElement unable to find texture btn_directional_pad_LR
game_interface: Entered
utility_functions2: Listening on AddUnitClass() calls
utility_functions2: Listening on SetHeroClass() calls
utility_functions2: Listening on ReadDataFile() calls
game_interface: Reading in custom strings
game_interface: No user_script_0.lvl
game_interface: No user_script_1.lvl
game_interface: No user_script_2.lvl
game_interface: No user_script_3.lvl
game_interface: No user_script_4.lvl
game_interface: No user_script_5.lvl
game_interface: No user_script_6.lvl
game_interface: No user_script_7.lvl
game_interface: No user_script_8.lvl
game_interface: No user_script_9.lvl
game_interface: Found user_script_10.lvl
user_script_10: Entered
user_script_10: Replacing v1.3 (r117)'s AddUnitClass as it should've had a return value. This fixes the Leia bug.
user_script_10: No user_script_11.lvl. Will stop searching for any more user scripts.
user_script_10: Exited
ifs_sideselect_fnBuildScreen()
game_interface: Exited
Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(317)
Memory pool "ClothData" set item count after being allocated
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\SkyManager.cpp(108)
Skyfile NearSceneRange is in old format
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\SkyManager.cpp(122)
Skyfile FarSceneRange is in old format
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=25a3ab99: trying to replace "myg1_prop_tbuster" with "myg1_prop_tbuster4"
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=27a3aebf: trying to replace "myg1_prop_tbuster" with "myg1_prop_tbuster2"
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(463)
Attach: model '' [932f6b6b] has no hardpoint 'hp_fire' [b3ea0ee8]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=28a3b052: trying to replace "myg1_prop_tbuster" with "myg1_prop_tbuster1"
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=26a3ad2c: trying to replace "myg1_prop_tbuster" with "myg1_prop_tbuster3"
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameObject.cpp(978)
Too many damage effects specified for gameobject [tan4_prop_Console]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameObject.cpp(978)
Too many damage effects specified for gameobject [tan4_prop_Console]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\AttachedEffects.cpp(143)
AttachEffects: effect 'prop_steampipe' not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\AttachedEffects.cpp(143)
AttachEffects: effect 'prop_steampipe' not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\AttachedEffects.cpp(143)
AttachEffects: effect 'prop_steampipe' not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(82)
Weapon 'tur_weap_hipwrturret_laser' is not localized for stats page
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CommandPost.cpp(476)
Label "level.PI2.cp2" not localized
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CommandPost.cpp(476)
Label "level.PI2.cp3" not localized
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CommandPost.cpp(476)
Label "level.PI2.cp1" not localized
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(427)
Attach: model '' [b92433ae] has no hardpoint '' [f1bb7ab7]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(427)
Attach: model '' [b92433ae] has no hardpoint '' [f83941d9]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(82)
Weapon 'tur_weap_laser_auto' is not localized for stats page
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(427)
Attach: model '' [b92433ae] has no hardpoint '' [f1bb7ab7]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(427)
Attach: model '' [b92433ae] has no hardpoint '' [f83941d9]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(463)
Attach: model '' [f62b4f6f] has no hardpoint 'hp_light_3' [a19fd6cf]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=41470d8f: trying to replace "hoth_prop_command_console_a" with "hoth_prop_command_console_a1"
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(463)
Attach: model '' [f62b4f6f] has no hardpoint 'hp_light_3' [a19fd6cf]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(463)
Attach: model '' [31a68a09] has no hardpoint 'hp_light_6' [b65abda4]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(463)
Attach: model '' [f62b4f6f] has no hardpoint 'hp_light_3' [a19fd6cf]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=cd4c6721: trying to replace "hoth_prop_command_console_c" with "hoth_prop_command_console_c1"
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(463)
Attach: model '' [31a68a09] has no hardpoint 'hp_light_6' [b65abda4]
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(463)
Attach: model '' [31a68a09] has no hardpoint 'hp_light_6' [b65abda4]
ifs_sideselect_fnEnter(): Map does not support custom era teams
ifs_sideselect_fnEnter(): The award settings file exists
ifs_sideselect_fnEnter(): Starting to remove award effects...
ifs_sideselect_fnEnter(): Finished removing award effects.
[/code][/size]
PI2g_con.lua
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Empire Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
SetupDestroyables()
SetupTurrets()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
--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:Start()
EnableSPHeroRules()
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "PowerCell1" then
KillObject("Shield-command")
end
end
function SetupTurrets()
--IMP turrets
turretLinkageIMP = LinkedTurrets:New{ team = IMP, mainframe = "TurretMainframe1",
turrets = {"HiPwrTurret1", "HiPwrTurret2"} }
turretLinkageIMP:Init()
function turretLinkageIMP:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.down", IMP)
BroadcastVoiceOver( "IOSMP_obj_21", IMP )
BroadcastVoiceOver( "AOSMP_obj_20", ALL )
end
function turretLinkageIMP:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.up", IMP)
BroadcastVoiceOver( "IOSMP_obj_23", IMP )
BroadcastVoiceOver( "AOSMP_obj_22", ALL )
end
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(40)
SetMaxPlayerFlyHeight(40)
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
-- Empire Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
SetupDestroyables()
SetupTurrets()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
--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:Start()
EnableSPHeroRules()
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "PowerCell1" then
KillObject("Shield-command")
end
end
function SetupTurrets()
--IMP turrets
turretLinkageIMP = LinkedTurrets:New{ team = IMP, mainframe = "TurretMainframe1",
turrets = {"HiPwrTurret1", "HiPwrTurret2"} }
turretLinkageIMP:Init()
function turretLinkageIMP:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.down", IMP)
BroadcastVoiceOver( "IOSMP_obj_21", IMP )
BroadcastVoiceOver( "AOSMP_obj_20", ALL )
end
function turretLinkageIMP:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.up", IMP)
BroadcastVoiceOver( "IOSMP_obj_23", IMP )
BroadcastVoiceOver( "AOSMP_obj_22", ALL )
end
end
--YOU NEED TO ADD ANOTHER end HERE
---------------------------------------------------------------------------
-- 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(40)
SetMaxPlayerFlyHeight(40)
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
-- Empire Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
SetupDestroyables()
SetupTurrets()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
--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:Start()
EnableSPHeroRules()
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "PowerCell1" then
KillObject("Shield-command")
end
end
function SetupTurrets()
--IMP turrets
turretLinkageIMP = LinkedTurrets:New{ team = IMP, mainframe = "TurretMainframe1",
turrets = {"HiPwrTurret1", "HiPwrTurret2"} }
turretLinkageIMP:Init()
function turretLinkageIMP:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.down", IMP)
BroadcastVoiceOver( "IOSMP_obj_21", IMP )
BroadcastVoiceOver( "AOSMP_obj_20", ALL )
end
function turretLinkageIMP:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", ALL)
ShowMessageText("level.spa.hangar.mainframe.def.up", IMP)
BroadcastVoiceOver( "IOSMP_obj_23", IMP )
BroadcastVoiceOver( "AOSMP_obj_22", ALL )
end
end
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(40)
SetMaxPlayerFlyHeight(40)
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
Hmmm, I had this problem when I used a command in the lua that wasn't supported by the game engine. Play the game with the modtools then crash it by pressing ALT+F4 at the same time and look at your log it should say something like:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call field `read' (a nil value)
stack traceback:
(none): in function `ScriptPostLoad'
ifs_sideselect_fnEnter(): Map does not support custom era teams
ifs_sideselect_fnEnter(): The award settings file does not exist
It's weird but just take out whatever it says CallProc failed: (none):0: attempt to call field '___'
whatever is in those quotation marks are not supported by the game.
The AI is gone because you're doing something wrong, the map works because you added that missing 'end'. It's not the problem so don't take it out.
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `SetupDestroyables' (a nil value)
stack traceback:
(none): in function `ScriptPostLoad'
ifs_sideselect_fnEnter(): Map does not support custom era teams
ifs_sideselect_fnEnter(): The award settings file exists
ifs_sideselect_fnEnter(): Starting to remove award effects...
ifs_sideselect_fnEnter(): Finished removing award effects.
Oh...yeah.....
I guess I had better try removing the parts about shields then, since they probably do not exist.
Yeah, what it means is that the function "SetupDestroyables" has something bad in it and thus the function is corrupted. Try removing certain shields or check the names to match the odfs or ze names.