Team balancing script

  • Offline night
  • First Blood
  • ***
  • Posts: 96

Team balancing script

« posted: Apr 05, 2018, 07:50 PM »
Hey, i'm using this script: https://pastebin.com/H464g9Ky
Disabled indie team locking. Balancing script does work "sometimes". I get in and see it's throwing me out to smaller group. But mostly it looks like: https://puu.sh/zWU0K/8ce4adba93.png
Any way to fix it?
I want it to balance red/blue only.
Please.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2495

Re: Team balancing script

« Reply #1 posted: Apr 06, 2018, 06:29 PM »
From which file and line is teamBalance.sqf called?

When a script is called very early on join (before the player appears on spawn island), playerSide returns BLUFOR regardless of which team the player actually selected. This is usually fixed by adding waitUntil {!isNull player}; at the top. It may or may not be your issue.
  • Offline night
  • First Blood
  • ***
  • Posts: 96

Re: Team balancing script

« Reply #2 posted: Apr 06, 2018, 08:30 PM »
Calling it from ArmA3_Wasteland.Stratis\client\init.sqf
After
if !(playerSide in [BLUFOR,OPFOR,INDEPENDENT]) exitWith
{
   endMission "LOSER";
};
Shall i add waitUntil {!isNull player}; on top of teamBalance.sqf ?
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2495

Re: Team balancing script

« Reply #3 posted: Apr 06, 2018, 09:46 PM »
Okay, so I re-read the script more closely, all you have to do is set A3W_teamBalance = 1;

If you set A3W_teamBalance = 50, then it means team balance won't activate until the bigger team has reached 50% of total players, like in your screenshot. If you want team balance to be always active, then 1 is sufficient. That script won't activate below 15 total players anyway.
  • Offline night
  • First Blood
  • ***
  • Posts: 96

Re: Team balancing script

« Reply #4 posted: Apr 06, 2018, 11:25 PM »
Set it to 1, now can't join any team except green.
p.s. No, can, but not always.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2495

Re: Team balancing script

« Reply #5 posted: Apr 07, 2018, 12:08 AM »
Ok, try to set A3W_teamBalance = 33;

I just noticed the original author made a math mistake that fucks up everything below 50,
remove abs and keep A3W_teamBalance = 1, that should fix it.
  • Offline night
  • First Blood
  • ***
  • Posts: 96

Re: Team balancing script

« Reply #6 posted: Apr 07, 2018, 01:35 AM »
(_sideCount > (_teamBal/100) * _serverCount)
(_sideCount > (1/100) * lets say 40))
(_sideCount > 0.4)
doesn't sound right?

And remove ABS how?
if (_serverCount >= 15 && (_sideCount > (_teamBal/100) * _serverCount) && (_sideCount-_opposingCount) > 3 ) then{
or
if (_serverCount >= 15 && (_sideCount > (_teamBal/100) * _serverCount)) > 3 ) then{
?
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2495

Re: Team balancing script

« Reply #7 posted: Apr 07, 2018, 01:37 AM »
Just do exactly as I said, remove the word "abs" directly, only 3 letters, nothing more. Keep everything else like before.
  • Offline night
  • First Blood
  • ***
  • Posts: 96

Re: Team balancing script

« Reply #8 posted: Apr 07, 2018, 05:12 PM »
Works, thanks!