Spawning Units 5 out 1 one different.

W

WithoutD

Guest
Spawning Units 1 out of 5 becomes different.

I have read through the forum and found 1 that had to do with this. But it didnt tell me anything at all about how to make it to begin with. I want to know the STEPS for the trigger to make 1 out of 5 units spawns a different unit out of the others for the players. For example, if it was a tag game, someone randomly was it and the rest are all runners.

This goes with what variables you used and what you named them. Also the triggers you have used. For example, Actions - set property - and so on. Please help me soon, I really want to get the other triggers started very soon and I'm stuck on only this one. Thanks.
 
No unneeded posts please.



What you want to happen if there's only 3 players?


Code:
Test1in5
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                        ((Picked player) slot status) Equal to Is playing
                    Then - Actions
                        Unit - Create 1 Footman for (Picked player) at ((Picked player) start location) facing Default building facing degrees
                        Player Group - Add (Picked player) to Players
                    Else - Actions
        Set Player = (Random player from Players)
        Unit Group - Pick every unit in (Units owned by Player of type Footman) and do (Actions)
            Loop - Actions
                Unit - Remove (Picked unit) from the game
        Unit - Create 1 Rifleman for Player at (Player start location) facing Default building facing degrees

Used variables:

"Player", of type "Player",
"Players", of type "Player group".

"Footman" is what everyone gets, "Rifleman" is for one player only, choosen at random.
 
Thanks for the trigger, I'll test it out. I'll tell you what happened and if it worked.
 
Would the trigger change if I wanted (1 tagger) and (1 stalker) and rest runners?
 
And the trigger you sent me didnt seem to work.. then again I tested by deleting the condistions and testing with computers. Send me a better way to test it... please..
 
Don't triple post. Read the form rules if you haven't yet.

Other than that, you may want to post your trigger here.
Someone might see something there.
 
Well the thing is, your trigger did not work and I tierd over 20 ways to make 1 out of 5 units spawn a different unit. I have no trigger to begin with, which is why I'm asking for help.
 
Well, "It doesn't work" is not a very good problem description :)

What's supposed to happen if you only have 3 players? 1 out of 3?
What about 10 players? Still only 1 out of 10? Or 2 of 10?
No matter how many players, every 5th gets a different unit? If there's 8 players?

> Would the trigger change if I wanted (1 tagger) and (1 stalker) and rest runners?

Yes.
There too, how exactly do you want to set this up if there's, for example, 7 players?
 
Alright, its like this. If there is 3 players. There is 1 tagger and 1 stalker and the other is the runner. If there were more players, there will still be 1 tagger, but there will be a greater number of stalkers and the rest are runners.

Alright for example, If there are 4 people. 1 is a tagger, 1 is a stalkers, rest are runners. This will be the lowest cap of stalkers, any people lower then four will still be 1 tagger, 1 stalker, rest are runners. So if its 3 people there will still be 1 tagger 1 stalker and the rest runners. If there would be less then 3 people then trigger wont work and you cant play the game.

After that, Lets say there is 5 people, 1 tagger (tagger will always be 1 and random), 2 stalkers (also is gonna be random), and rest runners. Now if the number of players increase the stalker amount is gonna increase by 1. So if there is 6 people then there will be 3 stalkers.

I'm pretty sure this is gonna be a hard trigger... so I understand if it isnt possible or if you dont know how to do it.
 
The actual trick is to get the numbers right:

Code:
 P  T  S  R

 3  1  1  1
 4  1  1  2
 5  1  2  2
 6  1  3  2
 7  1  3  3
 8  1  3  4
 9  1  3  5
10  1  3  6
11  1  3  7
12  1  3  8

Where:
P = number of players
T = number of taggers
S = number of stalkers
R = the rest, runners

Position 6 looks a bit out of place...

But, well, like this? Or somehow somewhat different?
 
That would be perfict! If you know the trigger, that would be very helpful for my map! Also you do know that the 1 tagger will be a random player and so would the stalkers be random players.
 
