Page 1 of 1

Hero support not working (new problem)

Posted: Wed Sep 09, 2009 8:26 pm
by impspy
I'm making an era addon mod, but when start up the death star, but the AI won't play as the hero and I can't either?

mission:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"config"
"ingame_movies"
}

REQN
{
"script"
"AIHeroSupport"
"setup_teams"
"gametype_conquest"
"gametype_capture"
"Objective"
"MultiObjectiveContainer"
"ObjectiveCTF"
"ObjectiveAssault"
"ObjectiveSpaceAssault"
"ObjectiveConquest"
"ObjectiveTDM"
"ObjectiveOneFlagCTF"
"SoundEvent_ctf"
"ObjectiveGoto"
"LinkedShields"
"LinkedDestroyables"
"LinkedTurrets"
"Ambush"
"PlayMovieWithTransition"
}

REQN
{
"lvl"
"cor1l_con"
"dag1l_con"
"dea1l_con"
"end1l_con"
"fel1l_con"
"hot1l_con"
"kam1l_con"
"kas2l_con"
"mus1l_con"
"myg1l_con"
"nab2l_con"
"pol1l_con"
"tan1l_con"
"tat2l_con"
"tat3l_con"
"uta1l_con"
"yav1l_con"

}
}[/code]
AI HEro support (not changed)
Removed. This was completely unnecessary to post if you didn't change it.

lua:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
---------------------------------------------------------------------------
-- 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()
TrashStuff();
PlayAnimExtend();
PlayAnimTakExtend();

BlockPlanningGraphArcs("compactor")
OnObjectKillName(CompactorConnectionOn, "grate01")

DisableBarriers("start_room_barrier")
DisableBarriers("dr_left")
DisableBarriers("circle_bar1")
DisableBarriers("circle_bar2")

-- handle reinforcment loss and defeat condition
OnCharacterDeathTeam(function(character, killer) AddReinforcements(1, -1) end, 1)
OnTicketCountChange(function(team, count) if count == 0 then MissionDefeat(team) end end)

OnObjectRespawnName(PlayAnimExtend, "Panel-Chasm");
OnObjectKillName(PlayAnimRetract, "Panel-Chasm");

OnObjectRespawnName(PlayAnimTakExtend, "Panel-Tak");
OnObjectKillName(PlayAnimTakRetract, "Panel-Tak");

KillObject("CP6")
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"}

--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:Start()

SetUberMode(1)


AddDeathRegion("DeathRegion01")
AddDeathRegion("DeathRegion02")
AddDeathRegion("DeathRegion03")
AddDeathRegion("DeathRegion04")
AddDeathRegion("DeathRegion05")

herosupport:AddSpawnCP("cp1","cp1spawn")
herosupport:AddSpawnCP("cp2","cp2spawn")
herosupport:AddSpawnCP("cp3","cp3spawn")
herosupport:AddSpawnCP("cp4","cp4spawn")
herosupport:AddSpawnCP("cp5","cp5spawn")
herosupport:AddSpawnCP("cp7","cp7spawn")
herosupport:Start()

end

function CompactorConnectionOn()
UnblockPlanningGraphArcs ("compactor")
end
--START BRIDGEWORK!

-- OPEN
function PlayAnimExtend()
PauseAnimation("bridgeclose");
RewindAnimation("bridgeopen");
PlayAnimation("bridgeopen");

-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection122");
DisableBarriers("BridgeBarrier");

end
-- CLOSE
function PlayAnimRetract()
PauseAnimation("bridgeopen");
RewindAnimation("bridgeclose");
PlayAnimation("bridgeclose");

-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection122");
EnableBarriers("BridgeBarrier");

end

--START BRIDGEWORK TAK!!!

-- OPEN
function PlayAnimTakExtend()
PauseAnimation("TakBridgeOpen");
RewindAnimation("TakBridgeClose");
PlayAnimation("TakBridgeClose");

-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection128");
DisableBarriers("Barrier222");

end
-- CLOSE
function PlayAnimTakRetract()
PauseAnimation("TakBridgeClose");
RewindAnimation("TakBridgeOpen");
PlayAnimation("TakBridgeOpen");

-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection128");
EnableBarriers("Barrier222");

