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

Back* from the grave

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

OVERWATCH STATUS GO

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\:
My Overwatch addiction.

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

OVERWATCH STATUS GO

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\:
My Overwatch addiction.

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

OVERWATCH STATUS GO

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\:
My Overwatch addiction.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:05 am]
O)FaRTy1billion[MM] -- the setting exists, it's just hidden in a weird place
[04:04 am]
O)FaRTy1billion[MM] -- instead change "Microtile Overlay" to "Impassable"
[04:04 am]
O)FaRTy1billion[MM] -- er, wait, idk why i was looking for height
[04:03 am]
O)FaRTy1billion[MM] -- below the minimap should be a thing that says "Overlay Settings" with a little + button in the corner, press the + to expand it, uncheck Use Defaults, then change "Tile Overlay" to "Height"
[03:57 am]
Sylph-Of-Space -- Unless I'm dum (possible)
[03:57 am]
Sylph-Of-Space -- It would be so so so nice if SCMDraft had some kind of dedicated "walkability" view for the tilesets.
[03:53 am]
Sylph-Of-Space -- :'( dont cry for me cat-gentina
[09:18 pm]
Ultraviolet -- 🔪🐈
[12:34 pm]
NudeRaider -- curiosity kills the cat!
[2024-5-19. : 6:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
Please log in to shout.


Members Online: Roy