Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: A Player Leaves, How to Make Units Convert?
A Player Leaves, How to Make Units Convert?
Mar 6 2010, 4:20 am
By: rayNimagi  

Mar 6 2010, 4:20 am rayNimagi Post #1



After a player leaves, how do you make the neutral units convert to another player? I want it to be so that whenever a human (players 1-7) leaves, his units convert to the AI (player 8). Currently, this trigger automatically gives control of any human units to the AI regardless whether they are still playing or not (so when the game starts, they control no units). How can I fix this?

Trigger("Player 1","Player 2","Player 3","Player 4","Player 5","Player 6","Player 7","Player 8","Neutral players"){
Conditions:
Bring("Neutral players", "Any unit", "Anywhere", At least, 0);

Actions:
Give Units to Player("Neutral players", "Player 8", "Any unit", All, "Anywhere");
Preserve Trigger();
Comment("give quitter stuff to p8 **wont work");
}

Any help will be appreciated!



Win by luck, lose by skill.

Mar 6 2010, 4:38 am O)FaRTy1billion[MM] Post #2

👻 👾 👽 💪

Use Neutral, not Neutral players.
Neutral is what SCMDraft calls Player 12, and that is the player units are given to when they lose or leave.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Mar 6 2010, 11:01 am NudeRaider Post #3

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

*agrees with Farty*
Btw. it might be a good idea to give units 1 by 1 to the players (instead of all at once to a single player) so it'll be fairly distributed. Be aware however that for many units this might take some time, especially when you're not using hyper triggers.
It's possible to speed it up using more triggers but when you still want to distribute it fairly it gets more complicated. Just ask if you need elaboration.




Mar 8 2010, 1:01 pm LegacyWeapon Post #4



I usually have it like this:
Trigger("All players"){
Conditions:
Always();

Actions:
Give Units to Player("Player 12", "Player 8", "Any unit", All, "Anywhere");
Preserve Trigger();
}

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



None.

Mar 12 2010, 11:47 pm Lethoth Post #5



Quote from NudeRaider
*agrees with Farty*
Btw. it might be a good idea to give units 1 by 1 to the players (instead of all at once to a single player) so it'll be fairly distributed. Be aware however that for many units this might take some time, especially when you're not using hyper triggers.
It's possible to speed it up using more triggers but when you still want to distribute it fairly it gets more complicated. Just ask if you need elaboration.

If you want to fairly distribute the units between the players, make this trigger not shared, individual for each player who will receive the units.

Trigger("Player #"){
Conditions:
Bring("Player 12", "Any unit", "Your game board location", At least, 1);

Actions:
Give Units to Player("Player 12", "Current Player", "Leavers unit that you want", 1, "Your game board location");
Preserve Trigger();
}

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



None.

Mar 13 2010, 12:57 am 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

It makes no difference when you have triggers owned by a force / all players or when you tick all individual players belonging to that group.
StarCraft splits trigger groups up into the individual player anyway when the game starts.
Or in other words: P1-8 = All Players




Mar 13 2010, 10:42 pm Lethoth Post #7



Sorry if I didn't understand your last post, but this is what I understood: you say the trigger I posted needs to be only for All players/Force #?

If that is what you meant, then I say that won't work because it always executes only for Player 1 and having it separated from each player will make it give like this:
Give to p1 > Give to p2 > Give to p3 > Give to p4 > Give to p5 > Give to p6 > Give to p7 > Give to p8 > repeat...

If that is not what you meant, please let me know.



None.

Mar 13 2010, 11:07 pm DavidJCobb Post #8



Posting one trigger for All Players has the exact same effect as posting eight identical triggers for Players 1 - 8.



None.

Mar 14 2010, 4:02 am Heinermann Post #9

SDE, BWAPI owner, hacker.

If you want to give each unit to a random player, then you need to use switch randomization, otherwise it doesn't matter who owns what trigger, the result will be the same(order given to players).




Mar 14 2010, 7:48 am NudeRaider Post #10

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 Lethoth
If that is what you meant, then I say that won't work because it always executes only for Player 1 and having it separated from each player will make it give like this:
Give to p1 -> Give to p2 -> Give to p3 -> Give to p4 -> Give to p5 -> Give to p6 -> Give to p7 -> Give to p8 -> repeat...
It will work. All Players means that this trigger runs for All Players. Not just for player 1. It runs for P1 first and gives him 1 unit, then for P2 gives him another unit, then for P3, etc. until all units have been distributed.

As I said when the map starts StarCraft splits up triggers for Forces and All Players and creates a copy for each player belonging to that group.
So having the trigger owned by All Players is exactly the same as ticking Player 1-8 individually.




Mar 14 2010, 2:34 pm Lethoth Post #11



Quote from NudeRaider
Quote from Lethoth
If that is what you meant, then I say that won't work because it always executes only for Player 1 and having it separated from each player will make it give like this:
Give to p1 -> Give to p2 -> Give to p3 -> Give to p4 -> Give to p5 -> Give to p6 -> Give to p7 -> Give to p8 -> repeat...
It will work. All Players means that this trigger runs for All Players. Not just for player 1. It runs for P1 first and gives him 1 unit, then for P2 gives him another unit, then for P3, etc. until all units have been distributed.

As I said when the map starts StarCraft splits up triggers for Forces and All Players and creates a copy for each player belonging to that group.
So having the trigger owned by All Players is exactly the same as ticking Player 1-8 individually.

Thanks, NudeRaider. I had a really big doubt about this, but now it's solved. Thank you



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:16 am]
Ultraviolet -- Suicidal Insanity
Suicidal Insanity shouted: http://photos.arlinghaus.org/Animals/Species/WesternJackdaw/2019.11.16-FSH_3770-QHD-%7BFA19D1D3-182C-4723-964D-C30A764A7D13%7D.jpg <- Its missing a speech bubble about SCR bad blizzard bad modding good 1.16 good
http://www.staredit.net/uploads/avatars/4811.png?312523688 pretty solid ;)
[02:14 am]
Ultraviolet -- That's supposed to be pr0nogo :P
[12:43 am]
MTiger156 -- Not sure why it takes an ultra-high resolution image of a bird to get that point across, but ok
[06:36 pm]
Suicidal Insanity -- fortheovermind
fortheovermind shouted: my turn rate bar from the Create panel is no longer there. my games are created with the default 12 and i can no longer modify it, what could be causing this?
Known patch bug
[06:07 pm]
Ultraviolet -- lifebot This version appears to be older than the version I already have downloaded (1.5). Why is this one being posted?
[06:03 pm]
Ultraviolet -- Zoan
Zoan shouted: MTiger156 lifebot woah, that's awesome! I'm too lazy right now to check, but does it work with Remastered or 1.1.16 only?
I haven't used it in the latest version of remastered, but I assume it still works. It definitely did before. It's pretty neat. Super fast & easy way to create a save/load system
[05:02 pm]
fortheovermind -- my turn rate bar from the Create panel is no longer there. my games are created with the default 12 and i can no longer modify it, what could be causing this?
[04:50 pm]
Zoan -- MTiger156
MTiger156 shouted: Also, here's a link to its actual description http://www.staredit.net/topic/17696/
lifebot woah, that's awesome! I'm too lazy right now to check, but does it work with Remastered or 1.1.16 only?
[04:18 pm]
Dem0n -- o nvm you're talking about SCDB, not the map
Please log in to shout.


Members Online: udiwoky, Kraghes20, Roy, Zoan, barmak1247994