Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Switch Randomization not working
Switch Randomization not working
May 10 2014, 2:31 pm
By: sethmachine  

May 10 2014, 2:31 pm sethmachine Post #1



Hi,

Below are a set of triggers which essentially do the following:
-----------------------------------------------------------------
1. Complete a death counter timer

2. When timer is complete, randomize a Switch 3 times in a row

3. Result is a random number (stored as DC) from 0-7

4. Choose a random spawn from the following: 3/8 Hydra, 3/8 Dragoon, and 2/8 Ultralisk

------------------------------------------------------------------

Now I've done this algorithm hundreds of times to randomize stuff on a timed basis. In fact I've got several systems using this structure in the same map, and they work flawlessly. So as you imagine, I've copied it over a hundred times and done my manual macros. But this time, the third option for Ultralisk NEVER comes up. And I mean NEVER. It's a 25% chance, and sure it will choose Dragoon/Hydra 75% of the time, but even so, the damn Ultralisk has to spawn at some point. In other systems (same exact structure), I've got events with probabilities as low as 3%, yet I see them come up every game. This Ultralisk never comes. Which means the conditions that spawn it are not returning as true. Here's the triggers for context.

Triggers


So, if the Ultralisk is never spawning, it logically means one of the conditions must be false, otherwise it surely will spawn at some point that isn't at the end of the universe. My 3% events usually happen within at most ~5 minutes of each other. A 25% event should happen much more frequently...

Conditions I am certain are true:

1. Deaths("Current Player", "Artanis (Scout)", Exactly, 1);
The other triggers requiring this are firing, and nowhere do I ever modify this DC except in the triggers given.

2. Command("Current Player", "Zerg Ultralisk", At most, 0);

There's no preplaced ultras on the map, and I never have P8 spawn one except through this way.

I think these conditions are the culprit, but I have no real way of proving it, or knowing why.

3. Deaths("Current Player", "Alexei Stukov (Ghost)", At least, 6);
Deaths("Current Player", "Alexei Stukov (Ghost)", At most, 7);

If I make it a range of 0-7, the Ultra sure does damn well spawn. But I checked my switch randomization statements, and surely it must generate a number from 0-7.

I need a fresh pair of eyes for this incredibly simple oversight that I can't yet see. Thanks.



None.

May 10 2014, 2:52 pm Roy Post #2

An artist's depiction of an Extended Unit Death

Here's your problem:

Trigger("Player 8"){
Conditions:
Deaths("Current Player", "Artanis (Scout)", Exactly, 1);

Actions:
Set Switch("Switch96", randomize);
Set Deaths("Current Player", "Alexei Stukov (Ghost)", Set To, 0);
Preserve Trigger();
Comment("Boss Spawn Switch Randomize Init\r\nSwitch 96\r\nDC: Alexei Stukov (Ghost)");
}

//-----------------------------------------------------------------//

Trigger("Player 8"){
Conditions:
Deaths("Current Player", "Artanis (Scout)", Exactly, 1);
Switch("Switch96", set);

Actions:
Set Deaths("Current Player", "Alexei Stukov (Ghost)", Add, 1);
Preserve Trigger();
Comment("Boss Spawn Randomize +1");
}

//-----------------------------------------------------------------//

Trigger("Player 8"){
Conditions:
Deaths("Current Player", "Artanis (Scout)", Exactly, 1);

Actions:
Set Switch("Switch96", randomize);
Set Deaths("Current Player", "Alexei Stukov (Ghost)", Set To, 0);
Preserve Trigger();
Comment("Boss Spawn Switch Randomize");
}

//-----------------------------------------------------------------//

Trigger("Player 8"){
Conditions:
Deaths("Current Player", "Artanis (Scout)", Exactly, 1);
Switch("Switch96", set);

Actions:
Set Deaths("Current Player", "Alexei Stukov (Ghost)", Add, 2);
Preserve Trigger();
Comment("Boss Spawn Randomize +2");
}

//-----------------------------------------------------------------//

Trigger("Player 8"){
Conditions:
Deaths("Current Player", "Artanis (Scout)", Exactly, 1);

Actions:
Set Switch("Switch96", randomize);
Set Deaths("Current Player", "Alexei Stukov (Ghost)", Set To, 0);
Preserve Trigger();
Comment("Boss Spawn Switch Randomize");
}

//-----------------------------------------------------------------//

Trigger("Player 8"){
Conditions:
Deaths("Current Player", "Artanis (Scout)", Exactly, 1);
Switch("Switch96", set);

Actions:
Set Deaths("Current Player", "Alexei Stukov (Ghost)", Add, 4);
Preserve Trigger();
Comment("Boss Spawn Randomize +4");
}

//-----------------------------------------------------------------//

Your random value can only be 0 or 4 because of this mistake.




May 10 2014, 11:24 pm sethmachine Post #3



Many thanks Roy! It was a left over from the initial switch randomization which does the clean up from the previous switch cases.

In the future, is there any way to see death counters without referencing their value? If I could have seen in a leaderboard that the DC was always 0 or 4, I think I would have found this out quicker. Though even when I suspected it was the DC that was adding wrong I didn't think to look here.



None.

May 10 2014, 11:38 pm jjf28 Post #4

Cartography Artisan

You can put deaths in the leaderboard, first find the index of the unit you're using for deaths and add 228, put that number in the unit field of the leaderboard kills action with the format ID:NUMBER (ex: ID:228 to show deaths of marines)



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:20 am]
Symmetry -- Dang I'm up to 155 minerals gambling really pays off guys
[2026-10-11. : 6:02 am]
Donald -- Samase
[2026-10-09. : 2:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[2026-10-09. : 2:47 am]
Symmetry -- I'll check it out this weekend!
[2026-10-09. : 2:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[2026-10-09. : 2:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[2026-10-09. : 1:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[2026-10-09. : 1:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[2026-10-09. : 1:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
Please log in to shout.


Members Online: Wing Zero