Staredit Network

Staredit Network -> UMS Assistance -> Randomizing Switches?
Report, edit, etc...Posted by EcHo on 2006-05-13 at 12:28:30
I forgot how to randomize switches
So it can have different things for each players
How can i randomize switches?
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-05-13 at 12:31:10
In the "set switch" action set it to "random".
Report, edit, etc...Posted by flipmonkey on 2006-05-13 at 12:43:46
Here is a quote from fritfrat about randomizing switches. Its about dice but still has the same concept.

QUOTE(fritfrat @ May 9 2006, 07:28 PM)
My explanation of how to do dice rolls.


If you want to get into throwing dice, you will be up for a treat. There are 36 permutations of two dice being thrown, and you need to take them all into account; for example, a 7 is 6x more likely to be thrown than a 12 or 2.

The dice throw permutations would work like this:

11  21  31  41  51  61
12  22  32  42  52  62
13  23  33  43  53  63
14  24  34  44  54  64
15  25  35  45  55  65
16  26  36  46  56  66

Added together:
2  3  4  5  6  7
3  4  5  6  7  8
4  5  6  7  8  9
5  6  7  8  9  10
6  7  8  9  10  11
7  8  9  10 11  12

2/12- 1 chance
3/11- 2 chances
4/10- 3 chances
5/9-  4 chances
6/8-  5 chances
7-    6 chances

Note, if you add them all up, there are still 36 permutations, just stated in a different way. Now, to use switches, we must randomize 6 switches. This will create 64 possibilities, but without the 6th switch, there are only 32, which is not enough.

Randomize Switch 1
Randomize Switch 2
Randomize Switch 3
Randomize Switch 4
Randomize Switch 5
Randomize Switch 6

I will use "+" for set and "-" for cleared. Switches 1 to 6 would be written in order from left to write, and the dice roll that is asoociated with it comes after the switch states.

------    2  (Doubles)
-----+    3
----+-    3
----++    4  (Doubles)
---+--    4
---+-+    4
---++-    5
---+++    5
--+---    5
--+--+    5
--+-+-    6    (Doubles)
--+-++    6
--++--    6
--++-+    6
--+++-    6
--++++    7
-+----    7
-+---+    7
-+--+-    7
-+--++    7
-+-+--    7
-+-+-+    8  (Doubles)
-+-++-    8
-+-+++    8
-++---    8
-++--+    8
-++-+-    9
-++-++    9
-+++--    9
-+++-+    9
-++++-    10  (Doubles)
-+++++    10
+-----    10
+----+    11
+---+-    11
+---++    12  (Doubles)
+--+--
+--+-+
+--++-
+--+++
+-+---
+-+--+
+-+-+-
+-+-++
+-++--
+-++-+
+-+++-
+-++++
++----
++---+
++--+-
++--++
++-+--
++-+-+
++-++-
++-+++
+++---
+++--+
+++-+-
+++-++
++++--
++++-+
+++++-
++++++



Now, to make the triggers. Lets start it at the beginning of a dice roll.

Randomize all 6 switches.

Now, you will have 36 triggers that follow the format of this one:

Conditions:
Switch 1 is cleared.
Switch 2 is cleared.
Switch 3 is cleared.
Switch 4 is cleared.
Switch 5 is cleared.
Switch 6 is cleared.
(A condition that shows which player is rolling the dice; for example, current player commands exactly 1 Dice Roller or something.)

Action:
(Whatever you want done).



Doubles are done by associating the first of every even trigger as a double.

If the switches come out to one of the switches without a number associated with it (Very likely), just re-randomize the switches until you get them randomized in a way they are associated with a number.



This is what I would find the most accurate way of representing true dice rolls. Good Luck 
Report, edit, etc...Posted by Equality on 2006-05-13 at 13:57:40
You can also find it in the Tutorials.
Report, edit, etc...Posted by EcHo on 2006-05-13 at 15:39:10
dat dice thing completely lost me -_-
Report, edit, etc...Posted by Noober on 2006-05-13 at 15:51:41
Basically, you just need the least number of switches combinations (2^x) that is greater than the number of combinations that you need. Then, for the ones that are unused, rerandomize.

For example, if you wanted to pick 1 random unit out of 5 possible units, you would need 3 switches, since 8 is the least power of 2 that is greater than 5. So, you would match the first 5 combos of switches to each of the units. But, you only need 5 units, yet you have 8 available combos. So, for the other 3, you would put an action to randomize the 3 switches again.

Get it?
Report, edit, etc...Posted by EcHo on 2006-05-14 at 21:08:41
im not using units dood
Report, edit, etc...Posted by Noober on 2006-05-14 at 21:34:31
It doesn't matter, that was just for example. Just do whatever you're doing the same way.
Report, edit, etc...Posted by EcHo on 2006-05-14 at 21:40:24
No hablo inglesh :[
Report, edit, etc...Posted by Kenoli on 2006-05-14 at 22:23:04
QUOTE
I forgot how to randomize switches
So it can have different things for each players
How can i randomize switches?
The first and probably most apparent step: Select the Set Switch trigger, as seen here...
user posted image

Next, select the switch you want to randomize and set the action to Random, as seen here...
user posted image

That's all there is to randomizing a switch, it's built right into the trigger. When this action happens, the switch will end up being either set or clear.

Is that what you wanted to know?
Report, edit, etc...Posted by EcHo on 2006-05-14 at 22:27:01
yes and also i wanna know if it affects all the switch triggers
if so how can i fix dat?
Cuz theres different triggers with certain switches for each player
Report, edit, etc...Posted by Kenoli on 2006-05-14 at 23:56:09
QUOTE
yes and also i wanna know if it affects all the switch triggers
if so how can i fix dat?
Cuz theres different triggers with certain switches for each player
Well, switches are what you might call "global", meaning that there is only one "Switch 1", not one for every player.
It's sort of like the countdown timer. Though there is only one countdown timer, any of the player's triggers can set it.
Knowwhatimean?
Report, edit, etc...Posted by (U)Bolt_Head on 2006-05-15 at 04:12:49
I think he was asking if randomizing Switch 1 would effect switch 2 and switch 3 and all those. If thats the case it certaintly doesn't.

I explained randomizeing to the best of my ablity here
http://www.staredit.net/index.php?tutorial=61 (in the part that say "by (U)Bolt_Head")
For me to explain better than that I would be basicly just be telling you how to make the triggers directly for your purpose and I don't think that helps you.
Report, edit, etc...Posted by EcHo on 2006-05-15 at 22:56:45
Thx Bolt, that was exactly wat i was looking for
Next Page (1)