Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Give Units trigger problem
Give Units trigger problem
Sep 7 2009, 5:08 pm
By: dpp89  

Sep 7 2009, 5:08 pm dpp89 Post #1



Ok so, I'm experiencing a problem with triggers (lol).
If a player dies, all his units are killed. Even the unit that starts the round.
So, to make up for this, I created a way to give the next player in line the starter. This is my trigger that I'm using:

Quote
Trigger("Player 1"){
Conditions:
Command("Player 1", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 1", "Samir Duran (Ghost)");
Create Unit with Properties("Player 2", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}

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

Trigger("Player 2"){
Conditions:
Command("Player 2", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 2", "Samir Duran (Ghost)");
Create Unit with Properties("Player 3", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}

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

Trigger("Player 3"){
Conditions:
Command("Player 3", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 3", "Samir Duran (Ghost)");
Create Unit with Properties("Player 4", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}

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

Trigger("Player 4"){
Conditions:
Command("Player 4", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 4", "Samir Duran (Ghost)");
Create Unit with Properties("Player 5", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}

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

Trigger("Player 5"){
Conditions:
Command("Player 5", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 5", "Samir Duran (Ghost)");
Create Unit with Properties("Player 6", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}

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

Trigger("Player 6"){
Conditions:
Command("Player 6", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 6", "Samir Duran (Ghost)");

The Protoss Cybernetics Core is pre-placed so that if a player isn't present (slot was unfilled or closed) the Protoss Cybernetics Core doesn't exist. When P1 dies, everything is killed (including the Protoss Cybernetics Core). So, if you look at the triggers, it should give P2 the next "starting" unit (in this case, Samir Duran [still Terran] is the unit that triggers the next round). Well, it does, and it works perfectly fine. Whats the problem here? If P2 leaves or isnt there (slot closed/unfilled), it still gives him the starter unit without killing it. P2 has no Protoss Cybernetics Core, so why doesn't it kill it and move on to the next player? Should I use Preserver Trigger on this?

EDIT: If someone has a simpler way, I'll try it. =)

Post has been edited 1 time(s), last time on Sep 7 2009, 5:27 pm by dpp89.



None.

Sep 7 2009, 5:45 pm lil-Inferno Post #2

Just here for the pie

This should work...

If this doesn't work for you, then maybe I just don't get your triggers or what you're trying to do.




Sep 7 2009, 5:58 pm poison_us Post #3

Master has given Dobby a doctorate! Dobby is free!

You can always create a unit for a player, if no human is in the slot. Inferno's should work because it's checking for each previous player's preplaced units, and using a deathcount as a switch.




Sep 8 2009, 4:48 pm dpp89 Post #4



Quick question: What's "cave" ?



None.

Sep 8 2009, 4:53 pm darksnow Post #5



its a special unit thats usually used for death counts.

im pretty sure if you preplace it and look at it in game, you crash



None.

Sep 8 2009, 9:57 pm lil-Inferno Post #6

Just here for the pie

Quote from dpp89
Quick question: What's "cave" ?
"Cave" is the death counter/statistic keeper I used. It's an invalid unit that never comes into play, so it's perfect for death counts.




Sep 8 2009, 11:11 pm theleo_ua Post #7



1) In all your triggers, where you give somthing to player X, you can detect, is player X in game or not (if you dont know how to do this - I can say how)

2) Check this trigger:

Players: P1 P2 ... P6

Conditions: bla bla bla

Actions: Give 1 Marine to Current Player

This trigger never gives Marine to "not existing in game" player, because "Current Player" is always present in the game.

Example:

Trigger("Player 2"){
Conditions:
Command("Player 1", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 1", "Samir Duran (Ghost)");
Create Unit with Properties("Current Player", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}

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

Trigger("Player 3"){
Conditions:
Command("Player 2", "Protoss Cybernetics Core", Exactly, 0);

Actions:
Kill Unit("Player 2", "Samir Duran (Ghost)");
Create Unit with Properties("Current Player", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}


etc

3) Add special condition:

Trigger("Player 1"){
Conditions:
Command("Player 1", "Protoss Cybernetics Core", Exactly, 0);
Command("Player 2", "Protoss Cybernetics Core", Exactly, 1);

Actions:
Kill Unit("Player 1", "Samir Duran (Ghost)");
Create Unit with Properties("Player 2", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}


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

Trigger("Player 2"){
Conditions:
Command("Player 2", "Protoss Cybernetics Core", Exactly, 0);
Command("Player 3", "Protoss Cybernetics Core", Exactly, 1);

Actions:
Kill Unit("Player 2", "Samir Duran (Ghost)");
Create Unit with Properties("Player 3", "Samir Duran (Ghost)", 1, "Starter Reset", 64);
}


etc


GL



P.S. I prefer method 2 with Current Player



None.

Sep 9 2009, 11:34 am DevliN Post #8

Woah

theleo_ua's second example is probably the simplest and it works (we used something similar in Monopoly). Is there a reason you're creating/killing the starter rather than just giving the unit to a player from P12?



:devlin: Currently Working On: :devlin:
Myself

Sep 9 2009, 2:08 pm Norm Post #9



I would suggest not killing the turn-starter, but rather it will turn to neutral if the person with it leaves game or ends in defeat. All you got to do them is run a trigger that says.

Players:
All possible players that can have the turn-starter.

Condition:
Always.

Action:
Give all turn-starter from neutral to current player at anywhere.
preserve trigger.



None.

Sep 9 2009, 3:55 pm DevliN Post #10

Woah

Wouldn't you need the "Command" condition, still, though? I think it's possible to give units to a dead player, and they just become computer-controlled.



:devlin: Currently Working On: :devlin:
Myself

Sep 9 2009, 3:59 pm rockz Post #11

ᴄʜᴇᴇsᴇ ɪᴛ!

players who aren't there don't run triggers. In Norm's case, if someone leaves, player 1 will get his starter.



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

Sep 9 2009, 4:29 pm DevliN Post #12

Woah

Ah, to "Current Player," right. I skimmed over the trigger details and just saw the "Always" and "Give" and for some reason assumed it was under a neutral player. I need sleep. Damnit.



:devlin: Currently Working On: :devlin:
Myself

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:46 pm]
Ultraviolet -- @:@
@:@ shouted: this community still going strong?
Still going.. strong is debatable though.
[04:13 pm]
WeirdoX4857 -- I can't believe this is really been around since 2003 but it does look classic and old asf still better than talking to kids on discord ranting about skibidi toilet and sexuality or whatever mental illness is going on in their heads
[04:11 pm]
WeirdoX4857 -- Nigga how you ask is it still going strong when you get a text every 3 miles per hour or something
[04:10 pm]
WeirdoX4857 -- Where is everybody
[01:21 pm]
@:@ -- this community still going strong?
[2026-9-27. : 4:30 pm]
Oh_Man -- yeah, probs
[2026-9-27. : 3:11 pm]
NudeRaider -- I bet it just needs another training session against pros instead of only against itself and nobody will be able to stop it anymore.
[2026-9-27. : 3:09 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: pluto vs pro gamer snow: https://youtu.be/NOXXpATkdZU
so it can be beaten by a prepared pro, even in macro games, if only barely. the muta micro in particular seems really hard to handle for protoss ground though. In the open goons can't catch them, in the base they trip over buildings, it just instantly flies out of storms and they fly circles around archons. Mass cannons do work, but can't cover the whole map with it. Probably need mass corsair to counter and hope you can outmaneuver all the scourge.
[2026-9-27. : 2:14 am]
Oh_Man -- pluto vs pro gamer snow: https://youtu.be/NOXXpATkdZU
[2026-9-27. : 1:14 am]
Symmetry -- https://staredit.net/topic/18932/ check it
Please log in to shout.


Members Online: Roy, Prankenstein, DarkenedFantasies