Problems with setting up locals! [Solved]
Posted: Tue Jan 13, 2015 11:47 pm
by JazzMaster
I am setting up a local team via allypaths, but when i try it out in game, the map crashes while loading.
I get this error saying I've set up my AddUnitClass function wrong:
But I'm not sure what I did wrong. Here is my CNDg_cmn:
and my CNDg_Diet Dr. Pepper:
I get this error saying I've set up my AddUnitClass function wrong:
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #1 to `RetailAddUnitClass' (number expected, got nil)
stack traceback:
[C]: in function `RetailAddUnitClass'
(none): in function `AddUnitClass'
(none): in function `ScriptInit'
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #1 to `RetailAddUnitClass' (number expected, got nil)
stack traceback:
[C]: in function `RetailAddUnitClass'
(none): in function `AddUnitClass'
(none): in function `ScriptInit'
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPA9 - Naboo
-- Common script that shares all setup information
--
---------------------------------------------------------------------------
-- 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()
-- Designers, this line *MUST* be first!
ReadDataFile("ingame.lvl")
SetMemoryPoolSize ("SoldierAnimation", 1600)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo
ScriptCB_DoFile("setup_teams")
-- Republic Attacking (attacker is always #1)
ALL = 1
IMP = 2
-- These variables do not change
ATT = 1
DEF = 2
locals= 3;
function SetupUnits()
ReadDataFile("dc:SIDE\\tie.lvl",
"rep_fly_arc170fighter_sc",
"imp_fly_tiefighter_sc",
"imp_fly_tiefighter_auto",
"imp_fly_tie_x1_sc",
"tie_fly_z95_heavy",
"all_fly_ywing_auto",
"all_fly_ywing_sc",
"all_fly_xwing_sc",
"rep_fly_command",
"tie_fly_r41",
"tie_fly_r41_auto",
"tie_fly_heavy95_auto")
ReadDataFile("dc:SIDE\\sep.lvl",
"all_inf_rifleman",
"all_inf_guardsman",
"all_inf_marine",
"all_inf_sniper",
"sep_inf_officer",
"all_inf_engineer")
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_pilot",
"all_inf_melee_commando",
"all_hero_kota",
"imp_inf_royalguard",
"rep_walk_atte")
ReadDataFile("dc:SIDE\\emp.lvl",
"imp_inf_pilot",
"imp_fly_trooptrans",
"imp_inf_marine",
"imp_inf_rifleman",
"imp_inf_sniper",
"imp_inf_stormtrooper",
"imp_inf_navytrooper",
"imp_inf_engineer",
"imp_inf_officer",
"imp_walk_atst",
"imp_hero_darthvader")
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"
)
end
myTeamConfig = {
all = {
team = ALL,
units = 43,
reinforcements = 1200,
soldier = { "all_inf_rifleman",1, 10},
assault = { "all_inf_guardsman",1, 8},
pilot = { "all_inf_pilot",1, 4},
sniper = { "all_inf_sniper",1, 2},
marine = { "all_inf_marine",1, 8},
engineer = { "all_inf_engineer",1, 4},
officer = { "sep_inf_officer",1, 4},
special = { "all_hero_kota",1, 1},
melee = { "all_inf_melee_commando",1, 3},
},
imp = {
team = IMP,
units = 48,
reinforcements = 1200,
soldier = { "imp_inf_navytrooper",1, 5},
assault = { "imp_inf_marine",1, 8},
pilot = { "imp_inf_pilot",1, 3},
engineer = { "imp_inf_engineer",1, 5},
sniper = { "imp_inf_sniper",1, 2},
marine = { "imp_inf_rifleman",1, 10},
officer = { "imp_inf_officer",1, 4},
special = { "imp_hero_darthvader",1, 1},
melee = { "imp_inf_royalguard",1, 3},
}
}
-- Local Stats
SetTeamName(3, "locals")
AddUnitClass(locals, "imp_inf_stormtrooper", 10)
SetUnitCount(3, 10)
SetTeamAsEnemy(3,ATT)
SetTeamAsFriend(3,DEF)
SetTeamAsEnemy(ATT,3)
SetTeamAsFriend(DEF,3)
[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPA9 - Naboo
-- Common script that shares all setup information
--
---------------------------------------------------------------------------
-- 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()
-- Designers, this line *MUST* be first!
ReadDataFile("ingame.lvl")
SetMemoryPoolSize ("SoldierAnimation", 1600)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo
ScriptCB_DoFile("setup_teams")
-- Republic Attacking (attacker is always #1)
ALL = 1
IMP = 2
-- These variables do not change
ATT = 1
DEF = 2
locals= 3;
function SetupUnits()
ReadDataFile("dc:SIDE\\tie.lvl",
"rep_fly_arc170fighter_sc",
"imp_fly_tiefighter_sc",
"imp_fly_tiefighter_auto",
"imp_fly_tie_x1_sc",
"tie_fly_z95_heavy",
"all_fly_ywing_auto",
"all_fly_ywing_sc",
"all_fly_xwing_sc",
"rep_fly_command",
"tie_fly_r41",
"tie_fly_r41_auto",
"tie_fly_heavy95_auto")
ReadDataFile("dc:SIDE\\sep.lvl",
"all_inf_rifleman",
"all_inf_guardsman",
"all_inf_marine",
"all_inf_sniper",
"sep_inf_officer",
"all_inf_engineer")
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_pilot",
"all_inf_melee_commando",
"all_hero_kota",
"imp_inf_royalguard",
"rep_walk_atte")
ReadDataFile("dc:SIDE\\emp.lvl",
"imp_inf_pilot",
"imp_fly_trooptrans",
"imp_inf_marine",
"imp_inf_rifleman",
"imp_inf_sniper",
"imp_inf_stormtrooper",
"imp_inf_navytrooper",
"imp_inf_engineer",
"imp_inf_officer",
"imp_walk_atst",
"imp_hero_darthvader")
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"
)
end
myTeamConfig = {
all = {
team = ALL,
units = 43,
reinforcements = 1200,
soldier = { "all_inf_rifleman",1, 10},
assault = { "all_inf_guardsman",1, 8},
pilot = { "all_inf_pilot",1, 4},
sniper = { "all_inf_sniper",1, 2},
marine = { "all_inf_marine",1, 8},
engineer = { "all_inf_engineer",1, 4},
officer = { "sep_inf_officer",1, 4},
special = { "all_hero_kota",1, 1},
melee = { "all_inf_melee_commando",1, 3},
},
imp = {
team = IMP,
units = 48,
reinforcements = 1200,
soldier = { "imp_inf_navytrooper",1, 5},
assault = { "imp_inf_marine",1, 8},
pilot = { "imp_inf_pilot",1, 3},
engineer = { "imp_inf_engineer",1, 5},
sniper = { "imp_inf_sniper",1, 2},
marine = { "imp_inf_rifleman",1, 10},
officer = { "imp_inf_officer",1, 4},
special = { "imp_hero_darthvader",1, 1},
melee = { "imp_inf_royalguard",1, 3},
}
}
-- Local Stats
SetTeamName(3, "locals")
AddUnitClass(locals, "imp_inf_stormtrooper", 10)
SetUnitCount(3, 10)
SetTeamAsEnemy(3,ATT)
SetTeamAsFriend(3,DEF)
SetTeamAsEnemy(ATT,3)
SetTeamAsFriend(DEF,3)
[/code]
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Clone Wars Template Assault File
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("CNDc_cmn") --rename ABC to your modID
---- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
myGameMode = "CND_CW-Assault"
function myScriptInit()
SetMemoryPoolSize("CommandFlyer", 4)
SetMemoryPoolSize("Music", 100)
end
function ScriptPostLoad()
AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(CIS, "Deathmatch", 100)
SetAIDifficulty(0, 1, "hard")
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "rep-cp1"}
cp2 = CommandPost:New{name = "cp1"}
cp3 = CommandPost:New{name = "cp2"}
cp4 = CommandPost:New{name = "cp3"}
cp5 = CommandPost:New{name = "cp4"}
cp6 = CommandPost:New{name = "cp5"}
cp7 = 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:AddCommandPost(cp7)
conquest:Start()
SetUberMode(1);[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Clone Wars Template Assault File
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("CNDc_cmn") --rename ABC to your modID
---- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
myGameMode = "CND_CW-Assault"
function myScriptInit()
SetMemoryPoolSize("CommandFlyer", 4)
SetMemoryPoolSize("Music", 100)
end
function ScriptPostLoad()
AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(CIS, "Deathmatch", 100)
SetAIDifficulty(0, 1, "hard")
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "rep-cp1"}
cp2 = CommandPost:New{name = "cp1"}
cp3 = CommandPost:New{name = "cp2"}
cp4 = CommandPost:New{name = "cp3"}
cp5 = CommandPost:New{name = "cp4"}
cp6 = CommandPost:New{name = "cp5"}
cp7 = 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:AddCommandPost(cp7)
conquest:Start()
SetUberMode(1);[/code]