Forged Alliance Forever Forged Alliance Forever Forums 2018-03-13T20:44:52+02:00 /feed.php?f=41&t=15996 2018-03-13T20:44:52+02:00 2018-03-13T20:44:52+02:00 /viewtopic.php?t=15996&p=161742#p161742 <![CDATA[Balanced lobby mode + need help with adding functions]]> example.png
Installation
To install it you need to place the file lobby.lua into
Code:
C:\ProgramData\FAForever\gamedata\lua.nx2\lua\ui\lobby\
You can open lua.nx2 file with winrar. After you include the lobby.lua into the file you need to set file to read-only so FAF doesnt replace it for you.

The function goes trough all possible balance options and selects the one with the minimum diffrence between the rating of 2 teams (using the rating equal to MEAN-3*DEV wich is the same number shown in FAF lobby)
Where i need help
-Right now i have a list of all posible combinations i use but i would love to replace that with a function so it can support 16 players. I already programmed the function in python( which is how i got my list in the first place but i dont know how to write that in lua(also kinda lazy to google everything up)
python code:
Spoiler: show
Code:
lista=[]
for i in range(2**12-1):
    try:
        lista[len(bin(i))-3].append(list(map(int,list(bin(i)[2:]))))
    except:
        lista.append([])

-I would like to make it so that if you are host and write /bal or /balance it automatcily moves people to spots and balances game. The problem i have is that i dont know which spots belong to a certian team so i dont know to which spots to move team 1 and team 2
-I would like for the function to tell for how much the % balance will be better which I included in my code but had to comment it out as the resoult was always -1

Thanks to Washy for help with coding

Statistics: Posted by Green_Nymph — 13 Mar 2018, 20:44


]]>