Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: randomization with countdown timer
randomization with countdown timer
Jul 29 2009, 1:04 am
By: Exigence  

Jul 29 2009, 1:04 am Exigence Post #1



alright, so this is what I'm trying to do:
every 10 minutes from the Countdown Timer, a rescuable random unit will appear at a location on my map and reset the countdown timer to 10 minutes AFTER it has been rescued. this unit is randomized between 30 other units using a multi-switch randomization using a death counter and 5 switches. The problems i've faced is having no unit appear, several units appearing at the same time, and the same units appearing 3 or 4 times consecutively, some units almost NEVER appearing. I've tried to set Death Counters, switches, and waits in parts of the triggers to restrict the trigger from firing more than once. I think I just need a suggestion of how to properly set these triggers. *Also is multi-switch randomization completely RANDOM, or is there still higher chance in areas?

All help is greatly appreciated.



None.

Jul 29 2009, 1:24 am Demented Shaman Post #2



There's many sources of error if you're not doing it properly. The first thing I would do is get rid of any waits. You shouldn't need them. The second thing I would do is set a switch when the countdown timer is 0 and then set the countdown timer back to 10 minutes in the same trigger. Then, any trigger relating to the randomization will have the condition that the switch be set. When you create a unit based on the death counter result, clear the switch and that will stop any more randomization occurring.

Also keep in mind that since you only have 30 options and you're using a death counter method for randomization, you'll need to rerandomize certain outcomes. For example, in your situation your randomization outcomes range from the 0 to 31. That's 32 outcomes, 2 more than you need. What you will need to do is for 2 of the outcomes have it run the randomization again so that you generate a different random number.

Here's how the triggers would basically look.

When countdown timer is 0, set switch "Start randomization" and set countdown timer to 600 seconds.

When switch "Start randomization" is set:
- set DC to 0
- Randomize switch "random"
- if "random" is set, add 1 to DC
- Randomize switch "random"
- if "random" is set, add 2 to DC
- Randomize switch "random"
- if "random" is set, add 4 to DC
- Randomize switch "random"
- if "random" is set, add 8 to DC
- Randomize switch "random"
- if "random" is set, add 16 to DC
- if DC = X with X being a number from 0 to 29, create the corresponding unit and clear switch "Start randomization"

Each bullet is it's own trigger (or in the case of the last one 30 separate triggers) with the condition that "Start randomization" is set.

This will automatically rerandomize for the outcomes 30 and 31 because the last bullet will never be satisfied, therefore not clearing "start randomization".

The above method uses one switch randomized 5 times. Alternatively, you can randomize 5 switches once.
It would look like

- Randomize switches "r1", "r2", "r3", "r4", "r5"
- if "r1" is set, add 1 to DC
- if "r2" is set, add 2 to DC
- if "r3" is set, add 4 to DC
- if "r4" is set, add 8 to DC
- if "r5" is set, add 16 to DC

Post has been edited 1 time(s), last time on Jul 29 2009, 1:37 am by Pariah.



None.

Jul 29 2009, 1:46 am Exigence Post #3



is there a difference between those two methods? does one randomize more accurately than the other? currently, i'm using the 5 switches that randomize. it seems to select the same outcome very very often.

i've decided to dumb my outcomes down to 3 switches (thats 8 outcomes, correct? 0-7? ). ill work with smaller numbers first, then advance my map more once i have a better understanding of how all of this works.

I'm going to try to redo this using your advice. Ill get back to you in about 15 minutes



None.

Jul 29 2009, 1:47 am Falkoner Post #4



Both methods randomize the same way, one just uses a ridiculous amount of switches, while the other does not. Switches should randomize it about as much as a computer can, as long as you're doing it correctly.



None.

Jul 29 2009, 1:55 am Exigence Post #5



quick noob question: for any trigger you want to reuse, including conditions with switches, you have to use Preserve Trigger, correct? that's what i've been doing and I just want to make sure that's right.



None.

Jul 29 2009, 1:58 am Demented Shaman Post #6



Quote from Exigence
quick noob question: for any trigger you want to reuse, including conditions with switches, you have to use Preserve Trigger, correct? that's what i've been doing and I just want to make sure that's right.
Yes, if you want a trigger to run more than once you need to use a preserve.

Otherwise, when the conditions are satisfied the trigger will run once and never again even if the conditions are satisfied again.



None.

Jul 29 2009, 2:13 am Exigence Post #7



- Randomize switches "r1", "r2", "r3", "r4", "r5" <-------

even in this case, this is a seperate trigger for each randomized switch? (i've been using it as one trigger)



None.

Jul 29 2009, 2:23 am Demented Shaman Post #8



Quote from Exigence
- Randomize switches "r1", "r2", "r3", "r4", "r5" <-------

even in this case, this is a seperate trigger for each randomized switch? (i've been using it as one trigger)
No.



None.

Jul 29 2009, 2:23 am Falkoner Post #9



Quote
even in this case, this is a seperate trigger for each randomized switch? (i've been using it as one trigger)

Not a separate trigger, a separate action for each switch, if you decide to use several switches.



None.

Jul 29 2009, 2:57 am Exigence Post #10



Perfect. Now If i wanted to add stronger units to come out later in the game, how should I go about doing this? Basically, it would just be an extra Switch added on to the randomization using higher DC numbers for the units. so the 0-7 would be included with the next 8-15 (i believe?). So 20 minutes, Switch 4 is randomized as well as Switch 1, 2, and 3... What sort of condition should I set? I'm thinking add a switch that activates the 4th switch after the first 10 minute randomization fires??



None.

Jul 29 2009, 3:01 am rockz Post #11

ᴄʜᴇᴇsᴇ ɪᴛ!

So, you want to change the odds of getting a harder monster, or what?

You can always add some later to the DC, or yes, just randomize a 4th switch. That of course means you'll have 16 possibilities. if you simply add 8, you'll get a number 8-15.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jul 29 2009, 4:24 am darksnow Post #12



i think he meant that after a certain point, the randomizations start making stronger monsters



None.

Jul 29 2009, 4:49 am Exigence Post #13



yah, what darksnow said. but rockz covered it as well. thanks once again =]



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-4-26. : 1:58 pm]
lil-Inferno -- ya
[2026-4-25. : 11:50 pm]
JamaL -- Glad to see SEN will never die. Kudos to whoever is paying the hosting fees these days!
[2026-4-25. : 3:37 pm]
NudeRaider -- (-.-,)
[2026-4-25. : 3:35 pm]
Zoan -- ;o I thought that was a monkey emote
[2026-4-25. : 3:34 pm]
Zoan -- :mods:
[2026-4-25. : 3:34 pm]
Zoan -- :mods"
[2026-4-25. : 3:20 pm]
NudeRaider -- Vrael
Vrael shouted: moderation? on SEN? in 2026? completely localized in anoeth47's topic? at this time of year?
boy, if you're not careful I'll moderate your sorry ass too!
[2026-4-25. : 3:06 pm]
RIVE -- Yyyes. Don't you see it?
[2026-4-25. : 2:11 pm]
Vrael -- moderation? on SEN? in 2026? completely localized in anoeth47's topic? at this time of year?
[2026-4-25. : 1:39 pm]
NudeRaider -- anoeth47
anoeth47 shouted: Can I get a moderator/lord of the forum to clean up my topics - delete posts not really part of the topic.
send me the links of the posts you want deleted via pm
Please log in to shout.


Members Online: DarkenedFantasies, anoeth47, Vrael, Ojan