| 02-17-2004, 05:16 PM | #1 |
Hi how do you make a vote system and which one if best? Dialog, Text or ? |
| 02-17-2004, 06:37 PM | #2 |
Text = easier = not as cool or slick Dialog = hard = very cool and slick so i assume your cool Make 6 variables, 1 dialog window, 2 dialog buttons (1 yes and 1 no), and 3 integers (1 voted yes, 1 voted no, and 1 number of votes) Event: Elapsed time 1 second Conditon: none Action: Create dialog window labled with your question (i.e. do you want to play?) set varible set (dialog window varible) = last created dialog window add button labled yes to last created dialog window set varible (yes button = last created button) add button labled no to last created dialog window set varrible (no button varrible = last created button) Pick all players and show (dialog window verrible here) Next trigger (someone votes yes) Event: Event respeonse: Dialog button (button verrible yes) is pressed Condition: none Event: Set varrible (voted yes) = (voted yes) + 1 Set varrible (number of votes) = (number of votes) + 1 Run trigger (the decision) Next Trigger (someone votes no) Event: Event respeonse: Dialog button (button verrible no) is pressed Condition: none Event: Set varrible (voted no) = voted no + 1 Set varrible (number of votes) = (number of votes) + 1 Run trigger (the decision) Next Trigger (the decision) Event: none Condition: integer comparision varible number votes = number of players matching condition (is playing) {<-slot status comparion} Event: if/then/else If yes votes varrible is greater than or equal to no votes varible do (your action here) other wise do nothing. if/then/else If no votes varible is greater than no votes varible do (your action here) other wise do nothing. No time to check my work. I was working all from memory. But i think you get the jist of it. What i said may not be perfect, but this IS how you do it. GOOD LUCK HAVE FUN!!! Dam i should get some sort of award for that. That was a lot of typing. :D :ggani: 0_o emote_sweat :foot: :mtk: :lch: :guns: :knife: :dance: :abomHUH?: :hm: :whoa2: :no: :ohh: :D ://// :foot: :bgrun: emote_confused :mtk: :guns: :guns: :arch: :infth: :lch: |
| 02-17-2004, 11:08 PM | #3 |
Variables: -Easy = Dialog Button -Normal = Dialog Button -Hard = Dialog Button -NumberVotes = Integer -PlayerNumber = Player Group -Vote = Dialog -VoteEasy = Integer -VoteNormal = Integer -VoteHard = Integer Create Dialog Events: Time - Elapsed game time is 1.00 seconds Actions Set PlayerNumber = (All players matching (((Matching player) slot status) Equal to Is playing)) Player Group - Pick every player in (All players) and do (Dialog - Create a dialog button for Vote labelled Hard) Set Hard = (Last created dialog Button) Player Group - Pick every player in (All players) and do (Dialog - Create a dialog button for Vote labelled Normal) Set Normal = (Last created dialog Button) Player Group - Pick every player in (All players) and do (Dialog - Create a dialog button for Vote labelled Easy) Set Easy = (Last created dialog Button) Dialog - Change the title of Vote to Difficulty: Player Group - Pick every player in (All players) and do (Dialog - Show Vote for (Picked player)) Easy Events Dialog - A dialog button is clicked for Vote Conditions (Clicked dialog button) Equal to Easy Actions Set VoteEasy = (VoteEasy + 1) Set NumberVotes = (NumberVotes + 1) Trigger - Run Decision <gen> (checking conditions) Normal Events Dialog - A dialog button is clicked for Vote Conditions (Clicked dialog button) Equal to Normal Actions Set VoteNormal = (VoteNormal + 1) Set NumberVotes = (NumberVotes + 1) Trigger - Run Decision <gen> (checking conditions) Hard Events Dialog - A dialog button is clicked for Vote Conditions (Clicked dialog button) Equal to Hard Actions Set VoteHard = (VoteHard + 1) Set NumberVotes = (NumberVotes + 1) Trigger - Run Decision <gen> (checking conditions) Decision Conditions NumberVotes Equal to (Number of players in PlayerNumber) Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions VoteEasy Greater than VoteHard VoteEasy Greater than VoteNormal Then - Actions What you wan't to happen Else - Actions Do nothing If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions VoteHard Greater than VoteEasy VoteHard Greater than VoteNormal Then - Actions What you wan't to happen Else - Actions Do nothing If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions VoteNormal Greater than VoteHard VoteNormal Greater than VoteEasy Then - Actions What you wan't to happen Else - Actions Do nothing |
| 02-17-2004, 11:24 PM | #4 | ||||
I would use a Dialog Button Array, as I always want to leave myself room to add more stuff later on. The dialog button array would allow you to start off with say : Easy Normal and Hard, but then later on expand that to Very Easy, Easy, Normal, Hard, Very Hard. And it would cut down on your variables. So Instead of making the dialog button variables, just make a dialog button array, and where you would normally set the last dialog button to a name set it to a number eg - DialogArray(1). Its the same as the Integers, I would make an array where they corrispond to the dialog buttons. Give me like a couple of minutes and I will reply with the triggers. Edit>> Okay here we go. (In advance I pwn j00) :D Variables. (5) Quote:
Triggers (3) The following trigger is the one you edit, just copy and paste start add button to end add button and everything will take care of itself. I have added three there but you can make it two, or eight, or whatever you fancy. Quote:
This just says if a dialog button is clicked, update the array. Quote:
This is the engine of the script, all the caculations and stuff is done here. I have added a quest that states who made the script, if your going to use it just give me credit. If there is a tie in the vote, then it will choose the lower button of the two, normally the hardest. If there is no vote then it will pick a random setting. To tell it what to do once it has picked a setting, just make a new trigger that is run after this one is finished, and do If (szv_votescast(0) is equal to 1 then do : If it is two then do : etc etc etc.... Quote:
|
| 02-18-2004, 01:30 AM | #5 |
AhhHHhhH Overload! Man I dont ever do complicated **** like that.. I guess I shine more at unit balance and ability creation ://// |
| 02-18-2004, 01:40 AM | #6 |
It is extremely easy, I have updated that post with how it works. Basically all you have to do is edit the set variables trigger. Everything else takes care of itself, the engine is not really that complicated, all it does basically is: Shows the dialog. Waits a number of seconds. Hides the dialog for players who did not vote. Checks for the largest score. Then checks if there is no score then to pick a random one. Then decides the winner. Actually Krin if you have MSN add me [email protected] I might have something you will be intrested in. |
