gemidyne / microtf2

A custom gamemode for Team Fortress 2 - Players compete against each other to get the most points by playing a series of rapid fire microgames in order to win the round!
https://www.gemidyne.com/projects/microtf2
GNU General Public License v2.0
30 stars 16 forks source link

Any possibility v3.0.1 work with UMC instead Mapchooser? #159

Closed EduardoKdinho closed 3 years ago

EduardoKdinho commented 4 years ago

Hi, we don't use mapchooser on our server (multimods), we are using UMC + 20 rounds cvar (UMC open votes in the 10th round). We work with timelimit in each mode (45min). We made the change in the "microtf2mapchooser" plugin to run UMC (after 10 rounds the instant vote opens // as sm_umc_mapvote 0), but the main plugin forces the mapchooser and breaks the gamemode (mainly round 3***) . Is there a possibility to work with UMC or just mapchooser? or none of them at all ?

We are using :

#pragma semicolon 1
#define REQUIRE_PLUGIN

#include <sourcemod>
#include <sdktools>
#include <warioware>
#include <umc-core>

#pragma newdecls required

public Plugin myinfo = 
{
    name = "WarioWare REDUX: SourceMod Mapchooser Integration",
    author = "Gemidyne Softworks / Team WarioWare",
    description = "SourceMod Mapchooser Plugin integration",
    version = "1.0",
    url = "https://www.gemidyne.com/"
}

public void WarioWare_Intermission_StartMapVote()
{
    ServerCommand("sm_umc_mapvote 0");
}

public bool WarioWare_Intermission_HasMapVoteEnded()
{
    return !UMC_IsVoteInProgress("core");
}
safalin1 commented 4 years ago

I am not sure I understand your question - the code you pasted above should work. The HasMapVoteEnded check should return true if the map vote in UMC has ended. By breaks the gamemode, do you mean it stops and stays on the intermission phase?

If this is what you mean - it sounds like the code you have in WarioWare_Intermission_HasMapVoteEnded is not returning true to say that the map vote is done, and the gamemode can continue.

I would need to look into how UMC works to figure out what is going wrong - but do you know if there is another way of triggering UMC other than ServerCommand? Perhaps a native method offers the same functionality? (I am wondering if because its triggered by a ServerCommand, UMC_IsVoteInProgress("core") doesn't actually think a vote is active...)

However, I also wanted to note that you can turn off the intermission sequence in the gamemode (this does the WarioWare_Intermission_StartMapVote() call). With the "mtf2_intermission_enabled" convar set to 0 this means WarioWare will not attempt to start a mapvote at any time - it would be up to UMC to call a vote.

safalin1 commented 4 years ago

I am having another look at this one - I think to use the command sm_umc_mapvote you need to also have that UMC plugin loaded. Maybe that is the issue you were encountering? (I haven't had a chance to test UMC yet)

safalin1 commented 3 years ago

https://github.com/gemidyne/microtf2/issues/187 might work to fix this issue too (?)

It would mean that your mapchooser would need to be set based on the timelimit to run the vote before the mp_timelimit is reached. The gamemode would not do anything with mapvotes.

safalin1 commented 3 years ago

We are going to close this one for now - we recommend using the mp_timelimit mode of the gamemode to work around this.