Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Splitting Units for a D/c player
Splitting Units for a D/c player
Feb 25 2019, 6:15 am
By: Variations  

Feb 25 2019, 6:15 am Variations Post #1



I'm currently making a new Impossible Scenarios map, and it's close to done! however I'm having trouble figuring out how to make it so that if/when someone disconnects, their units are split to the other players ?


also on a side note, anyone now any diff map protectors? I tried using SMLP and every time I try to laod the map up into it, SMLP crashes lol



None.

Feb 25 2019, 12:58 pm Roy Post #2

An artist's depiction of an Extended Unit Death

Units go to Player 12 (Neutral) when a player leaves. You can give those units back to other players with a simple give loop. Assuming your players are in Force 1:

Give Neutral Units
Players

  • Force 1
  • Conditions

  • Neutral commands at least 1 [men]
  • Actions

  • Give 1 [men] owned by Neutral at Anywhere to Current Player
  • Preserve Trigger


  • You could use "Always" or "Bring" as the condition if you prefer.




    Feb 25 2019, 9:24 pm Variations Post #3



    Quote from Roy
    Units go to Player 12 (Neutral) when a player leaves. You can give those units back to other players with a simple give loop. Assuming your players are in Force 1:

    Give Neutral Units
    Players

  • Force 1
  • Conditions

  • Neutral commands at least 1 [men]
  • Actions

  • Give 1 [men] owned by Neutral at Anywhere to Current Player
  • Preserve Trigger


  • You could use "Always" or "Bring" as the condition if you prefer.


    On a diff note is there a certain specific to do to be able to spwan forver lasting Broodlings seen it in other maps, broodlings at 0 energy,lasting forever




    Feb 25 2019, 9:30 pm Roy Post #4

    An artist's depiction of an Extended Unit Death

    From the wiki's quirks and nuances page:

    Zerg Broodlings created using Create Unit do not expire, unless they are later affected by a Modify Unit Hit Points action. Broodlings spawned using Create Unit With Properties do expire.





    Feb 26 2019, 8:06 am Variations Post #5



    Quote from Roy
    Units go to Player 12 (Neutral) when a player leaves. You can give those units back to other players with a simple give loop. Assuming your players are in Force 1:

    Give Neutral Units
    Players

  • Force 1
  • Conditions

  • Neutral commands at least 1 [men]
  • Actions

  • Give 1 [men] owned by Neutral at Anywhere to Current Player
  • Preserve Trigger


  • You could use "Always" or "Bring" as the condition if you prefer.

    Hm so I got to do a test run with my map today and tried that trigger command.. it didnt work, left all neutral units.. neutral




    Feb 26 2019, 1:04 pm 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

    Quote from Variations
    Hm so I got to do a test run with my map today and tried that trigger command.. it didnt work, left all neutral units.. neutral
    You likely have the wrong player in the condition/action. IIRC there's 2 players with neutral in the name in ScmDraft:

    • P12, named "Neutral" (this is the one you wanna use)
    • an unused player ID called "Neutral Players"

    The name specifics are off the top of my head, but the tip remains valid: Try finding the correct player. For the condition you could just take Always, but it'll be an unnecessary CPU drain, and for the action you need to find the right player anyways.

    If nothing works just post the text triggers here and we'll figure it out.




    Feb 27 2019, 2:09 am Variations Post #7



    Quote from NudeRaider
    Quote from Variations
    Hm so I got to do a test run with my map today and tried that trigger command.. it didnt work, left all neutral units.. neutral
    You likely have the wrong player in the condition/action. IIRC there's 2 players with neutral in the name in ScmDraft:

    • P12, named "Neutral" (this is the one you wanna use)
    • an unused player ID called "Neutral Players"

    The name specifics are off the top of my head, but the tip remains valid: Try finding the correct player. For the condition you could just take Always, but it'll be an unnecessary CPU drain, and for the action you need to find the right player anyways.

    If nothing works just post the text triggers here and we'll figure it out.


    Not sure if it would matter, but for the map I have set players 7 and 8 as neutral, but now in the same line as Player 12 has it in, so like I believe off hands it player 12 in the Race line it's neutral, my player 7 and 8 are neutral in who commands it




    Feb 27 2019, 4:31 am NudeRaider Post #8

    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

    Can't make sense of your sentence, but the player settings don't matter for this. Roy's trigger will give units from P12 to members of force 1, if they are active (slot occupied, not defeated). P12 gets all units of players that left or got defeated.




    Feb 27 2019, 6:44 am Variations Post #9



    Quote from NudeRaider
    Can't make sense of your sentence, but the player settings don't matter for this. Roy's trigger will give units from P12 to members of force 1, if they are active (slot occupied, not defeated). P12 gets all units of players that left or got defeated.
    Okay so it shouldnt matter if I were to make any of the 1-8 slots neutrallike for it to ruin that trigger




    Mar 1 2019, 10:26 pm MinuteMan Post #10



    Quote from Variations
    Quote from NudeRaider
    Can't make sense of your sentence, but the player settings don't matter for this. Roy's trigger will give units from P12 to members of force 1, if they are active (slot occupied, not defeated). P12 gets all units of players that left or got defeated.
    Okay so it shouldnt matter if I were to make any of the 1-8 slots neutrallike for it to ruin that trigger

    Correct, you are not applying the trigger to a "Neutral Force", you are applying it to player 12, which happens to be neutral. Your trigger action should look like this:





    Mar 2 2019, 11:50 am NudeRaider Post #11

    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 MinuteMan
    Your trigger action should look like this:
    While it'll work, the lowest numbered player in force 1 will receive all the units. The version Roy proposed will spread the units evenly between members of force 1. (still a slight bias for lower numbered players)

    Quote from MinuteMan
    Okay so it shouldnt matter if I were to make any of the 1-8 slots neutrallike for it to ruin that trigger
    Well you still need active players that are able to run the trigger. And you have to make sure one of those active players is the trigger owner.

    Post has been edited 1 time(s), last time on Mar 3 2019, 2:23 am by NudeRaider.




    Mar 6 2019, 10:52 pm sethmachine Post #12



    The force/owner of the trigger needs to be an active player. Do not select Player 12 as the owner of the trigger. It should be Force 1 (or whichever force is your players)

    While this will work, if you want to be truly fair, you should randomize a switch every "loop" to see who gets a unit. Though if you had n players, you'd need n! orderings to check, e.g. if 5 players left in the game, there are 120 unique ways to choose the order in which each player gets a unit. One such ordering is P1, P2, P3, P4 P5. Another is P5, P2, P4, P3, P1. etc. This would be overkill and impractical unless you use a trigger macro framework, e.g. YATAPI, which can generate TrigEdit triggers via Python.

    Or maybe you want to make sure the units get split evenly, e.g. if P1 already has 10 units, P2 has 5 units, and P3 left 7 units, you should give 6 units to P2 and 1 to P1, so they each have 11 units. In the system proposed above, P1 would get 14 units total whereas P2 would have 8 units.

    I think the more important thing is perception of fairness when giving out a leaver's units rather than implementation (very simple as shown above with one trigger). Players would want to know why P1 got that unit, etc. (or at least that would be good customer experience I think).

    In the most extreme case, you would check which units each player owns and dole out the leaver's units based on which synergize best with their current units. E.g. if P1 has a Protoss Scout and P2 has an Lurker, and P3 left a Defiler, you probably want to give P2 the defiler. This would be a lot of manual work listing out combinations, and if none of those exist, then use the proposal above...

    Another example--P1 has a Goliath, P2 has Ultralisk, and P3 left an SCV. Give P1 the SCV, not P2.



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [2026-7-18. : 2:27 am]
    Symmetry -- https://staredit.net/topic/18903/ THE REVIEWS ARE HERE! "ok these are pretty good memes" - ssj9Kevin
    [2026-7-17. : 2:58 pm]
    Ultraviolet -- Symmetry
    Symmetry shouted: Man I wish we had this tech back in the day when people played ums lmao
    fr fr
    [2026-7-17. : 2:39 am]
    Symmetry -- Man I wish we had this tech back in the day when people played ums lmao
    [2026-7-16. : 6:28 am]
    NudeRaider -- EUD actions, specifically. The conditions remained. Today we can even have actions again, but they're all virtualized/whitelisted (not sure on the actual technical implementation) so you can only use them for specific intended purposed, not arbitrary code injections.
    [2026-7-16. : 6:26 am]
    NudeRaider -- I mean yes, maps - through EUDs - were theoretically able to do that as well, but that was patched quickly.
    [2026-7-16. : 6:25 am]
    NudeRaider -- Symmetry
    Symmetry shouted: Ohhh imagine a SC map that could delete itself
    not the map, the editor
    [2026-7-16. : 2:28 am]
    Symmetry -- I vaguely remember Voy doing some ACE back in the day, but I had no idea EUDs could do that kind of shit. I am very much catching up on the technology
    [2026-7-16. : 2:28 am]
    Symmetry -- Ohhh imagine a SC map that could delete itself
    [2026-7-15. : 8:51 pm]
    NudeRaider -- Symmetry
    Symmetry shouted: NudeRaider Is EUD editor capable of writing shit onto the player's harddrive? That seems like it would be dangerous
    yeah an editor that isn't allowed to write files sounds rather pointless, so I'd assume it can. Like most other programs too btw. and yes, obviously that's dangerous, but also kinda necessary. MS introduced that virtualization for exactly that reason.
    [2026-7-15. : 4:10 am]
    Ultraviolet -- I don't think so. I think they shut that shit down after 1.16, maybe even earlier
    Please log in to shout.


    Members Online: l)ark_ssj9kevin