Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Custom random switches
Custom random switches
Sep 17 2014, 4:51 am
By: FlameViper  

Sep 17 2014, 4:51 am FlameViper Post #1



Is there a general thread for these small problems, that I can't find?
Anyway here's my little trigger figuring-out problem, I want a random chooser mechanic for a The Thing map.
I want players that want to be the Thing and players that don't want to.
Thus I end up with some combinations for the randomizer switches that will have no players assigned to them, how do I fix this?

Post has been edited 1 time(s), last time on Sep 17 2014, 4:57 am by FlameViper.



None.

Sep 17 2014, 9:32 am NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Since players "want" something, I'm going to assume there's user input. That makes randomization with death counters possible.

Always have a counter running from 1-max number of players.

When all players have chosen, let Current Player read the the death counter. If the counter is equal to their player number they become the thing.




Sep 19 2014, 6:46 am rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from FlameViper
Is there a general thread for these small problems, that I can't find?
Anyway here's my little trigger figuring-out problem, I want a random chooser mechanic for a The Thing map.
I want players that want to be the Thing and players that don't want to.
Thus I end up with some combinations for the randomizer switches that will have no players assigned to them, how do I fix this?
Nude's method will certainly work, but it does have the minor issue that if the players are fast, it will be repeatable and not random. If someone waits around it's probably good.

I was thinking about how to do this. Perhaps giving each player a random DC, say 1-512, then if the player wants to be the thing, add 512 to the DC. Add the negative of that DC to all players DCs if the current player's DC is at least 1 and at most 1024 to find out who has the largest. The first player with exactly 0 in the DC would be the thing (put the exactly 0 trigger after the randomization but before the subtraction so it will fire on the next trigger run)

That kind of means that player 1 has a higher chance than player 8 to be the thing, but with 512, the chances of getting 2 people with the same number and being the largest is pretty slim. It also has the benefit that it's finished in 2 trigger runs and would take 9*3+1 triggers owned by each individual player.

I always think of the wierdest ways to do things...



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

Sep 19 2014, 9:03 am NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from rockz
Nude's method will certainly work, but it does have the minor issue that if the players are fast, it will be repeatable and not random. If someone waits around it's probably good.
True but coordinating players to do something within 84ms will be really hard to do reliably. Even when everyone does it right at map start there will be different speeds in execution.

