Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Need Help with randomization...
Need Help with randomization...
Feb 18 2009, 3:52 am
By: InvisibleDerek  

Feb 18 2009, 3:52 am InvisibleDerek Post #1



Ok I've already looked at the Staredit.com/wiki tutorial and thats just confusing to me.
Im trying to have people roll a pair of Dice and get 1-6 on both of the dice.
Ok so i want it so that when a player brings 1 terran civillian to location "Roll"
It creates a random units named 1-6 which is the roll number and displays "You rolled a (x)!"
and then creates "sarah Kerrigan" at location "Return Roller"
Could someone help me with a trigger on how to do this, I was trying to use death counts earlier but maybe i wasnt doing it right so yea.



None.

Feb 18 2009, 4:02 am MobiusOne. Post #2



If your trying to say:
Player brings "Marine" to "Roll Dice"
"Dice Roll" - Create 1 "One - HMarine" (Own One HMarine, Remove) , Create 1 "Two - Ghost" (Own One Ghost, Remove) etc.

Try using - - - Accumulate so-so Minerals/Gas
Spawn So-So at area.



None.

Feb 18 2009, 4:12 am InvisibleDerek Post #3



ok, this is what i had before but it didnt work for some reason

Current Player has Suffered exactly 7 Deaths of "Zerg Spire"
---
Modify Death Counts, Set To "0" "Zerg Spire"
Preserve Trigger

Always
---
Modify Death Counts of "Zerg Spire" add 1.
Preserve Trigger


then

Current Player Brings at least 1 "Terran Civilian" to location "Roll"
Current Player has suffered exactly 1 Death of Zerg Spire
-----------
Kill 1 "Terran Civilian" at Location "Roll" for Current Player
Create 1 "1" at locations "Dice Roll 1" for Current Player
Display Text "You Rolled a 1!"
Preserve Trigger

and it continues for 1-6
but when i bring the civilian to "Roll" it kills the civilain and displays

"Your Rolled a 1!"
"Your Rolled a 2!"
"Your Rolled a 3!"
"Your Rolled a 4!"
"Your Rolled a 5!"
"Your Rolled a 6!"



None.

Feb 18 2009, 4:22 am MobiusOne. Post #4



Put it seperatly.



None.

Feb 18 2009, 4:25 am InvisibleDerek Post #5



What do you mean by that? like instead of current player, put "Player 1"



None.

Feb 18 2009, 4:32 am Falkoner Post #6



http://Falkoner.CoW.Googlepages.com/Death_Counts.html

Try Death Count Randomization, it may work better for the number 6 than Switch Randomization.



None.

Feb 18 2009, 4:38 am MobiusOne. Post #7



Put it with each player. So you'll have a total of 42 "Roll" triggers.



None.

Feb 18 2009, 4:42 am MobiusOne. Post #8



Also put "Player # owns atleast 1 "unit" at area create "unit" at this area.



None.

Feb 18 2009, 4:45 am InvisibleDerek Post #9



Thanks Mobius! That fixed it



None.

Feb 18 2009, 4:59 am MobiusOne. Post #10



No problem. I'd like to test it if possible. ~ Useast AccounT: MobiusOne.



None.

Feb 18 2009, 5:20 am InvisibleDerek Post #11



Sure, Are you online right now? My accounts InvisibleDerek. I play USwest but I just made USeast acc. Same name



None.

Feb 18 2009, 12:10 pm NudeRaider Post #12

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Uhm in your initial post you said you wanted to roll 2 dice with 6 sides each. In your example you only roll 1 dice.
Death count randomization is not good if you need 2 dice, as the 2nd throw would always be a function of the first (=predictable, not random). In the simplest case they are both the same.

That's why I'd suggest randomization using switches for at least 1 of the throws.
So for a 6 sided die you'd need 3 switches (2^3 = 8 >= 6) unfortunately in 2 of 8 possibilites you get 0 or 7 (binary 000 or 111) in that case do nothing, wait for the next trigger loop, until you hit one of 1-6, then do your triggers.

This method, however, can take 2 or more trigger loops until a valid value is found. If you need it instantly you can always do this roll, and store the result (if valid) in a death counter. Then just use the death counter in your create "1 - unit" triggers instead of the switch combinations.

Post has been edited 1 time(s), last time on Feb 19 2009, 3:13 am by NudeRaider.




Feb 18 2009, 8:25 pm InvisibleDerek Post #13



Im not good with triggers :><: so im not sure how to use the switches properly in this situation.

edit- I didnt include it in my post, but i planned on having a second set of triggers where a player would use a different unit to roll the second dice.

Post has been edited 1 time(s), last time on Feb 18 2009, 8:31 pm by InvisibleDerek.



None.

Feb 18 2009, 8:37 pm NudeRaider Post #14

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

