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.
[07:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
Please log in to shout.


Members Online: Roy