• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Voting trigger

Status
Not open for further replies.
Level 3
Joined
Aug 14, 2006
Messages
29
Hi there, i'm not that pro at all to this world editor thing. So i decided to go to you guys :D
I want a voting system, but not a kick system, which you can find examples of plenty of places.. Oh well this system must enable the players to choose a boss, in this case a mayor. It should be triggered at start of the game, and when a unit enters a rect. When the player is selected as the mayor, 2 units will change to his ownership.

The other system, will be triggered when a unit enters another rect. It will ask about the mayor will be dismissed. If it passes, the two units ownership will be changed to brown.

And again a system where people can vote for a new mayor, however this cannot be iniated if one guy already own the 2 units (not include to brown ofcause).
I know this is alot to ask for, but any shots in the direct location would help alot :)
Please do not provide me with functions, cause i dont even know how to insert them.. please only gui triggers, els i have to search for a guide aswell :D Thanks guys your tha best! :)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Variables Used:

Votes_Number - Integer, arrayed
Can_Vote - Boolean, arrayed

  • Vote
    • Events
      • Unit - A unit enters Region 1 <gen>
      • Unit - A unit enters Region 2 <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region 1 <gen> contains (Triggering unit)) Equal to True
        • Then - Actions
          • For each (Integer A) from 1 to 11, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Can_Vote[(Player number of (Owner of (Triggering unit)))] Equal to False
                • Then - Actions
                  • Set Votes_Number[1] = (Votes_Number[1] + 1)
                  • Set Can_Vote[(Player number of (Owner of (Triggering unit)))] = True
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Region 2 <gen> contains (Triggering unit)) Equal to True
            • Then - Actions
              • For each (Integer A) from 1 to 11, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Can_Vote[(Player number of (Owner of (Triggering unit)))] Equal to False
                    • Then - Actions
                      • Set Votes_Number[2] = (Votes_Number[2] + 1)
                      • Set Can_Vote[(Player number of (Owner of (Triggering unit)))] = True
                    • Else - Actions
            • Else - Actions
      • -------- continue for all players ... --------

This is a vote system you can use.
You will need to add the actions you want though and conditions.

For example check after some time if one Votes_Number[x] is bigger then all the others and then make that player the mayor.

The "dismissal" system would be the same thing but with "Votes_Number[x] = (Votes_Number[x] - 1)".
 
Status
Not open for further replies.
Top