end

function TrashStuff()

trash_open = 1
trash_closed = 0

trash_timer = CreateTimer("trash_timer")
SetTimerValue(trash_timer, 7)
StartTimer(trash_timer)
trash_death = OnTimerElapse(
function(timer)
if trash_open == 1 then
AddDeathRegion("deathregion")
SetTimerValue(trash_timer, 5)
StartTimer(trash_timer)
trash_closed = 1
trash_open = 0
print("death region added")

elseif trash_closed == 1 then
RemoveRegion("deathregion")
SetTimerValue(trash_timer, 15)
StartTimer(trash_timer)
print("death region removed")
trash_closed = 0
trash_open = 1
end
end,
trash_timer
)
end




function ScriptInit()
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(4000000)
ReadDataFile("ingame.lvl")

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

ReadDataFile("sound\\dea.lvl;dea1gcw")


SetMaxFlyHeight(72)
SetMaxPlayerFlyHeight (72)
AISnipeSuitabilityDist(30)



ReadDataFile("dc:SIDE\\ump.lvl",
"ump_inf_commander",
"ump_inf_stormtrooper",
"imp_inf_tiepilot",
"imp_inf_fleetofficer",
"imp_inf_gunner",
"reb_inf_prisoner",
"reb_inf_norprisoner",
"reb_inf_wookprisoner",
"imp_inf_stormofficer",
"imp_inf_deasergeant",
"ump_inf_cody",
"reb_inf_prisonereng",
"ump_inf_novacommander",
"ump_inf_sniper",
"reb_inf_prisoneroff",
"jed_knight_01")


ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_laser")

SetupTeams{
all = {
team = ALL,
units = 50,
reinforcements = 50,
soldier = { "reb_inf_norprisoner",9, 25},
assault = { "reb_inf_prisoner",5,10},
engineer = { "reb_inf_prisonereng",3,6},
sniper = { "",1,4},
officer = { "reb_inf_prisoneroff",2,5},
special = { "reb_inf_wookprisoner",2,6},

},
imp = {
team = IMP,
units = 32,
reinforcements = 300,
soldier = { "ump_inf_stormtrooper",8,24},
assault = { "ump_inf_sniper",2,5},
engineer = { "imp_inf_tiepilot",3,7},
sniper = { "imp_inf_gunner",2,5},
officer = { "imp_inf_stormofficer",2,4},
special = { "imp_inf_fleetofficer",4,7},
},
}


AddUnitClass(IMP, "imp_inf_deasergeant",2,4)
AddUnitClass(IMP, "ump_inf_commander",2,4)

-- Level Stats
ClearWalkers()
-- AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(1, 0) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
-- AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 200
SetMemoryPoolSize ("Aimer", 0)
SetMemoryPoolSize ("AmmoCounter", weaponCnt)
SetMemoryPoolSize ("BaseHint", 300)
SetMemoryPoolSize ("EnergyBar", weaponCnt)
SetMemoryPoolSize ("EntityCloth", 18)
SetMemoryPoolSize ("EntityLight", 100)
SetMemoryPoolSize ("EntitySoundStatic", 30)
SetMemoryPoolSize ("SoundSpaceRegion", 50)
SetMemoryPoolSize ("MountedTurret", 0)
SetMemoryPoolSize ("Navigator", 50)
SetMemoryPoolSize ("Obstacle", 260)
SetMemoryPoolSize ("PathFollower", 50)
SetMemoryPoolSize ("PathNode", 512)
SetMemoryPoolSize ("RedOmniLight", 130)
SetMemoryPoolSize ("ShieldEffect", 0)
SetMemoryPoolSize("SoldierAnimation", 272)
SetMemoryPoolSize ("TreeGridStack", 200)
SetMemoryPoolSize ("UnitAgent", 50)
SetMemoryPoolSize ("UnitController", 50)
SetMemoryPoolSize ("Weapon", weaponCnt)
SetMemoryPoolSize ("EntityFlyer", 6)

-- Local Stats
--SetTeamName (3, "locals")
--AddUnitClass (3, "ewk_inf_trooper", 4)
--AddUnitClass (3, "ewk_inf_repair", 6)
--SetUnitCount (3, 14)
--SetTeamAsFriend(3,ATT)
--SetTeamAsEnemy(3,DEF)


