Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Randomization Problems
[SOLVED] Randomization Problems
This topic is locked. You can no longer write replies here.
Feb 9 2012, 12:48 pm
By: Mouse  

Feb 9 2012, 12:48 pm Mouse Post #1



I'm making a map that is Cat n Mouse, but it is different from most. There are 6 arenas and the game randomly chooses an arena, then randomly chooses a Cat from the available people there. It spawns the units in a box in the bottom left corner of the map, then moves them to the appropriate arena. For some reason, when a Mouse gets killed, it respawns in the middle and is invincible. On top of that, all of the game ending triggers screw up if all of the mice are invincible in that round. Could someone take a look at it and see what is wrong? I have tried with multiple people and they cannot.

Attachments:
Survival.scm
Hits: 154 Size: 55.26kb



None.

Feb 9 2012, 12:55 pm Rye123 Post #2



err...did u check the locations layer? maybe u screwed up in there...

PS: I dont understand death counters cos i dont give a damn about learning them... :bleh:



None.

Feb 9 2012, 1:34 pm rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

when something spawns in the middle of the map it's because the location you're creating the unit on is in the middle of the map, usually because you're centering it on something else, which didn't exist at the time of centering, and thus, the location was centered on "anywhere".



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Feb 9 2012, 8:50 pm Mouse Post #4



If you look at the map, it's not centered anywhere. The triggers for the randomization and center view are for Force 1. When they spawn to the box on the bottom left, they don't always get moved to the correct "Arena" that the switches are set to. If you didn't look at the map Rockz, please look at the triggers and then tell me ;P

EDIT: Or here's a better question: Could someone design a randomization that will choose a cat out of 7 people and create the Cat and the 6 mice, in a box. Then have it randomize an Arena and move the units to that Arena?

Post has been edited 1 time(s), last time on Feb 10 2012, 1:40 am by Mouse.



None.

Feb 10 2012, 1:59 am Mouse Post #5



Here's the replay.

Attachments:
Azrael.rep
Hits: 0 Size: 24.29kb



None.

Feb 10 2012, 7:20 pm Roy Post #6

An artist's depiction of an Extended Unit Death

Quote from Mouse
EDIT: Or here's a better question: Could someone design a randomization that will choose a cat out of 7 people and create the Cat and the 6 mice, in a box. Then have it randomize an Arena and move the units to that Arena?
Sure:
Triggers

Not the most optimized, I'd imagine, but it's clean enough to get the job done.




Feb 11 2012, 6:28 am rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

I assumed "For some reason, when a Mouse gets killed, it respawns in the middle" meant that it shouldn't be respawning, and especially shouldn't be respawning in the middle of the map.

Code
Trigger("Force 1"){
Conditions:
    Deaths("Current Player", "Terran Marker", Exactly, 1);
    Command("Force 1", "Torrasque (Ultralisk)", At least, 1);
    Command("Current Player", "Torrasque (Ultralisk)", Exactly, 0);
    Command("Current Player", "Protoss Probe", Exactly, 0);

Actions:
    Preserve Trigger();
    Set Deaths("Current Player", "Warp Gate", Set To, 1);
    Set Deaths("Current Player", "Xel'Naga Temple", Set To, 0);
    Create Unit with Properties("Current Player", "Protoss Probe", 1, "008", 1);
    Display Text Message(Always Display, "You have been chosen as a Mouse. RUNN!!!");
    Set Resources("Current Player", Set To, 12, ore);
}

This is the only trigger that makes invincible mice, so it's clearly running when your mouse dies. You need to add 1 or something to terran marker so that you don't make more than one thing.

In any case it's really hard to look at someone else's triggers and figure out exactly how they work with no background information, no concrete listing of the "problem" and what all the variables are.

IMO it's easiest to randomize a switch-> add 4 to DC if it's set, randomize that same switch again, add 2 to DC, randomize -> add 1. This gives you a number from 0 to 7 which you can then use to organize stuff.
For randomizing the cat for the round, assign the numbers to each player and repeat the randomization if they are not in the game. The sample trigger should look like this:

if
DC is exactly 5
Player 5 commands at least 1 building (or some other way to know that the player is in the game)
DC "randomize cat" is 1
then
this player is the cat, set a DC "is cat" or something.
set DC "randomize cat" to 0
repeat for all players, and have the triggers to randomize the switches/add to DC only run when "randomize cat" is 1. When the round is over and you're ready for a new cat, kill off all the units, set "is cat" to 0 for everyone and set "randomize cat" to 1. It will eventually find a cat for you.

In the same way, you can do "randomize arena", except you don't have to worry do much about leavers. Just repeat the randomization if the DC is 6 or 7 so you get a random number between 0 and 5.

Fix your randomizations and make sure your triggers which are only supposed to run once per round are truly running once per round by adding in a DC. Then we'll work on fixing the fact that your victory doesn't ever work.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[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
Please log in to shout.


Members Online: lil-Inferno, Roy