Modding tournaments, lobby, and skirmish?

 

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?

2,592 views 7 replies
Reply #1 Top

Did you generate a new UID for your mod? If not then maybe it conflicts with Sorians mod.

Reply #2 Top

Yes.  Followed the instructions to generate one.

Reply #3 Top

i dont know where i read it but someone said that only ingame changes are allowed. so you cant mod the lobby itself.

Reply #4 Top

Quoting Derog, reply 3
i dont know where i read it but someone said that only ingame changes are allowed. so you cant mod the lobby itself.

Oooooh yeah right... i forgot!

Only in game changes can be made yes. The Mod Manager only works while a game has started. So lobbys, demigod select screens, etc are not affected at all.

There is your answer Peppe. So simple!

Reply #5 Top

Quoting morpheas768, reply 1
Did you generate a new UID for your mod? If not then maybe it conflicts with Sorians mod.

Just an FYI: The UID can be anything, as long as it is unique. When I am making/testing a mod, I usually just type in "test" so that I don't have to bother with a GUID. You could also just use words that are rarely used, etc. There isn't any kind of requirements for it beyond being unique.

Oh, and don't entirely give up on modding the lobby. I've still got my fingers crossed to finding some work around somewhere.

Reply #6 Top

Quoting zechio, reply 5

Quoting morpheas768, reply 1Did you generate a new UID for your mod? If not then maybe it conflicts with Sorians mod.
Just an FYI: The UID can be anything, as long as it is unique. When I am making/testing a mod, I usually just type in "test" so that I don't have to bother with a GUID. You could also just use words that are rarely used, etc. There isn't any kind of requirements for it beyond being unique.

Yes you are right it just needs to be unique. But a word you might use, someone else might use or have used it already, words are not unique.

 

Reply #7 Top

 

I hope for a workaround to mod the front end/lobby as well. 

 

Only other mods i would like to see is a tweak to hard tournaments, so its more like a all hard AI game.  I think poppabaggins has completed that already :P