| 06-27-2004, 08:17 AM | #1 |
I'm making a map, but I need a voting system that works through a dialog. I know how to make a dialog and stuff but don't know how to make it that the one with the most votes gets chosen, it would be thankful if someone could tell me how to make a vote system with a dialog with 3 / 4 buttons. |
| 06-27-2004, 11:44 AM | #2 |
I've made one in my KOTH map with 4 options (4 buttons), and it's working rather good, but i've been fiddling with the draw system aka what happens when a vote ends in a draw, it just won't work. But i'll give you an idea on how to make this, although i'm not the greatest mapper of all times :\ What you need to do is: Create an integer variable for each button you have, call them EasyGame, NormalGame, HardGame .. for instance. Then the basic idea of this is to add 1 to the respective integer once the button is clicked: Code:
Events: Dialog: A dialog button is clicked for DialogVariableName (you need to define a dialog variable) Conditions: None Actions: If (Clicked dialog button Equal to ButtonVariableName[0]) Then do (Set EasyGame = (EasyGame + 1) Else (Do nothing) Now this is the basic vote function, just repeat this proces for the other buttons (vote options). But now you need something to count the votes, the event of this trigger could be a timed trigger, or you could just trigger it when everyone has voted. I'll use the timed one in this example: Code:
Events: Time - Elapsed game time is 15.00 seconds
Conditions: none
Actions: If (EasyGame Greater Than NormalGame)
(EasyGame Greater Than HardGame)
Then (Trigger - Run EasyGameStart <gen> (ignoring conditions))
(Game - Display To (All players) The text: The majority
voted Easy Game)
Else (Do Nothing)Then you have your basic vote system, just repeat this process with the respective variable names, the next "if then else" function would look like this: Code:
If (NormalGame Greater Than EasyGame)
(NormalGame Greater Than HardGame)
Then (Trigger - Run NormalGameStart <gen> (ignoring conditions))
(Game - Display To (All players) The text: The majority
voted Normal Game)
Else (Do Nothing)And there you have it, hope i made myself understandable, if not, feel free to ask me questions. Don't ask me about the Draw function though, i'm having a hard time figuring that out, but it'll come. I hope that you could use my humble advice :D |
| 06-28-2004, 06:12 AM | #3 |
Hey thx I got it working,t oo bad about the tie thing :(. I'll think of something =). I think I gave you some rep points, but I'm not sure cos I'm new XD. |
