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.
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
Please log in to shout.


Members Online: Roy