[SOLVED] Spawn Rotation
Topic LockedTopic Locked
Ok my brain is fried right now and i'm overly tired. What i'm trying to do is set up a spawning system that adjusts when theres uneven players.
So right now theres...
3 players on force 1, a computer on force 2 which is allied with force 1
3 players on force 3 ,and a computer on force 4 allied with force 3.
players from force 1 spawn units for force 2 when a timer reaches 0 vice vera for the opposite team.
Now, onto how i want the spawning to be.
F1 has 3 players F3 has 3 players -- everyone spawns
F1 has 2 players F3 has 3 players -- F1 everyone spawns F3 2 players spawn cycling so that 1 player gets a turn with no spawn
F1 has 1 player F3 has 3 players -- F1 spawns F3 each player takes turns spawning
F1 has 2 players F3 has 2 players -- everyone spawns
F1 has 1 player F3 has 1 player -- everyone spawns
there is also a leaderboard implemented into this showing who spawns next which i need a hand with as well.
The forementioned is obvioustly for when Force 1 is shorthanded, i was thinking to use opponents for the conditions and death counters in the actions but right now i cant think of how to combo it all together. Anyways i'm going to catch some sleep, hope to have an answer when i wake up
I think the best way to do this is like clockwork. Run a trigger that rotates spawn for each of the forces separately. The rest will take care of itself.
× ÷ ± · ∫ ƒ | ⅛ ¼ ⅓ ⅜ ½ ⅝ ⅔ ¾ ⅞ | π φ ∞ | ≡ ≈ ≥ ≤ ∴ ¬ ∩ Ø | √ ª ⁿ º ¹ ² ³ | ✓ ✗ | א
α β Γγ ∆∂ ε ζ η Θθ Ιι κ Λλ μ Ξξ Π ρ Σσς τ υ Φ Ψψ Ωω
You're not old until the past seems more fun than the future.
So you want all players to spawn each turn, but let one player sit out rotating through the force when there's a 2v3 and even 2 players that don't spawn in case of a 1v3.
This requires several death counters to keep track of things and good deal of thought for the complete system. Certainly no task for a sleepy night. I'll walk you through, feel free to ask where you don't understand. Let's get started.
Note that most of the system will be handled by the P8 computer because he's always there and his triggers run last. (Triggers are executed player by player, which means first all of P1's triggers run, then all of P2, etc.)
First you need to detect how many players there are. I'd do that by having a trigger owned by all players that sets a dc to 1 for Current Player at game start:
Then, depending on the dc counts for Force1 and Force3 you give out "spawning tokens" for the other force:
Force 1 has 1 enemy => 1 dc 'spawn token' (P4)
Force 1 has 2 enemies => 2 dc 'spawn token' (P4)
Force 3 has 1 enemy => 1 dc 'spawn token' (P8)
P8 will store the spawn tokens for Force 3, P4 will store Force 1's tokens.
In trigger form:
This even accounts for leavers because the dc of absent players is not counted towards the force total.
Now you need a way of telling which players have to sit out. I'm also going to use a token system based on dcs. Every player gets a token which is removed when they spawn. Only when the whole force ran out of tokens new tokens will be distributed. (which may take up to 2-3 spawning rounds)
Finally on to the actual spawning triggers:
Keep in mind that this system in its basic form requires the spawning to happen within 1 trigger loop. If for any reason your spawning (the unit creation, not the cooldown between spawns) would take longer you'd have to delay the handing out of new tokens. Use the negative of the [spawning event] as a condition, for example.
Also be aware of this bug, so you can fix it: In a 2v3 situation P1, P2 and P5, P6 will spawn the first round, P3 has to sit out. Next round P1 and P2 both won't have a token, because P3 still has one, so P8 won't refresh yet. Which results in only P3 spawning. However Force 1 still has 1 death of 'spawn token'. So whenever P8 detects that Force 1 has at 1 death of 'spawn token' set the [spawning event] to true for Force 1. If it's a global event you can do an extrordinary spawn units trigger that covers this case.
Anyhow, using that fix the P1's spawning will lag 1 trigger loop behind P3's. If that's a problem we can add a bunch of triggers to the token distribution system to always update in time. But for the sake of better understanding I chose to keep it simple fow now.
Hi staxx ive xplained you the way in our channel. But im gonna xplain it here also
As nuderaider said you need 6 triggers for uneven number of players in the game, 3 for top 3 for bottom. you know how those triggers would look like.
then you need 3 triggers for each team that gets activated after the spawn. notice these are only activated if 1 of them 6 uneven player triggers are set. For xample its 3player at bottom team and 2 player at top team then 1 trigger of uneven number players activated and sets 1 trigger here after the spawn. the point of this trigger is now to set individual player triggers so that only 2 players from bottom team spawns and 1 sit out. the sit out needs to be changed from player 1 to the next player sitting out. this is where them individual triggers are needed.
you need 3 individual triggers for each scenario on both top and bottom teams. these will do so the sit out changes for each spawn. they are made by death count. so at ur spawn triggers u need have this death count in your conditions. so players only spawn if they are set to 0 death count. now the individual sit out triggers beeing activated after each spawn and sets death for each individual player.
Ill put up xample on the triggers for 1 scenario
note:is a unit is created from start for each player (the ban player unit- kerrigan)
description: 3v2 scenario
condition: top team(force) brings precise 2 kerrigans and bottom team(force) brings precise 3 to location ban area
action: set deathcount 1 out 6
description: set sit out triggers bottom
condition: the death count 1 is set
action: set death count 1 out of 3(start individaul sit out trigger death count), clear death count 1 out of 6, set individual deathcount spawn player1 to 1, set individual deathcount player spawn 2 to 0, set individual deathcount spawn player 3 to 0
description: sit out individual triggers player1
condition: after the spawn(could be bring 0 buildings), start indivual player death count is set 1 out of 3, p1 death count spawn is set 0, p2 death count spawn is set 0, p3 death count spawn is set 1
action: set death count spawn p1 to 1, set death count spawn p2 to 0, set death count spawn p3 to 0, preserve trigger
description: sit out individual triggers player2
condition: after the spawn(could be bring 0 buildings), start indivual player death count is set 1 out of 3, p1 death count spawn is set 1, p2 death count spawn is set 0, p3 death count spawn is set 0
action: set death count spawn p1 to 0, set death count spawn p2 to 1, set death count spawn p3 to 0, preserve trigger
description: sit out individual triggers player3
condition: after the spawn(could be bring 0 buildings), start indivual player death count is set 1 out of 3, p1 death count spawn is set 0, p2 death count spawn is set 1, p3 death count spawn is set 0
action: set death count spawn p1 to 0, set death count spawn p2 to 0, set death count spawn p3 to 1, preserve trigger
ps. I like your good work nuderaider. Are you ever online on sc anymore nuderaider??
This post was edited 2 times, last edit by GGmano: May 10 2012, 4:52 pm.
Ahhh NudeRaider, just the person i was hoping to hear from.
I had started on something right before i saw your message on here, and just finished off with it. (It uses a bit of what you had suggested to me as well as what GGmano had discussed with me over b.net in combination with what i had already started on)
When scenarios occur (3v2, 3v1, 2v2, 2v1, 1v1) -- "Spawn Me" gets redistributed to each force accordingly.
P4 controls the spawn rotation for F1 in circumstances that the scenario be 3v2 and 3v1 (F1 having the 3) This gets triggered by a death count when the timer reaches 0
looks something like this in a 3v2 scenario...
The above is also the method used in a 3v1 scenario.
Onto The 2v1 Scenario....
This one is triggered by individual players
Sound solid? BTW Nude this is a new variation of DS i'm making
This post was edited 5 times, last edit by staxx: May 11 2012, 6:56 pm.
Don't think thats an issue, as if i put to add 1 then each player would end up with 3 death counts. set insures that it stays at 1 when the trigger is activated over 3 players.
Anyways to update, i've tested my triggs out and they failed I'm going to guess its my subtract 1 from current thats messing everything up as when i started it up 3v2 i got a message twice notifying of uneven spawn detected. If this is the case i'm guessing im going to have to set individual triggers within each player to detect who to subtract from. i'll check back when i wake up to see what suggestions you guys may have.
You're not old until the past seems more fun than the future.
The first trigger gives only Force 1 and their allied computer player deaths of 'I'm here'. Dunno if this is intentional. If it is, you need a 2nd trigger for Force 3.
Also currently you have it as 'set to 1' which means first player in Force 1 runs it, sets everyone of Force 1 & 2 (=P1-4) to 1, then the next player of Force 1 does the same again, etc.
This doesn't make sense, unless you meant add?
If you take add your first trigger would set F1's dc to the number of human players. Dunno how this is useful because you need keep track of the player numbers per force, no?
Anyways, gotta go now. But I'll analyze the rest later.
The problem is that he has eaasy system for player spawn turns (3v3 theres no system for each player all spawn at the clock of 0) and then on leaves or uneven scenarios he want a pretty complicated spawn system to start. by complicated i mean it would take up less triggers to start individual spawns. havin 2 player spawn out of 3 player in 1 scenario and 1 out of 3 in another. This system therefore needs a set of spawn system(sitout) triggers for all them scenario that can occur.
I did actually think out the system and if he did use the guide i told him it would work (but hes lazy, he wants it done by less triggers)
i put down complete system as short as possibel:
You need 6 triggers for uneven scenarios (them first triggers that i told him make add force or set current). (the deathcount these triggers sets i call = special scenario )
You need 6 triggers to start up the system ( or implement start up system in them 6 triggers above ) by start up system all players should have a death count set
death count systems start: (deathcount are set for players on the team with most players) (deathcount name = rotate tokens)
(3v2 special scenario 1) p1 0, p2 0, p3 1
(3v1 special scenario 2) p1 0, p2 1, p3 1
(2v1 special scenario 3 ) add one death for force bottom(current player) and in condition put suffered at most 0 of death = only will fire once as soon as one player on bottom team has 1 death the trigger will no longer fire. Or use switch to make it only fire one time
(2v3 special scenario 4) p5 0, p6 0, p7 1
(1v3 special scenario 5) p5 0, p6 1, p7 1
(1v2 special scenario 6) add one death for force top(current player) and in condition put suffered at most 0 of death = only will fire once as soon as one player on top team has 1 death the trigger will no longer fire. Or use switch to make it only fire one time
Now the spawn system starts when uneven scenarios happen, and theres need for a rotate system that action each time clock hits 0 ( each spawning session )
an preserve rotate system that keeps setting players death:
........ Same with scenarios 4,5,6 just on top team
Note: you might need switch to assure that those triggers only fire one time each time clock hits 0(spawn seesion)
This post was edited 2 times, last edit by GGmano: May 12 2012, 9:19 am.
@ NudeRaider - Basically, the game is set with 3 players on each team and 1 computer for each team just like original desert strike.
Now, on this version when its 3v3 and the timer reaches 0 instead of just one person spawning for each team, all 3 players on each team spawn at the same time.
When someone leaves the game, it becomes 3v2. So to make things even, i would like the team that has the 2 players to spawn both players and the team that has 3 players to spawn 2 players while 1 person on the team of 3 sits out and that sit out gets rotated through the entire team of 3.
Someone leaves again and makes the game 3v1. Same idea except now 2 people sit out on the team of 3 and gets cycled.
Timer Reaches 0
3Top vs 3Bottom = 3 Top Team Spawn - 3 Bottom Team Spawn
3Top vs 2Bottom = 2 Top Spawn 1 Top Sit Out - 2 Bottom Spawn
3Top vs 1Bottom = 1 Top Spawn 2 Top Sit Out - 1 Bottom Spawn
@GG - I'll give it a shot, we'll test tonight if you're on.
Everything is up and working now, thank you everyone.
This post was edited 2 times, last edit by staxx: May 13 2012, 5:19 am.