Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Building Randomization Problem
Building Randomization Problem
Sep 27 2016, 3:58 am
By: zsnakezz  

Sep 27 2016, 3:58 am zsnakezz Post #1



Hello, Snake here, with another fresh buttery mapping issue.

In the map OVERLORDS there are some buildings I've selected to rotate between eachother.

In order for one building to move, one building must be missing from the spot that it's about to be.

So at this point I created a "displacement" slot, this takes the first building in the rotation, and teleports it to a spot I made.

When the players are done picking their starting units, this trigger is set to stop. The only issue is, sometimes it stops with a building in the displacement slot I made, leaving one of the real slots empty.

I created another trigger to help counter this within a short time gap within the timing of picking a starting group and the ending of the rotation. (little less than a second)
A lot of the time, this trigger is successful at ending the rotation correctly, but in 20 playtests, I can still experience this error 5 to 6 times, which is far from ideal.


Code
//-----------------------------------------------------------------//

Trigger("Player 8"){
Conditions:
    Bring("Foes", "Terran Civilian", "STARTINGUNITS", At least, 1);

Actions:
    Move Unit("Player 8", "Buildings", All, "BUILDINGSLOT1", "DISPLACEMENT SLOT");
    Wait(10);
    Move Unit("Player 8", "Men", All, "BUILDINGSLOT1", "DISPLACEMENT SLOT");
    Wait(5);
    Move Unit("Player 8", "Buildings", All, "BUILDINGSLOT2", "BUILDINGSLOT1");
    Wait(10);
    Move Unit("Player 8", "Men", All, "BUILDINGSLOT2", "BUILDINGSLOT1");
    Wait(5);
    Move Unit("Player 8", "Buildings", All, "DISPLACEMENT SLOT", "BUILDINGSLOT3");
    Wait(10);
    Move Unit("Player 8", "Men", All, "DISPLACEMENT SLOT", "BUILDINGSLOT3");
    Wait(5);
    Preserve Trigger();
}

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

Trigger("Player 8"){
Conditions:
    Bring("Foes", "Terran Civilian", "STARTINGUNITS", At least, 1);
    Bring("Player 8", "Buildings", "BUILDINGSLOT2", Exactly, 0);

Actions:
    Move Unit("Player 8", "Buildings", All, "BUILDINGSLOT3", "BUILDINGSLOT2");
    Wait(10);
    Move Unit("Player 8", "Men", All, "BUILDINGSLOT3", "BUILDINGSLOT2");
    Wait(5);
    Preserve Trigger();
}

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


Post has been edited 1 time(s), last time on Sep 27 2016, 4:03 am by zsnakezz.



I made the following maps; Hyperion 2, The Undead, The Undead Coop, Realm Rpg beta, and Overlords.

Sep 27 2016, 4:41 am Dem0n Post #2

ᕕ( ᐛ )ᕗ

Could you explain your end goal a little more clearly? I'm not understanding what you mean by building rotation. Are you saying that the players should get random buildings at the start of the map, and the way you're doing that is by creating buildings one at a time, and having the trigger stop when they pick their unit? If so, that's really not a good way to do it, and obviously leaves a lot of room for bugs. Why not just use randomized switches to decide which buildings the players get?




Sep 27 2016, 5:04 am zsnakezz Post #3



Quote from Dem0n
Could you explain your end goal a little more clearly? I'm not understanding what you mean by building rotation. Are you saying that the players should get random buildings at the start of the map, and the way you're doing that is by creating buildings one at a time, and having the trigger stop when they pick their unit? If so, that's really not a good way to do it, and obviously leaves a lot of room for bugs. Why not just use randomized switches to decide which buildings the players get?

There are 3 buildings that are rotating in a circle. They are moving in a clockwise rotation. There is a spot that normally has no buildings, that was put there as the first movement to start the rotation, because you can't move all 3 buildings at once, because one would have to be missing from it's spot to start the rotation. So there are times when you pick your starting unit, it will end the rotation with a building in the spot where it shouldn't be (the spot created to start the rotation) leaving one of the real slots empty without a building. Edit: and yes, it is a building randomizing system.



I made the following maps; Hyperion 2, The Undead, The Undead Coop, Realm Rpg beta, and Overlords.

Sep 27 2016, 5:27 am DarkenedFantasies Post #4

Roy's Secret Service

Is it necessary to have the randomizer physically on the map? I'm thinking it would be more simple to have a death counter looping between 3 values... when the players are done, the number the counter lands on determines which buildings they are given.

Unless it's like a fancy thing you want the players to see?




Sep 27 2016, 5:36 am Dem0n Post #5

ᕕ( ᐛ )ᕗ

DCs may work fine, but if the players always pick their units at the same speed, they'll get the same buildings each game (probably not very likely, but still could happen). I think randomized switches would be better.




Sep 27 2016, 3:04 pm O)FaRTy1billion[MM] Post #6

👻 👾 👽 💪

Get rid of the waits. You can rotate the buildings in the same trigger cycle , then there will never be one in the displacement slot after it has run.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Sep 27 2016, 5:48 pm zsnakezz Post #7



Quote from O)FaRTy1billion[MM]
Get rid of the waits. You can rotate the buildings in the same trigger cycle , then there will never be one in the displacement slot after it has run.

Quote
Will give this a try tonight, will let you know how it goes.

Alright to follow up, I did some additional tests thismorning with the triggers combined and wait times removed. It made the buildings rotate much more efficiently but the issue is (rare) but still there. I do believe I'm closer to solving the issue though.

Post has been edited 1 time(s), last time on Sep 28 2016, 4:59 am by zsnakezz.



I made the following maps; Hyperion 2, The Undead, The Undead Coop, Realm Rpg beta, and Overlords.

Sep 28 2016, 12:44 am Butch Post #8

PROFESSIONAL MAP MAKER

Have a DC called state. This stores where the buildings should be.
Have a DC called state_timer. This is the delay between the buildings rotating.
Have a switch called rotate_buildings. This will determine whether the buildings are rotating or not.

if rotate_buildings is set then subtract 1 from state_timer

If state is exactly 0 and state_timer is exactly 0, then set state to 1 and set state_timer to whatever time you want a building to be in the same spot. And move all the buildings to the appropriate spots for state 1.
Repeat this trigger for the transition between all states.

Then when you want your players to choose the buildings just use the DC state as a condition and you can determine what building will be in what spot at the moment of choice.

Hopefully that makes sense, hopefully I understood your problem. I'd recommend getting used to using DCs more often as it's more efficient and you're able to achieve more.



None.

Sep 28 2016, 4:59 am zsnakezz Post #9



Accidentally quoted and edited the same comment from before. Please refer to 2 comments ago for my response.



I made the following maps; Hyperion 2, The Undead, The Undead Coop, Realm Rpg beta, and Overlords.

Sep 29 2016, 10:10 pm zsnakezz Post #10



SOLUTION : I ended up going with no wait times, I set the randomizing trigger to player 8's top priority, I had a trigger in place that was capable of fixing the issue, but I had it set to fire right away, not giving the cycle time to complete. This trigger would sense that there is a building left in the displacement slot, and send it to the next spot in the rotation.

So no wait times on rotation, but I did add a 100 millesecond wait time before it fires the fix. Tested the function 10 times, worked every time. The end.



I made the following maps; Hyperion 2, The Undead, The Undead Coop, Realm Rpg beta, and Overlords.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[04:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[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
[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" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
Please log in to shout.


Members Online: RIVE, zsnakezz, kalieestes