switching troopers?

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
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

switching troopers?

Post by JawaTrooper »

erm, how do i switch ALL units to CIS units? I've tried doing that in ABC_cmn.lua but the game crashes when i play.


help? :runaway:
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: switching troopers?

Post by Commander_Fett »

So is this for a space map?
User avatar
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

Re: switching troopers?

Post by JawaTrooper »

Commander_Fett wrote:So is this for a space map?
yes
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: switching troopers?

Post by AQT »

What did you do exactly? Post any error logs you may have.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: switching troopers?

Post by [RDH]Zerted »

1) Edit the ReadDataFile section of your lua to only read in the units you plan to use.
2) Change the SetupTeams section of your lua to only use the units you want.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: switching troopers?

Post by Fiodis »

If you do what Zerted said, it will work but I think it's worth mentioning that the sounds would be off. You'd have to take some sound lines from a CW script for the CIS side and paste them over your ALL sound lines.

I think.
User avatar
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

Re: switching troopers?

Post by JawaTrooper »

[RDH]Zerted wrote:1) Edit the ReadDataFile section of your lua to only read in the units you plan to use.
2) Change the SetupTeams section of your lua to only use the units you want.
sorry, where are those scripts located? I can't find them :(
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: switching troopers?

Post by Fiodis »

data***/Common/Scripts/***, then pick ***c_con.LUA or ***g_con.LUA. Con stands for conquest, c and g for the two eras, pick which one you want to modify.
User avatar
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

Re: switching troopers?

Post by JawaTrooper »

ok here's what I did...
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPA9 - Naboo
-- Common script that shares all setup information
--

ScriptCB_DoFile("setup_teams")

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

function SetupUnits()
ReadDataFile("SIDE\\all.lvl",
"all_inf_pilot",
"all_inf_marine",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_fly_awing",
"cis_fly_droidfighter_sc",
"all_fly_gunship_sc",
"all_veh_remote_terminal")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_pilot",
"imp_inf_marine",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_veh_remote_terminal")

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 = 32,
reinforcements = -1,
pilot = { "cis_inf_pilot",26},
marine = { "cis_inf_marine",6},
},

imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "imp_inf_pilot",26},
marine = { "imp_inf_marine",6},
}
}
is this right?
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: switching troopers?

Post by Fiodis »

Possibly; there are elements that I don't recognize. What is this "MyTeamConfig = {" code for? Otherwise it looks ok, except for the sounds. Does it work in-game? The MyTeamConfig thing might throw it off.
User avatar
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

Re: switching troopers?

Post by JawaTrooper »

Fiodis wrote:Possibly; there are elements that I don't recognize. What is this "MyTeamConfig = {" code for? Otherwise it looks ok, except for the sounds. Does it work in-game? The MyTeamConfig thing might throw it off.
the myteamconfig was there from the start
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: switching troopers?

Post by Fiodis »

Seriously? I have SetupTeams { instead.
User avatar
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

Re: switching troopers?

Post by JawaTrooper »

Fiodis wrote:Seriously? I have SetupTeams { instead.
no it only says setupteams in a ground map. Space maps say myteamconfig
-_-
Gametoast Staff
Gametoast Staff
Posts: 2678
Joined: Sat May 07, 2005 1:22 pm

Re: switching troopers?

Post by -_- »

The game is trying to find game files "cis_inf_pilot" & "cis_inf_marine". It is referenced in the .lua file but not loaded in the script.

Edit -- As far as I know, "cis_fly_droidfighter_sc" does not exist in all.lvl either.
User avatar
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

Re: switching troopers?

Post by JawaTrooper »

okay should it look like this then?
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPA9 - Naboo
-- Common script that shares all setup information
--

ScriptCB_DoFile("setup_teams")

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

function SetupUnits()
ReadDataFile("SIDE\\all.lvl",
"cis_inf_pilot",
"cis_inf_marine",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_fly_awing",
"cis_fly_droidfighter_sc",
"all_fly_gunship_sc",
"all_veh_remote_terminal")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_pilot",
"imp_inf_marine",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_veh_remote_terminal")

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 = 32,
reinforcements = -1,
pilot = { "cis_inf_pilot",26},
marine = { "cis_inf_marine",6},
},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "imp_inf_pilot",26},
marine = { "imp_inf_marine",6},
}
}
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: switching troopers?

Post by AQT »

"cis_inf_pilot" and "cis_inf_marine" don't exist in all.lvl but rather cis.lvl.
User avatar
JawaTrooper
Private First Class
Posts: 79
Joined: Mon Jan 26, 2009 8:35 pm

Re: switching troopers?

Post by JawaTrooper »

AQT wrote:"cis_inf_pilot" and "cis_inf_marine" don't exist in all.lvl but rather cis.lvl.
so your saying i should just switch the all.lvl with cis.lvl?
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: switching troopers?

Post by Commander_Fett »

@-_-Yes, cis_fly_droidfighter_sc is the correct name.
You'd set up the LUA like this:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPA9 - Naboo
-- Common script that shares all setup information
--

ScriptCB_DoFile("setup_teams")

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

function SetupUnits()

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_pilot",
"cis_inf_marine",
"cis_fly_droidfighter_sc")


ReadDataFile("SIDE\\all.lvl",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_fly_awing",
"all_fly_gunship_sc",
"all_veh_remote_terminal")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_pilot",
"imp_inf_marine",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_veh_remote_terminal")

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 = 32,
reinforcements = -1,
pilot = { "cis_inf_pilot",26},
marine = { "cis_inf_marine",6},
},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "imp_inf_pilot",26},
marine = { "imp_inf_marine",6},
}
}
Also, you'd have to edit the vehicle spawns in the map to read cis_fly_droidfighter_sc instead of the xwing/whatever.
Hidden/Spoiler:
note about sides-
sides .lvl files contain everything in the side, units, vehicles, etc. You just have to read these like
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_rifleman",
"rep_inf_engineer)
in the LUA, then set the teams up down below with the correct units. You HAVE to read the unit from the correct side file in order to use it. [/end tip]
Post Reply