Generic Team Voting

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Generic Team Voting

Post by Aero »

http://sc2edit.net/jass-triggers-f4/nev ... t4383.html

I already did one in JASS.
It's really easy to implement so maybe you could consider not using GUI.
TechGeek001
Member
Posts: 50
Joined: December 29th, 2007, 7:34 am

Re: Generic Team Voting

Post by TechGeek001 »

This works, and is based on CrackUps' original system:

Code: Select all

NukeVote
    Events
        Player - Player 1 (Red) types a chat message containing -lag control as An exact match
        Player - Player 2 (Blue) types a chat message containing -lag control as An exact match
        Player - Player 3 (Teal) types a chat message containing -lag control as An exact match
        Player - Player 4 (Purple) types a chat message containing -lag control as An exact match
        Player - Player 5 (Yellow) types a chat message containing -lag control as An exact match
        Player - Player 6 (Orange) types a chat message containing -lag control as An exact match
        Player - Player 7 (Green) types a chat message containing -lag control as An exact match
        Player - Player 8 (Pink) types a chat message containing -lag control as An exact match
        Player - Player 9 (Gray) types a chat message containing -lag control as An exact match
        Player - Player 10 (Light Blue) types a chat message containing -lag control as An exact match
    Conditions
    Actions
        Set Votes[1] = 0
        Dialog - Clear VoteDialog[1]
        Dialog - Change the title of VoteDialog[1] to Initiate Lag Contro...
        Dialog - Create a dialog button for VoteDialog[1] labelled Yes
        Set VoteButtons[1] = (Last created dialog Button)
        Dialog - Create a dialog button for VoteDialog[1] labelled No
        Set VoteButtons[2] = (Last created dialog Button)
        Dialog - Show VoteDialog[1] for Player 1 (Red)
        Dialog - Show VoteDialog[1] for Player 2 (Blue)
        Dialog - Show VoteDialog[1] for Player 3 (Teal)
        Dialog - Show VoteDialog[1] for Player 4 (Purple)
        Dialog - Show VoteDialog[1] for Player 5 (Yellow)
        Dialog - Show VoteDialog[1] for Player 6 (Orange)
        Dialog - Show VoteDialog[1] for Player 7 (Green)
        Dialog - Show VoteDialog[1] for Player 8 (Pink)
        Dialog - Show VoteDialog[1] for Player 9 (Gray)
        Dialog - Show VoteDialog[1] for Player 10 (Light Blue)
        Trigger - Turn on Nuke No <gen>
        Trigger - Turn on Nuke Yes <gen>
        Wait 10.00 game-time seconds
        Trigger - Turn on Nuke Check <gen>

Code: Select all

Nuke Yes
    Events
        Dialog - A dialog button is clicked for VoteDialog[1]
    Conditions
        (Clicked dialog button) Equal to VoteButtons[1]
    Actions
        Set Votes[1] = (Votes[1] + 1)

Code: Select all

Nuke No
    Events
        Dialog - A dialog button is clicked for VoteDialog[1]
    Conditions
        (Clicked dialog button) Equal to VoteButtons[2]
    Actions
        Set Votes[1] = (Votes[1] - 1)

Code: Select all

Nuke Check
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Votes[1] Greater than 0
            Then - Actions
                Game - Display to (All players) for 10.00 seconds the text: |c0080ff00Lag Contr...
                Unit Group - Add all units of (Units of type Footman) to nuke
                Unit Group - Add all units of (Units of type Zombie) to nuke
                Unit Group - Pick every unit in nuke and do (Unit - Remove (Picked unit) from the game)
                Trigger - Turn off Nuke Yes <gen>
                Trigger - Turn off Nuke No <gen>
                Set Votes[1] = 0
                Trigger - Turn off (This trigger)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Votes[1] Less than or equal to 0
                    Then - Actions
                        Game - Display to (All players) for 10.00 seconds the text: |c00ff0000Not enoug...
                        Trigger - Turn off Nuke Yes <gen>
                        Trigger - Turn off Nuke No <gen>
                        Set Votes[1] = 0
                        Trigger - Turn off (This trigger)
                    Else - Actions
                        Do nothing
Thanks to all - with a little modification, this works as a perfect GUI-based voting system.

*BTW, JASS scares the shit out of me :D