Code:
TaggersAndOthers
    Events
        Map initialization
    Conditions
    Actions
        -------- Get a list of players --------
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                        ((Picked player) slot status) Equal to Is playing
                    Then - Actions
                        Player Group - Add (Picked player) to Players
                    Else - Actions
        -------- Not enough players? --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of players in Players) Less than 3
            Then - Actions
                Player Group - Pick every player in Players and do (Actions)
                    Loop - Actions
                        Game - Defeat (Picked player) with the message: Three or more players required
            Else - Actions
        -------- 1 Tagger --------
        Set Player = (Random player from Players)
        Unit - Create 1 Footman for Player at (Player start location) facing Default building facing degrees
        Player Group - Remove Player from Players
        -------- Number of Stalkers for a given number of players --------
        Set Stalkers[3] = 1
        Set Stalkers[4] = 1
        Set Stalkers[5] = 2
        Set Stalkers[6] = 3
        Set Stalkers[7] = 3
        Set Stalkers[8] = 3
        Set Stalkers[9] = 3
        Set Stalkers[10] = 3
        Set Stalkers[11] = 3
        Set Stalkers[12] = 3
        -------- Stalkers --------
        For each (Integer A) from 1 to Stalkers[(Number of players in Players)], do (Actions)
            Loop - Actions
                Set Player = (Random player from Players)
                Unit - Create 1 Rifleman for Player at (Player start location) facing Default building facing degrees
                Player Group - Remove Player from Players
        -------- Runners (whatever players are left) --------
        Player Group - Pick every player in Players and do (Actions)
            Loop - Actions
                Unit - Create 1 Night Elf Runner for Player at (Player start location) facing Default building facing degrees

Variables used:

"Player", of type "Player"
"Players", of type "Player - group"
"Stalkers", of type "Integer", is an array with size 12

Example, "Set Stalkers[7] = 3" means that, if we have 7 players, then we want 3 "stalkers".

Yes, this is totally random.


Good luck in typing that monster back in :)
 
Thank you so much, I hope it will work! I'll edit this when I'm done with all those triggers, and tell you how its going.

Edit: Alright, just saw something out of place, I just want 11 people so all I do is delete the set stalker 12 variable? Because I want 1 to be a computer and not be playing or anything in the game just so it will be 2 forces so I can play the game. For example, I cant start game because it says I need 2 forces.

Also, something isnt working right, when I created the same with 3 real players I had 2 footman, someone else had 1 footman, and 1 had rifleman. There was no stalker. Please tell me what to fix with my code.

Code:
Major Triggers
    Events
        Map initialization
    Conditions
    Actions
        -------- Get a List of Players --------
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                        ((Picked player) slot status) Equal to Is playing
                    Then - Actions
                        Player Group - Add (Picked player) to Players
                    Else - Actions
                        -------- Not Enough Players? --------
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of players in Players) Less than 3
                            Then - Actions
                                Player Group - Pick every player in Players and do (Actions)
                                    Loop - Actions
                                        Game - Defeat (Picked player) with the message: Three or more playe...
                            Else - Actions
                                -------- 1 Tagger --------
                                Set Player = (Random player from Players)
                                Unit - Create 1 Footman for Player at (Player start location) facing Default building facing degrees
                                Player Group - Remove Player from Players
                                -------- Number of Stalkers for a Given Number of Players --------
                                Set Stalkers[3] = 1
                                Set Stalkers[4] = 1
                                Set Stalkers[5] = 2
                                Set Stalkers[6] = 3
                                Set Stalkers[7] = 3
                                Set Stalkers[8] = 3
                                Set Stalkers[9] = 3
                                Set Stalkers[10] = 3
                                Set Stalkers[11] = 3
                                Set Stalkers[12] = 3
                                -------- Stalkers --------
                                For each (Integer A) from 1 to Stalkers[(Number of players in Players)], do (Actions)
                                    Loop - Actions
                                        Set Player = (Random player from Players)
                                        Unit - Create 1 Rifleman for Player at (Player start location) facing Default building facing degrees
                                        Player Group - Remove Player from Players
                                        -------- Runners (whatever players are left) --------
                                        Player Group - Pick every player in Players and do (Actions)
                                            Loop - Actions
                                                Unit - Create 1 Peasant for (Picked player) at ((Picked player) start location) facing Default building facing degrees
 
Suggestions in bold.


WithoutD said:
Thank you so much, I hope it will work! I'll edit this when I'm done with all those triggers, and tell you how its going.

Edit: Alright, just saw something out of place, I just want 11 people so all I do is delete the set stalker 12 variable? Because I want 1 to be a computer and not be playing or anything in the game just so it will be 2 forces so I can play the game. For example, I cant start game because it says I need 2 forces.

Also, something isnt working right, when I created the same with 3 real players I had 2 footman, someone else had 1 footman, and 1 had rifleman. There was no stalker. Please tell me what to fix with my code.

Code:
Major Triggers
    Events
        Map initialization
    Conditions
    Actions
        -------- Get a List of Players --------
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                        ((Picked player) slot status) Equal to Is playing
                    Then - Actions
                        Player Group - Add (Picked player) to Players
                    Else - Actions

[b]
This part here is NOT inside the "else" from up.
It's in the same line as "Player group"
[/b]

                        -------- Not Enough Players? --------
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of players in Players) Less than 3
                            Then - Actions
                                Player Group - Pick every player in Players and do (Actions)
                                    Loop - Actions
                                        Game - Defeat (Picked player) with the message: Three or more playe...
                            Else - Actions