There's no magic to switches.
One trigger randomizes the 3 switches and the next triggers check every combination:
#1
C: S1 = clear
C: S2 = clear
C: S3 = set
A: Create "1 - unit"
#2
C: S1 = clear
C: S3 = set
C: S3 = clear
A: Create "2 - unit"
... and so forth




Feb 18 2009, 8:55 pm InvisibleDerek Post #15



Quote from NudeRaider
There's no magic to switches.
One trigger randomizes the 3 switches and the next triggers check every combination:
#1
C: S1 = clear
C: S2 = clear
C: S3 = set
A: Create "1 - unit"
#2
C: S1 = clear
C: S3 = set
C: S3 = clear
A: Create "2 - unit"
... and so forth
Ok so I put like

1)Always
--------
Randomize S1
Randomize S2
Randomize S3

2)
Player x brings 1Terran Civilian to Roll
S1 is set
S2 is Cleared
S3 is Cleared
Preserve Trigger
------

Create 1 "1" at Dice 1 for Current Player
Display for Current player "Your rolled a 1"
Kill 1 "Terran Civilian" at "Roll" for "Current Player"
"Preserve trigger"

and then Change up the Switches from Set to Cleared until i have made all of the combos

correct?



None.

Feb 18 2009, 8:57 pm Norm Post #16



I have a randomization system set up with two dice in my current project, and the way i did it is this:

Condition:
Always
Action:
Randomize switch 7

Condition:
Always
Switch 7 is set
Action:
Set Deaths for unit X for player 8 to 3
Set Deaths for unit Y for player 8 to 5

Condition:
Always
Switch 7 is cleared
Action:
Set Deaths for unit X for player 8 to 4
Set Deaths for unit Y for player 8 to 1

Condition:
Player 8 has suffered at most 6 deaths of Unit X
Action:
Add 1 Deaths for unit X for player 8
Preserve trigger

Condition:
Player 8 has suffered at most 6 deaths of Unit Y
Action:
Add 1 Deaths for unit Y for player 8
Preserve trigger

Condition:
Player 8 has suffered at exactly 6 deaths of Unit X
Action:
Set Deaths for unit X for player 8 to 1
Preserve trigger

Condition:
Player 8 has suffered at exactly 6 deaths of Unit Y
Action:
Set Deaths for unit Y for player 8 to 1
Preserve trigger

Then in your 'roll' trigger you can have each death count value correspond to a different # on the dice. Unit X will be for the first dice and Unit Y for the second. To add even more randomization, you can have certain 1 time events set the deaths of either Unit X or Y to whatever amount so that the timing changes for consistent rolls. This will make it a lot harder for players to learn the randomization system u have and abuse it.

Example: In a 6 player game, you can have the dice values randomized for example, whenever a player leaves by detecting when neutral owns a unit that the player use to own.

Condition:
Neutral commands exactly 1 Protoss Gateway
Action:
Set deaths for Unit X for player 8 to 3


I hope this helps.



None.

Feb 18 2009, 11:34 pm NudeRaider Post #17

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Wow it's pretty hard to understand what you're doing there. You should briefly explain the idea of your triggers when posting "ready-to-go" triggers.

- When I got this right you start either at 3/4(X) or at 5/1(Y)
- then add 1 (why not start at 4/5(X) and 6/2(Y) in the first place?) because at most 6 is always true for 3/4(X) and 5/1(Y)
- and then if Y is 6 (X can't be) set it to 1
Result if switch set: X = 3 + 1 = 4 . . Y = 5 + 1 = 6 ==> Y = 1
Result if switch cleared: X = 4 + 1 = 5 . . Y = 1 + 1 = 2
Which means X is 4 or 5 and Y is 1 or 2. Only 2 possible outcomes.

This makes no sense whatsoever :O
(Correct me if I'm wrong)




Feb 19 2009, 12:47 am MobiusOne. Post #18



MobiusOne. With the period is my account.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:36 pm]
Wing Zero -- Bop em
[02:36 pm]
Wing Zero -- Mods
[2024-5-29. : 9:40 pm]
Ultraviolet -- :wob:
[2024-5-28. : 8:43 am]
TheHappy115 -- Yea, thats the issue. Thanks. It would also explain why my deleted map couldn't get updated. Updated version reduced collision on units (only thing added) since was dodging game (players collide with each other)
[2024-5-28. : 5:26 am]
Ultraviolet -- If so, I'd just focus on getting them on scmscx.com and then you can link to that in the showcase thread for your maps
[2024-5-28. : 5:25 am]
Ultraviolet -- I can't upload my EUD maps, I think the DLDB has some issue with handling them. Are you trying to upload EUD maps?
[2024-5-28. : 2:06 am]
TheHappy115 -- Its been awhile but ever since I requested one of the Maps I posted to be deleted since I couldn't delete it myself (or update it), I haven't been able to upload any more maps. Any reason for that?
[2024-5-26. : 7:14 pm]
Kyradax -- Hi
[2024-5-26. : 5:05 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-5-25. : 9:22 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: Roy