Problem with adding locals

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
fat_walrus

Problem with adding locals

Post by fat_walrus »

Okay, I know I did something worng with my LUA because when I start the level it looks like this:

Image


When ever I push spawn the screen goes black, but you can push the BACK button in the bottome left corner. You can select the top and top-left command posts in the square area, and I don't think you can switch sides after you choose which side you want to be (in this I chose REP and couldn't switch back to CIS)

Here's my LUA:

Code: Select all

--
-- 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;
    Tuskens = 3;
    Jawas = 4;
    --  These variables do not change
    ATT = REP;
    DEF = CIS;
    Tuskens = Tuskens;
    Jawas = Jawas;


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

    EnableSPHeroRules()
    
 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(30)
    SetMaxPlayerFlyHeight (30)
    
    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")

    ReadDataFile("SIDE\\des.lvl",
			"tat_inf_tuskenhunter",
			"tat_inf_tuskenraider",
			"tat_inf_jawa")
                             
                             
    ReadDataFile("SIDE\\tur.lvl", 
    			"tur_bldg_laser",
    			"tur_bldg_tower")          
                             
	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},
		}
	}
     

    --  Tuskens Stats
    SetTeamName (3, "Tuskens")
    AddUnitClass (3, "tat_inf_tuskenhunter", 2, 6)
    AddUnitClass (3, "tat_inf_tuskenraider", 2, 6)
    SetUnitCount (3, 32)
    SetTeamAsEnemy(ATT, 1)
    SetTeamAsEnemy(1, ATT)
    SetTeamAsEnemy(DEF, 2)
    SetTeamAsEnemy(2, DEF)
    SetTeamAsEnemy(Jawas, 4)
    SetTeamAsEnemy(4, Jawas)
    SetReinforcementCount(1, -1)

    --  Jawas Stats
    SetTeamName (4, "Jawas")
    AddUnitClass (4, "tat_inf_jawa", 25)
    SetUnitCount (4, 32)
    SetTeamAsEnemy(ATT, 1)
    SetTeamAsEnemy(1, ATT)
    SetTeamAsEnemy(DEF, 2)
    SetTeamAsEnemy(2, DEF)
    SetTeamAsEnemy(Tuskens, 3)
    SetTeamAsEnemy(3, Tuskens)

    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:LOC\\LOC.lvl", "LOC_conquest")
    ReadDataFile("dc:LOC\\LOC.lvl", "LOC_conquest")
    SetDenseEnvironment("false")
So how do I add both Tuskens and Jawas as locals and on their own team?
Squirrel7Hunter

Post by Squirrel7Hunter »

well for the cp problem, this is in your lua. you dont need to add the names of the 2 cp's you added, they will show up in the map anyway. so just delete the stuff with the arrows , as the the locals, I dont know because I havent gotten them to work for myself.

by they way. check old posts and the FAQ for question that u may have before posting a new thread, some questions like locals for instance , have been asked many times here.


--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) <--
Darth-Derkie
1st Lieutenant
1st Lieutenant
Posts: 453
Joined: Thu Feb 03, 2005 6:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Netherlands

Post by Darth-Derkie »

For the locals:

Do you want the locals to be together in one team or two teams? I don't know if it is possible to add two locals.

To get the locals the spawn, you need to give them an objective.

After conquest:Start()
type this:

AddAIGoal(3, "conquest", 1000)

Or this
AddAIGoal(3, "Deathmatch", 100)

And if you want a 4th side add a line with the number 4, but I think someone said once that the 4th side didn't work.
fat_walrus

Post by fat_walrus »

Oh, I had tried to make 4 teams >.< I didn't know if it worked or not

SH, sorry about that, forgot to look at older topics XD
Kyross

Post by Kyross »

Indeed. In SWBF1, at least, you could have a maximum of 3 sides(including locals). Since there are no shipped levels with four sides, it would stand to reason this has not changed.
Post Reply