Page 1 of 1

Addme.lua headaches (Solved)

Posted: Fri Dec 12, 2008 8:37 pm
by elfie
Ok, so I know there was just a topic on this and I followed the instructions on the topic and have seriously tried everything I know how to and have waited as long as I could to come to ask for help but sadly I must. If anyone is familiar with my WIP: KOTOR Telos the mandalorian Wars, then you know I have been trying to add a new game mode recently. I have gotten that game mode localized so the new name shows up in the loadscreen, which is a plus, but it didn't show up in the Insant action menu like I set it to, it just shows up as XL, which was the default name. The description for the game mode didn't change either like it was supposed to. I also changed the addme.lua so the era name would change from Clone Wars to Mandalorian Wars, but sadly that didn't change either. And before anyone asks, yes I have the unofficial V3.0 patch. I thank everyone very much for helping me on my last topic, and I hope this will just be an easy error to fix. Here is my addme.lua:
Hidden/Spoiler:
[code]--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 = "TEL%s_%s",
era_g = 1,
era_c = 1,
mode_xl_g = 1,
mode_con_c = 1,
change = {
era_c = { name="Mandalorian Wars" },
mode_xl = { name="Headquarters", about="Headquarters Defend your headquarters while attempting to destroy your enemy's" },
},
}

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("TEL","TELg_xl",4)
AddDownloadableContent("TEL","TELc_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TEL\\data\\_LVL_PC\\core.lvl")
[/code]
Thanks again in advanced! :D

Re: Addme.lua headaches

Posted: Fri Dec 12, 2008 9:42 pm
by Deviss
i don't understand, do you want add a new mode or era??

Re: Addme.lua headaches

Posted: Fri Dec 12, 2008 10:09 pm
by [RDH]Zerted
Do you have the v1.3 patch from Filefront (r117) or the one from the swbf1 pack (r83?)?

Re: Addme.lua headaches

Posted: Fri Dec 12, 2008 10:52 pm
by elfie
@REX- No I want to localize it.
[RDH]Zerted wrote:Do you have the v1.3 patch from Filefront (r117) or the one from the swbf1 pack (r83?)?
The one from the SWBF1 pack. Why, is there a difference?

Re: Addme.lua headaches

Posted: Sat Dec 13, 2008 7:22 pm
by [RDH]Zerted
Yes, r83 doesn't support changing the era/mode names and descriptions, but r117 does. You can think of the revision numbers as version numbers. The final v1.3 patch version is 117, but the pack only has version 83.

Enough other mods/maps required the v1.3 changes, so I made a bunch of releases of the patch throughout the Summer instead of a single, finished release during the Fall.

Download and install the v1.3 patch r117 lite from filefront.

Re: Addme.lua headaches

Posted: Sun Dec 14, 2008 2:42 pm
by elfie
thanks, zerted, now it works. And its ausome too, look:
Hidden/Spoiler:
Image
:D

Re: Addme.lua headaches

Posted: Sun Dec 14, 2008 3:38 pm
by [RDH]Zerted
good