• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Make lobby menu?

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
In the TFT-editor, if I remember correctly, it was an easy process to make a custom lobby. While people were joining the game, players could choose a categorie to be a part of. And depending on what categorie they choosed, they started with different units etc.

For example:

Hordes of Mordor
- Player 1 -
- Player 2 -

Knights of Rohan
- Player 3 -
- Player 4 -

When the game started Player 1 and Player 2 played as Mordor etc. And people could choose what they wanted to play as. (If the slots were still open.)

I need the same system in my map in SC2, but only with 2 factions. I can´t find out how to do this.

Any clues?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
You give every player a game attribute selection. This game attribute selection contains slot number unique items (only choosable by 1 player each) which corrospond to player slots. You then use a map initialization trigger to properly move players into the correct slots (changing colour and unit ownership).
 
Level 10
Joined
Nov 5, 2008
Messages
536
You give every player a game attribute selection. This game attribute selection contains slot number unique items (only choosable by 1 player each) which corrospond to player slots. You then use a map initialization trigger to properly move players into the correct slots (changing colour and unit ownership).

Oh.. I don´t understand. :cry:
 
Why not have them vote on the mode to be selected? Just create a menu (dialog with some labels and buttons) that shows on map load (or map init, you can make dialogs show on map init) and have each option there. Use something like my script here to decide which one has been voted upon (look at the function at the top of the script called gf_SelectVote:

JASS:
int gf_SelectVote (int lp_optionsCount) {
    int     lv_i;
    int     lv_i2;
    int   lv_picked;
    while(lv_i <= lp_optionsCount) {
        if (lv_i2 < gv_votesFor[lv_i]) {         // If the current option being evaluated has more votes than
            lv_i2 = gv_votesFor[lv_i];           // the previous selected one, select the current option.
            lv_picked = lv_i;
        } else if (lv_i2 == gv_votesFor[lv_i]) { // If two options being evaluated are tied, pick at random.
            if (RandomInt(0, 1) == 0) {
                lv_picked = lv_i;
            }
        }
        DebugMsg("Option (" + IntToString(lv_i) + ") has " + IntToString(gv_votesFor[lv_i]) + " votes");
        lv_i += 1;
    }
    return lv_picked;
}

//--------------------------------------------------------------------------------------------------
// Tally up the votes when they're ready or the timer has expired and select an option.
//--------------------------------------------------------------------------------------------------
bool gt_onVote_Func (bool testConds, bool runActions) {
    int lv_modeSelected;
    if (gv_votingOn == "Game Mode") {
        lv_modeSelected = gf_SelectVote(5);
        DebugMsg("Vote Selected: " + IntToString(lv_modeSelected));
        if (lv_modeSelected == 1) { // Team Deathmatch
            gv_gameMode = "Team Deathmatch";
            DebugMsg("Deathmatch Selected!");
            gf_SetUpGame(1);
        } else if (lv_modeSelected == 3) { // Survival
            gv_gameMode = "Survival";
            DebugMsg("Survival Selected!");
            gf_SetUpGame(3);
        } else if (lv_modeSelected == 5) { // Zerg vs Marines
            gv_gameMode = "Zerg vs Marines";
            DebugMsg("Zerg vs Marines Selected!");
            gf_SetUpGame(5);
        } else {
            gv_gameMode = "Team Deathmatch";
            DebugMsg("Mode selected not yet implemented. Defaulting to Team Deathmatch.");
            gf_SetUpGame(1);
        }
        UISetWorldVisible(gv_allPlayers, true);
        TriggerEnable(gt_AI, true);
        DialogSetVisible(gv_configureGameMenuDialog, gv_allPlayers, false);
        UISetFrameVisible(gv_allPlayers, 0, true);
        UnitPauseAll(false);
    }
    gf_ShowDialogs(true);
    DialogControlSetPropertyAsText(gv_teamScoreLabel[2], c_triggerControlPropertyText, gv_allPlayers, StringToText("<s val=\"ModCenterSize20Bold\">" + gv_gameMode));
    return true;
}

//--------------------------------------------------------------------------------------------------
// Register Vote Timer Event
void gt_onVote_Init () {
    TriggerAddEventTimer(gt_onVote, gv_voteTimer);
}
//--------------------------------------------------------------------------------------------------
 
Status
Not open for further replies.
Top