SetSpawnDelay(10.0, 0.25)
ReadDataFile("dea\\dea1.lvl", "dea1_Conquest")
SetDenseEnvironment("true")

--SetStayInTurrets(1)


-- Movies
-- SetVictoryMovie(ALL, "all_end_victory")
-- SetDefeatMovie(ALL, "imp_end_victory")
-- SetVictoryMovie(IMP, "imp_end_victory")
-- SetDefeatMovie(IMP, "all_end_victory")

-- Sound

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\\dea.lvl", "dea1")
OpenAudioStream("sound\\dea.lvl", "dea1")
-- OpenAudioStream("sound\\cor.lvl", "dea1gcw_emt")

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_dea_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_dea_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2,"all_dea_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_dea_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_dea_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2,"imp_dea_amb_end", 2,1)

SetVictoryMusic(ALL, "all_dea_amb_victory")
SetDefeatMusic (ALL, "all_dea_amb_defeat")
SetVictoryMusic(IMP, "imp_dea_amb_victory")
SetDefeatMusic (IMP, "imp_dea_amb_defeat")

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



AddCameraShot(-0.404895, 0.000992, -0.514360, -0.002240, -121.539894, 62.536297, -257.699493)
--Homestead
AddCameraShot(0.040922, -0.004049, -0.994299, -0.098381, -103.729523, 55.546598, -225.360893)
--Sarlac Pit
AddCameraShot(-1.0, 0.0, -0.514360, 0.0, -55.381485, 50.450953, -96.514324)

herosupport = AIHeroSupport:New{AIATTHeroHealth = 2500, AIDEFHeroHealth = 2500, gameMode = "conquest", minSpawnTime = 10,}
herosupport:SetHeroClass(IMP, "ump_imp_cody")
herosupport:SetHeroClass(ALL, "jed_knight_01")

end

[/code]
error log:

