"XL Conquest", or Making "units = " Work

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
User avatar
Broadus
Second Lance Corporal
Second Lance Corporal
Posts: 110
Joined: Thu Sep 21, 2006 1:23 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

"XL Conquest", or Making "units = " Work

Post by Broadus »

I'd like to take non-XL gametypes, such as Conquest and Capture-the-Flag, and make it so that the "units = " feature works like it does in XL and the Campaign, where whatever is entered determines how many AI are on each team.
I've never played a CTF map where "units = " did anything, but I've played quite a number of Conquest maps where "units = " would determine the amount of AI per team. Are there any specific lines that make "units = " do anything, while maintaing the Conquest gametype (and possibly CTF)?
I'm modding for the PSP, so having a literal XL gametype won't work.
So, let's say I want to take Hoth Conquest and make the "units = " determine the amount of AI on a team. How would I go about doing that?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

RE: "XL Conquest", or Making "units = "

Post by Teancum »

Somewhere in the functionScriptInit() section, before SetupTeams, add this line:

SetUberMode(1)

Also -- This may/may not work. UberMode (which allows for more than the default number of AI per team) might have been removed for PSP due to memory limitations on it.
User avatar
Broadus
Second Lance Corporal
Second Lance Corporal
Posts: 110
Joined: Thu Sep 21, 2006 1:23 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

RE: "XL Conquest", or Making "units = "

Post by Broadus »

Too true... When putting SetUberMode(1) outside of "function ScriptInit()", the gametype will change to Conquest style (no matter the original gametype), and no AI spawn.
If I place it in "function ScriptInit()", it simply crashes the game. I tested it on both the PC and the PSP. It worked on the PC but didn't work on the PSP, so it's terribly clear that Uber Mode doesn't work like it's supposed to on the PSP.

HOWEVER
HOLY CRAPPING CRACKER JACKS
I set my Conquest test level so that it'd think that it's a campaign level. All I did was was add this line in after "function ScriptPostLoad"; "ScriptCB_SetGameRules("campaign")"
As a fool-proof test, I set the AI per team to one. When I started up the level, SIXTEEN guys per team (the amount I had specified) spawned! And it ran great!

Well, thanks for the help, Teancum. Though your particular suggestion didn't work out for the PSP, it still worked on the PC, which I've also been wanting to do some mission.lvl-modifying of.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

RE: "XL Conquest", or Making "units = "

Post by Teancum »

Concord Dawn Conquest lua wrote: --
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

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

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



--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: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")


SetUberMode(1)
SetMaxFlyHeight(160)
SetMaxPlayerFlyHeight(160)


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\\hot.lvl;hot1gcw")
ReadDataFile("sound\\RE3.lvl;RE3gcw")
ReadDataFile("sound\\chainisle.lvl;chainislegcw")

ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_hansolo_tat",
"all_fly_snowspeeder")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_walk_atat",
"imp_fly_tiefighter",
"imp_hover_fightertank",
"imp_fly_destroyer_dome")

ReadDataFile("SIDE\\cis.lvl",
"cis_hero_jangofett")

ReadDataFile("SIDE\\vehicles.lvl",
"all_fly_xwing",
"all_hover_combatspeeder_bf1",
"all_hover_hovernaut",
"imp_fly_tiefighter")

ReadDataFile("SIDE\\infantry.lvl",
"all_inf_recon",
"all_inf_commander",
"imp_inf_recon",
"imp_inf_commander_grey",
"imp_inf_commando",
"all_inf_specialops")

SetupTeams{
all = {
team = ALL,
units = 60,
reinforcements = 550,
soldier = { "all_inf_rifleman",9, 50},
assault = { "all_inf_rocketeer",1,25},
engineer = { "all_inf_engineer",1,25},
sniper = { "all_inf_sniper",1,25},
officer = { "all_inf_officer",1,25},
special = { "all_inf_wookiee",1,25},
},
imp = {
team = IMP,
units = 60,
reinforcements = 550,
soldier = { "imp_inf_rifleman",9, 50},
assault = { "imp_inf_rocketeer",1,25},
engineer = { "imp_inf_engineer",1,25},
sniper = { "imp_inf_sniper",1,25},
officer = { "imp_inf_officer",1,25},
special = { "imp_inf_dark_trooper",1,25},
},
}
AddUnitClass(ALL,"all_inf_recon", 1,3)
AddUnitClass(ALL, "all_inf_specialops",1,2)
AddUnitClass(ALL,"all_inf_commander",1,1)
AddUnitClass(IMP,"imp_inf_recon",1,3)
AddUnitClass(IMP, "imp_inf_commando",1,2)
AddUnitClass(IMP,"imp_inf_commander_grey",1,1)

SetHeroClass(ALL, "all_hero_hansolo_tat")
SetHeroClass(IMP, "imp_hero_bobafett")
Of course that's just a snippet, but I know that it works on PC as I have about 20 levels in the pack that use it.
User avatar
Broadus
Second Lance Corporal
Second Lance Corporal
Posts: 110
Joined: Thu Sep 21, 2006 1:23 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

RE: "XL Conquest", or Making "units = "

Post by Broadus »

Um... Yeah. I said that using SetUberMode worked on the PC, but not on the PSP.
Post Reply