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.
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
Please log in to shout.


Members Online: Ultraviolet