Page 1 of 1

Games Maps?

Posted: Fri Jun 05, 2009 2:32 am
by yukisuna
is it possible to use a shipped .lua file to make side-mods? (not making a new map, so the mission.lvl uses the games map's?


EDIT: 3# i were thinking mostly of mygeeto, but also about if it works... and what i meant with "mission.lvl uses the games map's" were if i could just make a mission.lvl that can replace the game's mission.lvl!

Re: Games Maps?

Posted: Fri Jun 05, 2009 9:41 am
by 501st_commander
maybe,
but you will have to have all the sides they have or replace them with your own.

Re: Games Maps?

Posted: Fri Jun 05, 2009 11:39 am
by Teancum
So basically you want to make a "map" that uses the shipped map, but your sides? Yeah, that's totally possible. I'm not at home now, but if I get a chance (packing for a big move this week) I'll try and help. It really only involves a few minor changes. What map are you wanting to use?

Re: Games Maps?

Posted: Fri Jun 05, 2009 1:58 pm
by Frisbeetarian
If you look at the top of every single addme.lua, you'll notice a function mentioned and described called AddNewGameModes. You use this function to tell the game to open up a slot an a preexisting map and then with the AddDownloadableContent function, you assign whatever your script name is to the map you wish it to be on. If you don't do the first part and only do the second, then a duplicate map will show up.

For example, I can create a new world called ABC. In data_ABC, I find the script ABCg_con.lua. Here, to make sure that things like death regions are included, copy the contents of the Lua file for whichever map and game mode you are trying to replicate into your Lua file. For example, copying Kamino, I take kam1g_con.lua, copy everything inside, and paste it on top of everything in ABCg_con.lua, deleting the original contents of ABCg_con.lua. Now I change the sides to whatever I want them to be in the Lua script. The last thing to change is the addme.lua which should look like this:

Code: Select all

AddNewGameModes(sp_missionselect_listbox_contents, "nab1%s_%s", {era_g = 1, mode_con2_g = 1})
AddNewGameModes(mp_missionselect_listbox_contents, "nab2%s_%s",	{era_g = 1, mode_con2_g = 1})

AddDownloadableContent("KAM1","ABCg_con",4)
This adds the mode to both single player and multi player. Notice I used the mode name "con2" since I don't want to overwrite (would it overwrite the original?) the original game mode. Now "con2" doesn't exist as a mode, so you'll want to make it a mode that does exist, or see Zerted's documentation for the 1.3 patch to make your own mode.

Mind you, I haven't checked this myself to make sure it works, but I'm fairly sure it's correct and not at my modding computer for the moment. If you're wondering, it's the same process that ARC_commander used to create BFX and if you care to search the site, you'll find his addme.lua posted somewhere.