• 🏆 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!

Dialogue Voting?

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2010
Messages
203
I am wondering how to create a voting system.

I created a dialogue button that says:
Please choose a difficulty
- easy
- medium
- hard

but it only works for player 1 (currently)

Is it possible to create the same dialogue box for all players, allowing them to vote and which ever option gets selected the most would be triggered/enabled? If there is a tie (like 2 votes for easy, 2 votes for hard) it should just select default.

Also, I do not want to allow each player to be on different settings, they all must use the same difficulty

Thanks
 
Last edited:
Level 11
Joined
Jun 2, 2004
Messages
849
Make 3 integer variables, named something like easy_counter medium_counter and hard_counter, and give them an initial value of 0. When someone selects the dialog button, remove the dialog for that player and increment the appropriate integer variable. When everyone's selected something (or a timer runs out, to prevent afk people from ruining the game) compare the number of votes in each integer variable and do whatever.
 
Level 6
Joined
Oct 25, 2010
Messages
203
Thanks!

I havent started working on this yet, was still setting some other things up. I am just starting to learn the WE, but I am getting better at figuring it out :) hopefully I can get this setup later after i finish up a few more things! It can really get confusing with all the crisscrossing triggers I have lol
 
Last edited:
Level 6
Joined
Oct 25, 2010
Messages
203
I'm kind of confused. I'm testing this in single player, which makes it difficult to know if its working.

Make 3 integer variables, named something like easy_counter medium_counter and hard_counter, and give them an initial value of 0. When someone selects the dialog button, remove the dialog for that player and increment the appropriate integer variable.
I made the 3 variables, and set the dialog buttons to add + 1 to each variable, then I set a condition saying: "If X is greater than Y and Z, then run x2" but when I run a test and place a vote, it instantly runs the trigger as if to say "1 is greater than 0" but its weird because its by passing the trigger i setup to count the votes, if I add an "action - display message" it doesnt show up for some reason.

compare the number of votes in each integer variable
I don't really know how to setup a "vote count" system (very newbie here ;))



Edit:
I tried doing: "Game - Integer = (Real((Number of players))" and "Integer = (Players in ((Count Players in Player Group" or "Players Controlled by User" in various ways, but no luck... not really sure why I cant do "X + Y + Z = Number of players" or even just "X = Number of players" ...??
 
Last edited:
Level 6
Joined
Oct 25, 2010
Messages
203
I've spent the past 2 days trying to figure this out, and I think I've almost got it. I was able to get the dialogue voting system working, but it will not count the total number of votes.

If I set a trigger saying something like "If votecount = number of players" or "If votecount = (number of players in (players who are Users))" it ignores the rest of the triggers... if I erase that line then it will work, but only when the timer runs out. I want it to skip/shutoff the timer if all players have voted within the time limit, but this never seems to work for me?
 
Last edited:
Status
Not open for further replies.
Top