[b]
Here too.
The tagger part is NOT inside the "else", the else is empty.
[/b]

                                -------- 1 Tagger --------
                                Set Player = (Random player from Players)
                                Unit - Create 1 Footman for Player at (Player start location) facing Default building facing degrees
                                Player Group - Remove Player from Players
                                -------- Number of Stalkers for a Given Number of Players --------
                                Set Stalkers[3] = 1
                                Set Stalkers[4] = 1
                                Set Stalkers[5] = 2
                                Set Stalkers[6] = 3
                                Set Stalkers[7] = 3
                                Set Stalkers[8] = 3
                                Set Stalkers[9] = 3
                                Set Stalkers[10] = 3
                                Set Stalkers[11] = 3
                                Set Stalkers[12] = 3
                                -------- Stalkers --------
                                For each (Integer A) from 1 to Stalkers[(Number of players in Players)], do (Actions)
                                    Loop - Actions
                                        Set Player = (Random player from Players)
                                        Unit - Create 1 Rifleman for Player at (Player start location) facing Default building facing degrees
                                        Player Group - Remove Player from Players

[b]
Same here.
Runners is NOT part of the "for each".
[/b]

                                        -------- Runners (whatever players are left) --------
                                        Player Group - Pick every player in Players and do (Actions)
                                            Loop - Actions
                                                Unit - Create 1 Peasant for (Picked player) at ((Picked player) start location) facing Default building facing degrees



> I just want 11 people so all I do is delete the set stalker 12 variable?

Yes.
But, then, that's not even needed...

And, who knows, maybe, some day your map might support 12 players,
in which case you'll have to remember to put it back in... :)
 
Alright tell me if this is the way you wanted it. Also, should I leave the varaible for the 12 people? Would it matter even?

Code:
Major Triggers Copy
    Events
        Map initialization
    Conditions
    Actions
        -------- Get a List of Players --------
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                        ((Picked player) slot status) Equal to Is playing
                    Then - Actions
                        Player Group - Add (Picked player) to Players
                    Else - Actions
        -------- Not Enough Players? --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of players in Players) Less than 3
            Then - Actions
                Player Group - Pick every player in Players and do (Actions)
                    Loop - Actions
                        Game - Defeat (Picked player) with the message: Three or more playe...
            Else - Actions
        -------- 1 Tagger --------
        Set Player = (Random player from Players)
        Unit - Create 1 Footman for Player at (Player start location) facing Default building facing degrees
        Player Group - Remove Player from Players
        -------- Number of Stalkers for a Given Number of Players --------
        Set Stalkers[3] = 1
        Set Stalkers[4] = 1
        Set Stalkers[5] = 2
        Set Stalkers[6] = 3
        Set Stalkers[7] = 3
        Set Stalkers[8] = 3
        Set Stalkers[9] = 3
        Set Stalkers[10] = 3
        Set Stalkers[11] = 3
        Set Stalkers[12] = 3
        -------- Stalkers --------
        For each (Integer A) from 1 to Stalkers[(Number of players in Players)], do (Actions)
            Loop - Actions
                Set Player = (Random player from Players)
                Unit - Create 1 Rifleman for Player at (Player start location) facing Default building facing degrees
                Player Group - Remove Player from Players
        -------- Runners (whatever players are left) --------
        Player Group - Pick every player in Players and do (Actions)
            Loop - Actions
                Unit - Create 1 Peasant for (Picked player) at ((Picked player) start location) facing Default building facing degrees
 
Like I wanted? :confused: :p

Yes, looks familiar.
No, doesn't matter. Well, it's one action less...


Then, of course, the final question?

Does it work?
As you think it should?
 
something is wrong, when I test it I get 2 footman and a random player gets a footman. Also, I cant even click on the units. Maybe its a bit to many triggers in 1 place? When I try it out on Bnet the same thing happens with the footman but instead a warcraft error pops-up too and warcraft closes. Also no peasants spawn or riflemen. Just 2 footman for me and 1 random one.

You think I should try making them all seprate triggers? Also, it was very laggy in the test mode of warcraft editor.
 
Uhm... ? :confused:

What test setup are you using?
What you mean "the map crashes"?

Unless your map is to be kept totally undisclosed, I'd suggest you post it here...
 
