2 Questions [Solved]

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
Hill400
Private First Class
Posts: 81
Joined: Wed Jun 11, 2014 4:50 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: New England, USA

2 Questions [Solved]

Post by Hill400 »

Hello,
I have 2 questions that should be simple for most, but I can't seem to figure them out for the life of me.
1) How do you change a class' name?
2) How to change heroes on existing maps by modifying the lua files?
I'm sorry if I'm being a nuisance by posting this. Thanks for any help anyone can lend.
Last edited by Hill400 on Thu Jul 17, 2014 4:11 pm, edited 1 time in total.
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: 2 Questions

Post by MileHighGuy »

1. http://www.gametoast.com/viewtopic.php?t=971

2. look at the side's .req file. See the name of the hero you want. Load that hero with the side like any other unit in the lua. Change the name of the addheroclass part of the lua to your hero.
Hill400
Private First Class
Posts: 81
Joined: Wed Jun 11, 2014 4:50 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: New England, USA

Re: 2 Questions

Post by Hill400 »

1) Great- thanks!
2) I'm still a little confused (sorry), let's say for example you want to change the hero from Pilot Luke to Han Solo (on shipped Hoth). How would go about doing that? Which file(s) or folder(s) would you move and/or edit? Thanks once again, I really appreciate the help.
User avatar
SpartanA259
Captain
Captain
Posts: 498
Joined: Tue Jul 19, 2011 2:47 pm
Projects :: Orion City
xbox live or psn: Steam: [404] Ash
Location: New Reno, Nevada

Re: 2 Questions

Post by SpartanA259 »

*** = Three Letter Map ID
I am assuming you have set the map up so you are editing the stock Hoth map.
In BF2_ModTools/assets/sides you'd copy the folder named "all" and paste it in your maps sides folder in BF2_ModTools/data_***/sides.
Next in the "all" folder you would open up the all.req and look for the unit named "all_hero_hansolo_tat".
In your LUA located in BF2_ModTools/data_***/Common/scripts/*** open up the the hot1g_con file.
Scroll a bit down and you'll see
Hidden/Spoiler:
ReadDataFile("SIDE\\all.lvl",
"all_fly_snowspeeder",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_engineer_snow",
"all_inf_sniper_snow",
"all_inf_officer_snow",
"all_hero_luke_pilot",
"all_inf_wookiee_snow",
"all_walk_tauntaun")
Change it to this:
Hidden/Spoiler:
ReadDataFile("SIDE\\all.lvl",
"all_fly_snowspeeder",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_engineer_snow",
"all_inf_sniper_snow",
"all_inf_officer_snow",
"all_hero_hansolo_tat",
"all_inf_wookiee_snow",
"all_walk_tauntaun")
Then change this line:
Hidden/Spoiler:
--Setting up Heros--

SetHeroClass(IMP, "imp_hero_darthvader")
SetHeroClass(ALL, "all_hero_luke_pilot")
To this
Hidden/Spoiler:
--Setting up Heros--

SetHeroClass(IMP, "imp_hero_darthvader")
SetHeroClass(ALL, "all_hero_hansolo_tat")
Save then munge
Hopefully that helps.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: 2 Questions

Post by razac920 »

You don't need to copy the folder "all" to do that, just make any map, and replace the contents of one of your LUA files you get, for example ***g_con, etc. with the hot1g_con.lua contents from assets, then modify it however you want.
Hill400
Private First Class
Posts: 81
Joined: Wed Jun 11, 2014 4:50 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: New England, USA

Re: 2 Questions

Post by Hill400 »

Thank you all for the help but I must not be following your directions properly, because I can't seem to get it to work. I took hot1g_con.lua from assets/scripts/hot and moved it to data_***/common/scripts/***, made the correct changes to the script, and see no changes in the game when it's all munged and I try to run it.
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: 2 Questions

Post by MileHighGuy »

it has to be in YOUR map's script. The script you copied will not be read. You can rename the hot1g_con to your map's script and it will work.
Hill400
Private First Class
Posts: 81
Joined: Wed Jun 11, 2014 4:50 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: New England, USA

Re: 2 Questions

Post by Hill400 »

Ok, thanks again. Out of curiosity, how do modders change it so that they can have multiple changes to multiple luas in their packs? If it's too complex don't bother explaining it to me, but thanks anyway.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: 2 Questions

Post by Marth8880 »

Hill400 wrote:how do modders change it so that they can have multiple changes to multiple luas in their packs?
What do you mean?
Hill400
Private First Class
Posts: 81
Joined: Wed Jun 11, 2014 4:50 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: New England, USA

Re: 2 Questions

Post by Hill400 »

Don't worry about it, I'm having issues explaining it myself. Frankly, it doesn't matter that much to me and I'd be wasting your time if I tried to explain it. Thanks for your concern though.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: 2 Questions

Post by commanderawesome »

MileHighGuy wrote:it has to be in YOUR map's script. The script you copied will not be read. You can rename the hot1g_con to your map's script and it will work.
No it doesn't, I did that with my Local Wars mod. You just have to load the script in the addme.lua, like so:
Hidden/Spoiler:
--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end



--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "***%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("***","***g_con",4)
AddDownloadableContent("***","***c_con",4)
AddDownloadableContent("hot1","hot1g_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\***\\data\\_LVL_PC\\core.lvl")
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: 2 Questions [Solved]

Post by MileHighGuy »

I know that is true, I was just making it easy for him.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: 2 Questions [Solved]

Post by commanderawesome »

Oh, ok.
Post Reply