To eliminate that initialize the dc at a random number between 0-7 (or 0-3 for number of players < 5) , using 3 (or 2) randomized switches. (I know it's still biased but certainly not good enough to accuse someone of being the thing.)




Sep 19 2014, 5:00 pm FlameViper Post #5



I'm gonna have to give the players the option to end the counter by themselves. Otherwise if I put an objective timer that never changes per game then it'll pick the same player over and over again.

Also I'm gonna give the players the option to pick both DC random and Switches random, in case shit goes wrong for them.
If neither works efficiently then I'll just say fuck it and turn on the random start location, it's the easiest way to make the randomization option, triggerless.



None.

Sep 19 2014, 10:10 pm NudeRaider Post #6

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from FlameViper
Also I'm gonna give the players the option to pick both DC random and Switches random, in case shit goes wrong for them.
If neither works efficiently then I'll just say fuck it and turn on the random start location, it's the easiest way to make the randomization option, triggerless.
All of these are complicated, inconvenient or have other problems. I suggest you stick to rockz or my methods.

Quote from FlameViper
Otherwise if I put an objective timer that never changes per game then it'll pick the same player over and over again.
Correct. That's why you should base it on user input. It'll never be at exactly the same time.

Quote from FlameViper
I'm gonna have to give the players the option to end the counter by themselves.
If I understood you correctly, you want to give players a chooser if they can (want to) be the thing or not. This is all user input you need to randomize it. End it when everyone has chosen.

I also just thought of an easy way to further randomize the dc: When players pick whether they want to be the thing or not randomize a switch. If that switch is 1 add 1 to the dc. That way you remove the bias I mentioned in my last post.
To make it foolproof have the trigger that resets the counter from max players to 0 owned by All Players. This is to prevent that the last 2 (ore more) players each choose the same trigger loop and adding 1 to the dc when it's already at max before it's being reset and thus giving lower player numbers a bias.




Sep 23 2014, 6:08 pm FlameViper Post #7



Got it right. I let the DC run continously till one player gets the zergling hero unit, just in case the DC landed on an empty slot.
I'm using hyper triggers so it's doubtful they'll get the rhythm of it. Though I still added your idea to start the DC at a random number every new game with the help of switches, just to not half-ass it.

Now I'm trying to figure out how to let living players vision the dead players, any suggestions?
At the moment I have everyone unvisioned with each other and set to loop.



None.

Sep 23 2014, 6:41 pm Zoan Post #8

Math + Physics + StarCraft = Zoan

you could have a trigger like this for vision:

For Force 1 (or whatever force the players are in):
Conditions:
Current Player suffers exactly 1 death of "whatever unit everyone is"
Action:
Run AI Script "TURN ON shared vision for Player 1"
Run AI Script "TURN ON shared vision for Player 2"
Run AI Script "TURN ON shared vision for Player 3"
Run AI Script "TURN ON shared vision for Player 4"
.
.
.
Run AI Script "TURN ON shared vision for Player 7"
Preserve Trigger

That will give anyone who dies vision of Players 1, 2, 3, 4, etc.

It would also help if for the "Turn OFF shared vision for Player -whatever-" you have running constantly, if you set it so that it only ran when that player suffered exactly 0 deaths of whatever unit everyone is using.



\:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

Sep 25 2014, 1:43 am rockz Post #9

ᴄʜᴇᴇsᴇ ɪᴛ!

Zoan's got it.

If the player can die through unnatural means (trigger "kills" unit), the "death" will not work. It may be better to use a separate trigger such as commands exactly X units (bring will work too, but it's a slower condition). If a player will always have a civilian on the map as a chooser/UI option, then they will never command 0 units, so you'll need to account for that minimum. Or you can command exactly 0 of the particular unit composition that may die.



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

Sep 26 2014, 3:23 pm FlameViper Post #10



Got the manual vision thing to work exactly how I wanted, used 56 triggers 7x8 players.
Now any ideas for re-allying once a marine enters the zergling's location and leaves?



None.

Sep 26 2014, 3:58 pm Zoan Post #11

Math + Physics + StarCraft = Zoan

Quote from FlameViper
Got the manual vision thing to work exactly how I wanted, used 56 triggers 7x8 players.
Now any ideas for re-allying once a marine enters the zergling's location and leaves?

Do you mean re-ally just once, or constantly?

If it's constantly:

condition:
Current Player brings at least 1 "player unit" to "location zergling"
Action:
Set alliance status: set Player -whatever- to enemy
Preserve trigger

AND

condition:
Current Player brings at most 0 "player unit" to "location zergling"
Action:
Set alliance status: set Player -whatever- to ally
Preserve Trigger



If it's just once:

condition:
current player brings at least 1 "player unit" to "location zergling"
current player suffers at most 0 deaths of "death counter unit (can be any unit that isn't used on the map)"
actions:
set alliance status: set "Player -whatever-" to enemy
set deaths for current player set to 1 for "death counter unit"
preserve trigger

AND

condition:
current player brings at most 0 "player unit" to "location zergling"
current player suffers at least 1 deaths of "Death counter unit"
actions:
set alliance status: set "player -whatever-" to ally
set deaths for current player set to 0 for "death counter unt"
preserve trigger



\:rip\:ooooo\:wob\:ooooo \:angel\: ooooo\:wob\:ooooo\:rip\:

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
[01:05 am]
Vrael -- that's better
[12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[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
[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
Please log in to shout.


Members Online: No-Name-Needed-II, Roy, Excalibur