Staredit Network

Staredit Network -> UMS Assistance -> Detection/Randomized money
Report, edit, etc...Posted by Ninebreaker on 2005-10-08 at 23:52:42
I was wondering, is it possible to detect upgrades such as terran infantry up and above lvl 3?

For each variable i want to randomize money (say 1, 5 ,9) i'd need 3 switches correct?
Report, edit, etc...Posted by LegacyWeapon on 2005-10-09 at 00:34:31
EUD conditions can be used to detect upgrades.

The number of outcomes is when x is the number of switches used is 2^x.

1 switch would give you 2 outcomes because 2^1 = 2.
2 switches would give you 4 outcomes because 2^2 = 4.
3 switches would give you 8 outcomes because 2^3 = 8.

So you'd only need 2 switches and reroll on the one that is unassigned.
Report, edit, etc...Posted by Ninebreaker on 2005-10-09 at 23:23:47
ok, i wanted to do sumthing like in LOH, with 4 switches i'd get 16 possible outcomes (i think) and i was wondering how i could figure out which is which, should i randomize all 4 switches or set 1 or clear 1? I'm not really sure which... helpsmilie.gif
Report, edit, etc...Posted by LegacyWeapon on 2005-10-09 at 23:31:10
We have tutorials for everything!
http://www.staredit.net/index.php?tutorial=61

But to be more specific,
You randomize all 4 and then you count to 15 in binary (0-15 = 16 numbers).
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

0 would be the switch is cleared. 1 would be the switch is set (or vice versa).
Then you would have conditions like:
0000 = Switch 1 (Cleared), Switch 2 (Cleared), Switch 3 (Cleared), Switch 4 (Cleared)
0001 = Switch 1 (Cleared), Switch 2 (Cleared), Switch 3 (Cleared), Switch 4 (Set)
etc.
Report, edit, etc...Posted by Ninebreaker on 2005-10-10 at 16:41:14
k thanks.

EDIT: And, for each player, do i have to use different switches?
Report, edit, etc...Posted by in_a_biskit on 2005-10-11 at 02:03:44
It depends on how you use them. You might be able just to randomise those four again to use for every player.
Report, edit, etc...Posted by Sniper on 2005-10-11 at 02:12:31
You should use different switches for different players. If two players have the randomization happen at the same time, you'll get the same results.
Report, edit, etc...Posted by in_a_biskit on 2005-10-11 at 07:12:07
The thing is, two players never really have the randomisation or even any trigger set run at the same time, because the trigger list is read one player at a time - the only exception is if there is a blocking action such as a wait action in the randomisation triggers. So Player 1 will be able to randomise and check four switches, and Player 2 can, even in the same trigger cycle, re-randomise and independently check the same four switches for his/her own use.

So far as I can see, the only reason you would need to use a separate set of switches for each player is if you need to refer back to the outcomes of those switches at some later time - that is, the switch states can't be changed, or else you'll lose the stored information that you need to refer to.

But most of the time, the switches are randomised, some effect is done according to the outcome, and then the switches are no longer relevant to that effect - that is, they can be re-used.

But of course, as I said before, it all depends on how you use them. And if it's easier to think about to use separate sets of switches, there's no problem with that either.
Report, edit, etc...Posted by Ninebreaker on 2005-10-11 at 19:44:57
Alright, should be easy now that i know how ermm.gif
Report, edit, etc...Posted by Subrosian on 2005-10-12 at 18:34:22
Don't make a trigger for each possible outcome. I know of a much better way to randomize money than LegacyWeapon.


Trigger
Description:
Randomizing Trigger
Players:
¤ Any Players
Conditions:
¤ Always.
Actions:
¤ Randomize Switch 1.
¤ Randomize Switch 2.
¤ Randomize Switch 3.
¤ Randomize Switch 4.


Trigger
Players:
¤ Any Players
Conditions:
¤ Switch 1 is set.
Actions:
¤ Add 8 ore.

Trigger
Players:
¤ Any Players
Conditions:
¤ Switch 2 is set.
Actions:
¤ Add 4 ore.

Trigger
Players:
¤ Any Players
Conditions:
¤ Switch 3 is set.
Actions:
¤ Add 2 ore.

Trigger
Players:
¤ Any Players
Conditions:
¤ Switch 4 is set.
Actions:
¤ Add 1 ore.


That is the easy way to randomize the amount of minerals for a player, ranging from 0-15.
Report, edit, etc...Posted by Ninebreaker on 2005-10-12 at 19:04:49
Thats the exact same thing... just without the 'switch x is clear' triggers...
Report, edit, etc...Posted by Toothfariy on 2005-10-12 at 19:49:50
close but not quite as many trigs as legecy's and it indeed works
Report, edit, etc...Posted by Subrosian on 2005-10-12 at 20:00:42
QUOTE(Ninebreaker @ Oct 12 2005, 05:04 PM)
Thats the exact same thing... just without the 'switch x is clear' triggers...
[right][snapback]332262[/snapback][/right]

You don't need a trigger for each possible outcome. It reduced it from 16 to 4.

The number of triggers can go from 256 to 8, even.
Next Page (1)