How to add custom lobby options via lobbyoptions.lua?

Everything about mods can be found here.

Moderator: Morax

How to add custom lobby options via lobbyoptions.lua?

Postby douglasg14b » 08 Apr 2019, 02:04

I'm trying to add in custom lobby options and can't seem to figure it out.

I've tried the following:

* /lua/ui/lobby/lobbyoptions.lua (doesn't get called)
* /hook/lua/ui/lobby/lobbyoptions.lua (doesn't get called)
* /SCHOOK/lua/ui/lobby/lobbyoptions.lua (doesn't get called)
* /lua/ui/lobbyoptions.lua (doesn't get called)
* /lua/lobbyoptions.lua (doesn't get called)
* /lua/AI/LobbyOptions/lobbyoptions.lua (IS called, but can only add to AIOpts and not globalOpts) (Why does this get called??)
* /lua/LobbyOptions/lobbyoptions.lua (doesn't get called)


Where do I need to put this file for it to be called, and have access to globalOpts? PhantomX puts it under /phantomxhook/lua/ui/lobby/lobbyoptions.lua and it gets called there, how?
User avatar
douglasg14b
Crusader
 
Posts: 21
Joined: 25 Jan 2019, 10:20
Has liked: 2 times
Been liked: 2 times
FAF User Name: Zongrash

Re: How to add custom lobby options via lobbyoptions.lua?

Postby Uveso » 08 Apr 2019, 07:26

douglasg14b wrote:* /lua/AI/LobbyOptions/lobbyoptions.lua (IS called, but can only add to AIOpts and not globalOpts) (Why does this get called??)


This is only for AI mods to add AI options.

You can't change the lobby if you use a normal mod.
A normal mod only works after the lobby, if you start into the gameworld.

You need a .SCD mod to do so. (zip file inside the GAMEDATA folder)
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: How to add custom lobby options via lobbyoptions.lua?

Postby douglasg14b » 08 Apr 2019, 10:18

@Uveso

Thanks for the clarification! Love your AI, I'm actually using your mod as reference for some things... Shame only AI options can be added, but it's better than nothing.

By chance did you use any specific resource for the mod API, or just learn things by browsing source files?
User avatar
douglasg14b
Crusader
 
Posts: 21
Joined: 25 Jan 2019, 10:20
Has liked: 2 times
Been liked: 2 times
FAF User Name: Zongrash

Re: How to add custom lobby options via lobbyoptions.lua?

Postby Uveso » 08 Apr 2019, 10:50

Well i learn while browsing the code.

Here is a link to all commands/functions that are available for programming in SupCom Lua:
https://supcom.fandom.com/wiki/LUADOC_1.5.3599

A short guide for modding (no .scd mods)
https://wiki.faforever.com/index.php?title=Modding

And a good code example for .SCD modding is the mod from Balthazar (BrewLan)
https://github.com/The-Balthazar/BrewLAN/tree/master/gamedata
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest