Staredit Network

Staredit Network -> UMS Assistance -> Voting System.....
Report, edit, etc...Posted by HA-CurSe on 2004-08-16 at 00:20:11
how do you do a voting system ? O_o for those who dont know what im talking about... lets say 4 people are in the game and 3 go to beacon a and 1 go to beacon b, more are on beacon a sooooo..... beacon a is the one that will bo used but i want it so it works no matter how many people are in the game.

(PS im tired dont diss me if it made no sence wink.gif)
Report, edit, etc...Posted by DT_Battlekruser on 2004-08-16 at 00:24:23
Hmm. Have trigger if P1 thru each voting player brings unit to vote A add 1 deaths for vote A, then kill voter. Then whichever unit has most "votes" is the winner. Ask for tiggers if you need.
Report, edit, etc...Posted by HA-CurSe on 2004-08-16 at 00:31:16
QUOTE(DT_Battlekruser @ Aug 15 2004, 11:24 PM)
Hmm.  Have trigger if P1 thru each voting player brings unit to vote A add 1 deaths for vote A, then kill voter.  Then whichever unit has most "votes" is the winner.  Ask for tiggers if you need.

kk ill try that ^_^ would this also work?

Voters commands the most voter at vote A


w/e w/e w/e w/e =o
Report, edit, etc...Posted by (U)Bolt_Head on 2004-08-16 at 00:50:19
You could try something like this if there are only two options.

Presets
Conditions:
-Always
Acitons:
-Set custom score to 10 for player x
-Randomize TieBreaker

Vote A
Conditions:
-Current player brings at least one voter to location VoteA
Actions:
-Add one custom score for player X
-Remove all voter for current player at VoteA

Vote B
Conditions:
-Current player brings at least one voter to location VoteB
Actions:
-Subtract one custom score for player X
-Remove all voter for current player at VoteB

A wins
Conditions:
-Players command exactly 0 voters
-Custom score for player X is at least 11
Actions:
-Display Text "Option A Wins"

B wins
Conditions:
-Players command exactly 0 voters
-Custom score for player X is at at most 9
Actions:
-Display Text "Option B Wins"

Then of course you have the tie situation.
Tie Breaker A
Conditions:
-TieBreaker is Set
-Custom Score for paleyr X is exactly 10
-Players command exactly 0 voters
Acitons:
-Display Text "Randomized Tie Breaker, Option A Wins"

Tie Breaker B
Conditions:
-TieBreaker is Clear
-Custom Score for paleyr X is exactly 10
-Players command exactly 0 voters
Acitons:
-Display Text "Randomized Tie Breaker, Option B Wins"

PS. Command Most at location doesn't compare it to the other option. It only checks what group or player has the most at that specific location not witch locaiton has more units.
Report, edit, etc...Posted by HA-CurSe on 2004-08-16 at 00:59:53
Ok! thanks bolt ill try that tommorow ^_^
Report, edit, etc...Posted by Kenoli on 2004-08-16 at 02:42:36
What if your had more than 2 things to vote for?
Report, edit, etc...Posted by Roaring Emu on 2004-08-16 at 04:06:58
Why try not to kill them but just simply make it like at least 3 at location blah at most 2 at location blah-er. Then do you action. I"m not too good with triggers but wouldn't that work? Sorry if it is false... sad.gif
Report, edit, etc...Posted by Silent[wolf] on 2004-08-16 at 04:41:48
players-any

conditions-any player brings at least 1 unit to location "X"
-always

Actions-create 1 civillian at location "Y" for player 8
-kill all units for player "w/e" at location "X"
-preserve trigger

AND!!!

players-any

conditions-any player brings at least 1 "unit" to location "Z"
-always

Actions-create 1 civillian at location "Y" for player 7
-Kill all any unit for player "w/e" at location "Z"
-preserve trigger

THEN!!!
players-any

conditions- player 7 commands more civillians at location "Y" then player 8
- player"ppl who voted" command exactly 0 "unit/voter"

Actions-w/e u want like test or sumthin to show that player 7 won the vote

ALSO!!!!

players-any

conditions-player 8 commands more civillians at location "Y" then player 7
-player "ppl who voted" control exactly 0 "unit/voter"

Actions- w/e u want like text or sumthin

Locations-"X" is either yes or no or either 1 of the voting options
-"Y" is the locations where the civillians get created
-"Z"is either yes or no or either 1 of the voting options



That should work if it doesent idk wut pokey.gif to tell ya buddy
Report, edit, etc...Posted by (U)Bolt_Head on 2004-08-16 at 13:38:23
QUOTE(Silent[wolf)
,Aug 16 2004, 03:41 AM] conditions-player 8 commands more civillians at location "Y" then player 7
              -player "ppl who voted" control exactly 0 "unit/voter"