Code: Select all

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to index global `AIHeroSupport' (a nil value)
stack traceback:
	(none): in function `ScriptInit'


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Platform\PC\pcFirstPerson.cpp(69)
FirstPerson::LoadLVLFile: Could not open FPM\IMP\repshadow.lvl

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "CP6" not found

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to index global `herosupport' (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.

Re: hero support not working

Posted: Wed Sep 09, 2009 8:41 pm
by myers73
Please use hide tags next time.

Do as the serverities say. For the severity 2 I believe you need to remove the "--"(no quotes) from infront of the cp6 setups in the lua, as it wont read that line of code, so therefore wont be able to find it for the KillCP function, or any other references.

Re: hero support not working

Posted: Wed Sep 09, 2009 8:59 pm
by Maveritchell
Read the instructions more carefully:
*Setting up your map's lua:

1- Open your map's lua file in text/script editor
2- You will see a bunch of "ScriptCB_DoFile(something here)" commands at the top
3- Add this just after them:

ScriptCB_DoFile("AIHeroSupport")

Re: Hero support not working (new problem)

Posted: Fri Sep 11, 2009 12:47 pm
by impspy
Thank you mav; I feel like a dunce :funny2:

EDIT ok the death star works but now Kamino doesn't work :(

what's up?

lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("AIHeroSupport")

-- Empire Attacking (attacker is always #1)
REP = 1;
IMP = 2;
-- 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()
SetProperty("cp1", "Team", "1")
SetProperty("cp2", "Team", "2")
SetProperty("cp3", "Team", "2")
SetProperty("cp4", "Team", "2")
SetProperty("cp5", "Team", "1")
SetProperty("cp6", "Team", "1")
DisableBarriers("camp")
SetAIDamageThreshold("Comp1", 0 )
SetAIDamageThreshold("Comp2", 0 )
SetAIDamageThreshold("Comp3", 0 )
SetAIDamageThreshold("Comp4", 0 )
SetAIDamageThreshold("Comp5", 0 )
SetAIDamageThreshold("Comp6", 0 )
SetAIDamageThreshold("Comp7", 0 )
SetAIDamageThreshold("Comp8", 0 )
SetAIDamageThreshold("Comp9", 0 )
SetAIDamageThreshold("Comp10", 0 )

SetProperty("Kam_Bldg_Podroom_Door32", "Islocked", 1)

SetProperty("Kam_Bldg_Podroom_Door33", "Islocked", 1)
SetProperty("Kam_Bldg_Podroom_Door32", "Islocked", 1)
SetProperty("Kam_Bldg_Podroom_Door34", "Islocked", 1)
SetProperty("Kam_Bldg_Podroom_Door35", "Islocked", 1)
SetProperty("Kam_Bldg_Podroom_Door27", "Islocked", 0)
SetProperty("Kam_Bldg_Podroom_Door28", "Islocked", 1)
SetProperty("Kam_Bldg_Podroom_Door36", "Islocked", 1)
SetProperty("Kam_Bldg_Podroom_Door20", "Islocked", 0)
UnblockPlanningGraphArcs("connection71")

--Objective1
UnblockPlanningGraphArcs("connection85")
UnblockPlanningGraphArcs("connection48")
UnblockPlanningGraphArcs("connection63")
UnblockPlanningGraphArcs("connection59")
UnblockPlanningGraphArcs("close")
UnblockPlanningGraphArcs("open")
DisableBarriers("frog")
DisableBarriers("close")
DisableBarriers("open")

--blocking Locked Doors
UnblockPlanningGraphArcs("connection194");
UnblockPlanningGraphArcs("connection200");
UnblockPlanningGraphArcs("connection118");
DisableBarriers("FRONTDOOR2-3");
DisableBarriers("FRONTDOOR2-1");
DisableBarriers("FRONTDOOR2-2");

--Lower cloning facility
UnblockPlanningGraphArcs("connection10")
UnblockPlanningGraphArcs("connection159")
UnblockPlanningGraphArcs("connection31")
DisableBarriers("FRONTDOOR1-3")
DisableBarriers("FRONTDOOR1-1")
DisableBarriers("FRONTDOOR1-2")

--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"}

--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:Start()

herosupport:AddSpawnCP("cp1","cp1_spawn")
herosupport:AddSpawnCP("cp2","path33")
herosupport:AddSpawnCP("cp3","cp3_spawn")
herosupport:AddSpawnCP("cp4","path32")
herosupport:AddSpawnCP("cp5","cp5_spawn")
herosupport:AddSpawnCP("cp6","path31")
herosupport:Start()

SetUberMode(1)

SetProperty("cp2", "spawnpath", "cp2_spawn")
SetProperty("cp2", "captureregion", "cp2_capture")

end

--START BRIDGEWORK!

-- OPEN

function ScriptInit()
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(3600000)
ReadDataFile("ingame.lvl")




ReadDataFile("sound\\kam.lvl;kam1cross")

--SetMaxFlyHeight(43)
--SetMaxPlayerFlyHeight (43)

ReadDataFile("dc:SIDE\\p4i.lvl",
"ump_inf_kamcom",
"ump_inf_stormtrooper",
"ump_inf_sniper",
"ump_inf_rocketeer",
"ump_inf_armytech",
"ump_inf_sergeant",
"ump_inf_sqcom",
"ump_inf_cody",
"kam_inf_clone",
"kam_inf_cloneeng",
"kam_inf_clonesniper",
"kam_inf_cloneofficer",
"kam_inf_clonerailarcblue",
"kam_inf_clonerailarcred",
"kam_inf_arccommander",
"imp_hero_bobafett")

ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")

-- Level Stats
ClearWalkers()
-- AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(1, 3) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
-- AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
SetMemoryPoolSize ("EntityCloth", 33)
SetMemoryPoolSize ("EntityLight", 64)
SetMemoryPoolSize ("Obstacle", 800)
SetMemoryPoolSize("EntitySoundStream", 3)
SetMemoryPoolSize ("SoundSpaceRegion", 36)
SetMemoryPoolSize("EntitySoundStatic", 85)
SetMemoryPoolSize("SoldierAnimation", 192)
SetMemoryPoolSize ("Weapon", 380)

SetupTeams{
rep = {
team = REP,
units = 32,
reinforcements = 150,
soldier = { "kam_inf_clone",9, 25},
assault = { "kam_inf_clonesniper",1, 4},
engineer = { "kam_inf_cloneofficer",1, 4},
sniper = { "kam_inf_cloneeng",1, 4},
officer = { "kam_inf_clonerailarcblue",1, 4},
special = { "kam_inf_clonerailarcred",1,4},
},

}

SetupTeams{
imp = {
team = IMP,
units = 50,
reinforcements = 150,
soldier = { "ump_inf_stormtrooper",8,24},
assault = { "ump_inf_rocketeer",2,5},
engineer = { "ump_inf_armytech",3,7},
sniper = { "ump_inf_sniper",2,5},
officer = { "ump_inf_sergeant",2,4},
special = { "ump_inf_sqcom",2,4},
},
}


AddUnitClass(IMP, "ump_inf_kamcom",1,2)


SetSpawnDelay(10.0, 0.25)
-- AddDeathRegion("deathregion")
ReadDataFile("KAM\\kam1.lvl", "kamino1_conquest")
SetMemoryPoolSize("EntityFlyer", 6)
SetDenseEnvironment("false")
SetMinFlyHeight(60)
SetAllowBlindJetJumps(0)
SetMaxFlyHeight(102)
SetMaxPlayerFlyHeight(102)
--SetStayInTurrets(1)


-- Movies
-- SetVictoryMovie(ALL, "all_end_victory")
-- SetDefeatMovie(ALL, "imp_end_victory")
-- SetVictoryMovie(IMP, "imp_end_victory")
-- SetDefeatMovie(IMP, "all_end_victory")

-- Sound

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\\kam.lvl", "kam1")
OpenAudioStream("sound\\kam.lvl", "kam1")
-- OpenAudioStream("sound\\mus.lvl", "kamino1_emt")

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_kam_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_kam_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_kam_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_kam_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_kam_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_kam_amb_end", 2,1)

SetVictoryMusic(ALL, "all_kam_amb_victory")
SetDefeatMusic (ALL, "all_kam_amb_defeat")
SetVictoryMusic(IMP, "imp_kam_amb_victory")
SetDefeatMusic (IMP, "imp_kam_amb_defeat")

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


AddCameraShot(0.564619, -0.121047, 0.798288, 0.171142, 68.198814, 79.137611, 110.850922);

AddCameraShot(-0.281100, 0.066889, -0.931340, -0.221616, 10.076019, 82.958336, -26.261774);

AddCameraShot(0.209553, -0.039036, -0.960495, -0.178923, 92.558563, 58.820618, 130.675919);

AddCameraShot(0.968794, 0.154227, 0.191627, -0.030506, -173.914413, 69.858940, 52.532421);

AddCameraShot(0.744389, 0.123539, 0.647364, -0.107437, 97.475639, 53.216236, 76.477089);

AddCameraShot(-0.344152, 0.086702, -0.906575, -0.228393, 95.062233, 105.285820, -37.661552);

herosupport = AIHeroSupport:New{AIATTHeroHealth = 2500, AIDEFHeroHealth = 2500, gameMode = "conquest", minSpawnTime = 10,}
herosupport:SetHeroClass(IMP, "imp_hero_bobafett")
herosupport:SetHeroClass(REP, "kam_inf_arccommander")

end
pertinent error log entry

Code: Select all

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to index global `herosupport' (a nil value)
stack traceback:
	(none): in function `ScriptPostLoad'
manual clean has not solved problem.

Re: Hero support not working (new problem)

Posted: Fri Sep 11, 2009 3:12 pm
by Xavious
You forgot this piece

Code: Select all

    herosupport = AIHeroSupport:New{AIATTHeroHealth = 3000, AIDEFHeroHealth = 3000, gameMode = "conquest",}
    herosupport:SetHeroClass(REP, "rep_hero_name")
    herosupport:SetHeroClass(CIS, "cis_hero_name")
which goes right before you add the Command Posts to hero support.

Re: Hero support not working (new problem)

Posted: Fri Sep 11, 2009 7:28 pm
by impspy
thanks Xav that fixed it, but I had to remove one of my units. my other way worked on the death star though (acording to the docs you are supposed to put it there if you have over 7 unit hero included on a side)

EDIT: What, I'm a rebel?!