Addme.lua Question

Started by RepComm, August 24, 2013, 07:38:41 PM

Previous topic - Next topic
So I was brain storming ideas for a clan training map, that only allows you to play the map when you are on a special dedicated server. I thought; If I delete the lines in the Addme.lua that told the game to add the map to the SP and MP map list, would I still be able to join a server with the map? [spoiler]of course the dedicated server would have a different addme.script that allows for MP, as well as the map LVL file without textures for faster loading[/spoiler]
If it did work, I think it would be a new little trick that DC and tunngle nights for SWBFgamers could have for special occasions and the like.

So I guess the real question is; Does the dedicated (or just pc host) server over-ride the clients addme functions?

August 24, 2013, 08:03:01 PM #1 Last Edit: August 24, 2013, 08:05:16 PM by SleepKiller
Quote from: -RepublicCommando- on August 24, 2013, 07:38:41 PM
So I was brain storming ideas for a clan training map, that only allows you to play the map when you are on a special dedicated server. I thought; If I delete the lines in the Addme.lua that told the game to add the map to the SP and MP map list, would I still be able to join a server with the map? [spoiler]of course the dedicated server would have a different addme.script that allows for MP, as well as the map LVL file without textures for faster loading[/spoiler]
If it did work, I think it would be a new little trick that DC and tunngle nights for SWBFgamers could have for special occasions and the like.

So I guess the real question is; Does the dedicated (or just pc host) server over-ride the clients addme functions?
Since all the addme scripts are executed while the game is starting up. (Not while it is loading a map, when it is starting up for the first time.) The servers one will have absolutely no impact on the clients.

However you can safely remove everything I have highlighted in red from the script. They are the lines that are used to add in the map to Instant Action's select screen. So you can safely remove them and you would only be able to use the map on a server.


-- add the new tat level to the missionlist
local newEntry = { mapluafile = "MOD1", showstr = "MOD MAP 1", side_c = 1, side_a = 1, dnldable = 1, }

-- append it to the sp missionlist table
local n = getn(sp_missionselect_listbox_contents)   
sp_missionselect_listbox_contents[n+1] = newEntry

-- append it to the mp missionlist table
n = getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[n+1] = newEntry


-- associate this mission name with the current downloadable content directory
-- you should list all missions in mission.lvl 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("MOD1","MOD1c",4)
AddDownloadableContent("MOD1","MOD1a",4)

-- all done
newEntry = nil
n = nil


Edit: Split because this is more of a question than a mod idea.