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.
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.
Re: 2 Questions
Posted: Wed Jul 16, 2014 4:52 pm
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.
Re: 2 Questions
Posted: Wed Jul 16, 2014 5:50 pm
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
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.
Re: 2 Questions
Posted: Thu Jul 17, 2014 2:42 pm
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.
Re: 2 Questions
Posted: Thu Jul 17, 2014 2:47 pm
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.
Re: 2 Questions
Posted: Thu Jul 17, 2014 3:15 pm
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.
Re: 2 Questions
Posted: Thu Jul 17, 2014 3:45 pm
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?
Re: 2 Questions
Posted: Thu Jul 17, 2014 4:11 pm
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.
Re: 2 Questions
Posted: Thu Jul 17, 2014 5:10 pm
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)
-- 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)