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.
[10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
[2024-5-04. : 1:05 am]
Vrael -- that's better
[2024-5-04. : 12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[2024-5-03. : 10:18 pm]
Vrael -- who says I'm not a total madman?
[2024-5-03. : 2:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
Please log in to shout.


Members Online: Lost_Angel, Roy, NudeRaider