Actions- w/e u want like text or sumthin

It would be Commands MOST civs at location Y and that isn't the condition you need.

The Command The Most Units at location checks to see if that player commands the most units at that location. So the triggers would say "yep p7 commands the most men at locaiton Y" Then it would look at location X and say "yep p7 commands the moost men at location X". This conditions is NOT a way to detect witch locaiton has more units.

To do that you ither have to guess values like Roaring Emu said or figure it mathmaticaly like I showed. The problem with guessing is depending on how many players you have voteing it may require just as many triggers if not more than figuring it mathmaticly. If there are more than 2 options and 6 players then there can be alot of results and, you got to take into consideration that not all players will be present.

=====================================================
To make a voteing system for multiple options do something like this. I will use a counter for each option but can just create units in a distant location as Silent[wolf] did in his example.

Pick Option 1
Conditions:
-Player Brings at least one men to location Option1
Actions:
-Set deaths for 'unit1' to add 1 for player x

Pick Option 2
Conditions:
-Player Brings at least one men to location Option2
Actions:
-Set deaths for 'unit2' to add 1 for player x

Pick Option 3
Conditions:
-Player Brings at least one men to location Option2
Actions:
-Set deaths for 'unit3' to add 1 for player x

... Continute Pattern for More than 3 options...

Subtraction 1
Conditions:
-PlayerX has suffered at least 2 deaths for 'Unit1'
-Players command exactly 0 voter
Actions:
-Subtract 1 death for 'Unit1'
-Subtract 1 death for 'Unit2'
-Subtract 1 death for 'Unit3'
...

Subtraction 2
Conditions:
-PlayerX has suffered at least 2 deaths for 'Unit2'
-Players command exactly 0 voter
Actions:
-Subtract 1 death for 'Unit1'
-Subtract 1 death for 'Unit2'
-Subtract 1 death for 'Unit3'
...

Continute patuern for each option.

Detect Winner 1
Conditions:
-Player X has suffered exactly 1 death of 'unit1'
-Player X has suffered exactly 0 death of 'unit2'
-Player X has suffered exactly 0 death of 'unit3'
-Players command exactly 0 voter
Actions:
-Display "option 1"

Detect Winner 2
Conditions:
-Player X has suffered exactly 0 death of 'unit1'
-Player X has suffered exactly 1 death of 'unit2'
-Player X has suffered exactly 0 death of 'unit3'
-Players command exactly 0 voter
Actions:
-Display "option 1"

Continue pattern for each option.

Then of course to detect Ties you need to have triggers check every combo of unit deaths. If you were using units in a secluded location you could check to see if there are at least 2 in all the spots.

Unless some one is planning on using this soon i will not bother to write the triggers out for it.
Report, edit, etc...Posted by Stereo on 2004-08-16 at 14:35:17
And another method, requiring custom score not to be used (if it is used, pass it off to a death score. Unless you know one of the other scores available will work). This method is most useful for, say booting players.

Prevote
Players: all voters
Conditions: initiate vote
Actions:
Set score: add 1 custom for all players ;;; this makes all the players have a score equal to the number of players in the game
Create unit: create 1 unit for current player

Voting
Players: voters
Conditions:
Bring: current player brings at least 1 (what unit) to option 1
Actions:
Remove 1 unit for current player at option 1
Set score: custom score - 1 for player 1
Preserve trigger

repeat for option 2 -> custom score p2 etc. They don't have to be the same number but each option needs a corresponding score. If its voting to boot someone correspond each custom score to the coloured beacon or whatever.

After Voting
players: all players with options used
conditions:
Bring: voters control 0 (what unit) at voting
least score: current player has lowest custom score
actions:
boot current player
give current player money
give current player units
whatever you need the vote to do.

If you aren't doing something to a chosen player, just split the trigger into 1 for each option person thus:

players: option 1's score player
conditions:
Bring: voters control 0 (what unit) at voting
least score: current player has lowest custom score
actions:
do stuff for option 1

If you need it to only work for 1 person have triggers before the "after voting ones" like this
players: all options
conditions:
Bring: voters control 0 (what unit) at voting
least score: current player has least custom score
switch: switch 1 is cleared
actions:
set switch 1

players: all options
conditions:
Bring: voters control 0 (what unit) at voting
least score: current player has least custom score
switch: switch 1 is set
actions:
take care of a tie. Maybe randomized switch which if set adds 1 custom for current player, if cleared subtracts one.
If a three way tie is possible you will need to randomize the switch between checking options and run through a second time to make sure.
Next Page (1)