1 switch randomization is probably the best trigger based way to do this. It's similiar to what you posted in your example and I'll explain a few ways to do what you want.
1 switch randomization will generate a range of numbers based on powers of 2.
You can modify the range of numbers you want to use that will generate an event by just making every randomly generated number that's above the range you want restart the randomization process. If you later want to change the range then just modify the trigger that sets the limit for which random number results will rerandomize.
For example if you use 1 switch randomization to generate a range of 0 - 127 but you only want to use numbers from 0 - 100 just have a trigger with the condition and modifier of if the number is at least 101 Then rerandomize.
Using 1 switch randomization or any randomization system you can keep numbers from generating an event more than once after they have been picked. You can do this in a variety of ways, such as a switch or death counter being set or added to, creating units, bringing units after it has come up. Yet however you do it, it may start to get impractical.
QUOTE
Thanks smile.gif
But sorry lol its not what I need (I feel like a grumpy old lady trying to buy clothes... nothing ever suits me well enough tongue.gif)
It would work after the second event. Death counters require user input or are time based. tongue.gif
Since the first event will always take place in the same time the margin of randomness would be lower if it was time based... for all subsequent ones DeathCounter would do just fine happy.gif
What do you mean by death counters require user input or are time based? You can manipulate death counters using set deaths action. And kenoli's trigger would not work after the second event.
All of these randomization processes take place in one trigger cycle, unless you are rerandomizing, but even still, copying and pasting the whole process would be able to rerandomize in one trigger cycle.
--
In depth description of useless concept below.
A more complex but death counter saving method would be to store multiple values as "switches" in only one death counter. This idea was thought up by Shmidley and me and him discussed how it would be done. This would be based on powers of 2. I'm not sure how many different values you would be able to store in one death counter, but it would depend on the exact maximum a death counter can hold. For this example I'll use 8 "switches" stored in a death counter.
If you picture a switch in binary it can either be 0 or 1, set or clear. If you string 8 switches together they will look like this: 00000000 with each place value being either a 0 or a 1. For example if the switches looked like this in binary 10000000 then it could be read as 128 in decimal or switch 8 is set and the rest are cleared. 10000001 would be read as 129 in decimal or as switch 8 and switch 1 are set and the rest are cleared.
The decimal representation can be used in a death counter by adding the correct power of 2 if the corresponding switch is set. So if you want to set switch 1 you would add 1, switch 2 would add 2, switch 3 would add 4 ... switch 8 would add 128 and so on.
Now you have to be able to "read" which "switches" in the death counter are set or cleared by using triggers. To do this you would simply break down the death counter by subtracting powers of 2 starting with the highest power of 2 you are using to the lowest power. If a certain power of 2 can be subtracted from the death counter, then that means that corresponding switch is set.
Using 129 as an example, the process by which it would be read will look like this:
Can 128 be subtracted from it?
Yes, so that means "switch" 8 is set and then subtract 128
Can 64 be subtracted what's left? No, so move on
Can 32 be subtracted what's left? No, so keep going down
.
.
.
And then you it will get down to 1
Can 1 be subtracted what's left?
Yes (because the death counter's value is 1), so that means "switch 1" is set and then subtract 1
No matter what the value in the death counter is, after going through this process it will be set back down to 0. However, if you want to still keep track of the switches after going through them once, you will need to "restore" the value of the death counter to what it was before. To do this you would add an action to add the power of 2 you are subtracting into a "storage" death counter. And once you are done with the process you would have another process that would take the value of the storage counter and place it into the value of the death counter.
These processes are based on what we here call "binary countoffs" because you are subtracting powers of 2. You can see a good example of this being used in Tuxedo-Templar's calculator map. And the counter arithmetic tutorial http/www.staredit.net/index.php?tutorial=34