I was trying to do what i think is a simple edit of the single player skirmish game lobby to change what the autofill button does to fill all 'hard' opponents instead of 'normal'.
I extracted lobby.lua and created a mod using Sorian's example mod. Placing the LUA in the hook/lua/ui/lobby folder.
Everything looks right to me, but I can't get any changes to register. Here is the relevent section of the lobby.lau
function p_map.btnAutoFillSlots.OnClick(btnself)
import('/lua/singleplayerlaunch.lua').RepopulateNames()
for i = 1, LobbyComm.maxPlayerSlots do
if not self.GUI.slots[i].closed and not self.gameInfo.PlayerOptions[i] then
#Play Sound AI Demigod selected PLACEHOLDER
PlaySound( 'Forge/UI/snd_ui_generic_menu_click' )
local AIName = import('/lua/singleplayerlaunch.lua').GetRandomName()
local lobbyName = LOCF('<LOC lobui_0517>AI: %s (Hard Test)', AIName)
local randomHero = HeroUtil.GetRandomHero(self.gameInfo)
self:HostAddPlayerImpl(i, self.hostID, AIName, false, randomHero, lobbyName)
self.gameInfo.PlayerOptions[i].Difficulty = 3
end
end
end
My changes highlighted.
I looked at the add hard AI from the drop down to change the values above:
elseif key == 'addhardai' then
diff = 3
AIName = import('/lua/singleplayerlaunch.lua').GetRandomName()
lobbyName = LOCF('<LOC lobui_0517>AI: %s (Hard)', AIName)
... END
I am wondering if the game always uses its internal version of this file, so the game lobby cannot be modded?