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.
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
Please log in to shout.


Members Online: NudeRaider, Ultraviolet