in bnet, when I play the game with real people the game crashes. Want me to send you the map? In test in map editor the triggers dont work right.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    Mayo also has vinegar. Vinegar is a very important part of it, it's effectively a delivery method FOR vinegar but hidden
    +1
  • Varine Varine:
    It's a neat ingredient. But yeah it's eggs. But a LOT of people think eggs count as dairy because of the fucking food pyramid the US keeps trying to make a thing
  • Varine Varine:
    I think on the new one they did change it, but idk. I don't really care whatever the government is doing right now because it's consistently absurd. Like what is RFK doing in charge of health anything? I love the bear story because WTF was that, but also, pretty much every time he talks it's WTF. Like even his voice sounds microwaved
    +1
  • Varine Varine:
    The pyramid is fucking dumb as shit, no matter how you arrange it.
  • Varine Varine:
    It's actually remarkably easy to make mayonnaise though. Fun fact, it USED to kind of be a French mother sauce. I believe that Careme considered it one, it may have been aioli but that has also built a different meaning than it used to. An aioli is just mayonnaise I mixed with other shit typically, I didn't start it don't come at me
  • Varine Varine:
    It's very hard to do it on a large scale though
  • Varine Varine:
    Depending on how you pour the oil the consistency can vary wildly, but that's true for most emulsions. I can only make about two quarts at a time with my robo coup, and if I have to make several in series because I forgot to order it becomes really obvious even when I do it. We have to wait and mix them all together to make sure we have the same thing.
  • Varine Varine:
    Hollandaise is also kind of like that, emulsions require a very steady hand to do exactly the same every time.
  • Varine Varine:
    Luckily I live in an age with electricity so it's way fucking faster, but when I was just a boy trying to find my place I had some hardcore chefs that made use do things like that by hand. It is WAY easier to get right by hand because you control it and can feel it, but it takes soooooo much longer. And on the scale a modern kitchen requires... I serve 400-500 guests on average per day right now, if I had 100 then we could do things way better
  • Varine Varine:
    But we can't do that. In the winter yeah, but I HAVE to get people through here right now so I can afford the staff that we CAN do that. We have about 100 days of summer, and if that summer doesn't make us what it will, then I can't operate the other most of the year with my staff. The owner is talking about closing two days a week to cut down on labor, I told him he should cut down on vacations and it did not go great. I do think I won though, I have to keep my fucking core staff and they have to be gainfully employed
  • Varine Varine:
    Sure some of them might take a second job, but I can't just cut my entire staff to unlivable hours, nor can I can cut them off all winter if I want them to come back.
  • Varine Varine:
    And also, there is no fucking way I'm pulling these hours come september. I only do this right now because I have to, the second I don't have to be the one doing it I won't be
  • Varine Varine:
    I have a 5 person core staff in the kitchen, not including me or Chef Ben
  • Varine Varine:
    Though two of those people are likely not making it this year. One of them has been replaced, the other I am kind of trying to. He's being a giant bitch, today I had to get onto him because in the three hours before I left he had taken like thirty minutes for cigarette breaks
  • Varine Varine:
    And he was also complaining to me the other day that he was out of weed so couldn't smoke any before work that day, and was confused about why I was annoyed he was telling me, his boss, that he is smoking weed everyday before work.
    +1
  • Varine Varine:
    Like yeah I can tell. I don't need to fucking know.
  • Varine Varine:
    So now he's getting scrutinized and will not be top of the list. I know I don't have the smartest people but I do expect them to have some common fucking sense
  • Varine Varine:
    I did do a rare thing for me and hire a girl last month without warning. Everyone was made at me because I started her at like 21, but she worked with me before and I was like don't care. She made 19 at her old job and I wanted her to come work with me, she is the best
    +1
  • Varine Varine:
    I'm going to get her a raise at the end of the summer. She wants to go to school again, but I want her to still work with me so.... she kind of can just tell me what the price is. I can go to 25 if she keeps up. I need to get her onto line more, that's what she wants, but I need her where she is and it's not fair that she doesn't get the little bit of raise that comes with it. She can do it no problem, I've worked with her there.
  • Varine Varine:
    It's just hard to move and train people unnecessarily right now. And also the line fucking sucks, it's not any more fun. This is turn and burn so I have the bankroll, and everyone suffers for it
  • Varine Varine:
    Eventually we'll get it balanced, we'
  • Varine Varine:
    we're starting online orders and stuff, but I also turn that off all the time because I barely keep up trying to be the best at Sysco shit
  • Varine Varine:
    I think it's gonna be a good fall and winter though. We're going to have a good staff, they will get along, they will be able to manage the workload and the complications, they know how to really cook this year, like every person on line knows their steak temps. Some of them use thermometers a lot and they don't always use them right, but they do know how to do it. Failure, especially in this field, is the only way to get better. They'll get it
  • Varine Varine:
    They won't get feel down while they do the thermometer, but we didn't have an instant read probe when I was learning. Like they did but god knows how off it is, you HAD to do it by feel. Even if the chef was fine with me bringing my own, it takes too long. Poke and know
  • The Helper The Helper:
    420 threads in the Artificial Intelligence forum :)

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top