Issue addressing time.
I've been attempting to get multiplayer bosses to work but there's a major design flaw that needs to be addressed.
The issue is that the planned feature of VSHA is to have multiplayer bosses (duo bosses or more) especially through the boss modules (
I'm calling subplugins as modules now)
What's stopping me from implementing this feature is that the current way to add multiplayer bosses is by hooking VSHAHook_OnGameMode_BossSetup which is used in this code.
PHP Code:
if (VSHA_OnGameMode_BossSetup() != Plugin_Handled)
{
SetConVarInt(FindConVar("mp_teams_unbalance_limit"), 0);
int boss = -1;
if ( IsClientValid(iNextBossPlayer) ) boss = iNextBossPlayer;
else boss = FindNextBoss(bIsBoss);
if (boss <= 0)
{
CPrintToChatAll("{olive}[VSHA Engine]{default} No Bosses Selected. Need a boss to start.");
hForceRoundStartCheckTimer = CreateTimer(4.8, ForceRoundStartCheckTimer);
return Plugin_Continue;
}
iBossUserID[boss] = GetClientUserId(boss);
bIsBoss[boss] = true;
BossArrayListIndex[boss] = PickBossSpecial(iPresetBoss[boss]);
Storage[boss] = GetBossSubPlugin(hArrayBossSubplugins.Get(BossArrayListIndex[boss]));
VSHA_OnBossSelected(boss);
public int PickBossSpecial(int &select)
{
int pick = -1;
if (select == -1) pick = GetRandomInt( 0, hArrayBossSubplugins.Length-1 ); //GetArraySize(hArrayBossSubplugins)-1 );
else
{
pick = select;
select = -1;
}
//Storage[client] = GetBossSubPlugin(hArrayBossSubplugins.Get(pick)); //GetArrayCell(hArrayBossSubplugins, iBoss[client]));
return pick; //( GetBossSubPlugin(hArrayBossSubplugins.Get(pick)) );
}
as you can see, PickBossSpecial randomly or specially picks a boss module but nothing about multiplayer bosses since PickBossSpecial simply selects a module but, as proven by War3Evo's gamemode non-boss addon module, you can only do multiplayer bosses...
problem with that is that it skips the forward that runs when a boss is found and set.
I've come up with a few solutions to it.
1. have boss modules register the amount of players needed to run the boss and modify PickBossSpecial accordingly.
2. restructure the part of the code to allow the boss modules to add more bosses through its own code once the boss is selected and make both bosses utilize the same boss module index.
Which of the 2 plugins sound better or does someone have a better suggestion?
__________________