Staredit Network > Forums > SC2 Assistance > Topic: [Solved] Sharing Unit from Different Players
[Solved] Sharing Unit from Different Players
This topic is locked. You can no longer write replies here.
Dec 3 2010, 5:11 am
By: payne  

Dec 3 2010, 5:11 am payne Post #1

:payne:

I'd like to be able to detect which player is missing (or has quit), and make his Hero unit (he has only 1) shared with all players, yet still detecting this Hero as being owned by this missing player. :O

EDIT: And while we're at it, what's wrong with this trigger? It gives me an error related to the event (something like 'EventDialog')?
http://vgshorts.com/BBCode/BBCode3.php?ID=221



None.

Dec 3 2010, 5:43 am NicholasBeige Post #2



I thought you were good with triggers? LOL!

The error message tells you, in plain english what was wrong with it... You are using an event-dialog, where non exists.

Dialog - Disable (Used dialog item) for (Player group((Triggering player)))


as for the detection of the player leaving and blah blah i don't know...



None.

Dec 3 2010, 5:59 am payne Post #3

:payne:

Quote from name:Cardinal
I thought you were good with triggers? LOL!

The error message tells you, in plain english what was wrong with it... You are using an event-dialog, where non exists.

Dialog - Disable (Used dialog item) for (Player group((Triggering player)))


as for the detection of the player leaving and blah blah i don't know...
LOL! Fail from me. I copy-pasted the trigger from elsewhere... didn't look carefully. :><:

Anyways, still needing help for the main problem about sharing units, guys! :teehee:



None.

Dec 3 2010, 6:39 am Roy Post #4

An artist's depiction of an Extended Unit Death

PlayerLeaves
    Events
        Player - Player Any Player leaves the game with Any
    Local Variables
    Conditions
    Actions
        Player Group - Pick each player in (All players) and do (Actions)
            Actions
                Player - Turn player (Triggering player) Shared Control On towards player (Picked player)

Tada?

Edit: I might have (Triggering player) and (Picked player) backwards; the wording is ambiguous and the description does not provide clarity. If it seems to do nothing, switch the two players and see if it works.




Dec 3 2010, 6:59 am payne Post #5

:payne:

Okay, thanks. Now, what about if the player just isn't there from the very start of the game? :/
(I guess it's an easy one, but my brain is off and it's 2 AM.)



None.

Dec 3 2010, 3:01 pm Roy Post #6

An artist's depiction of an Extended Unit Death

It's a little trickier, because there is no "Inactive Players" group; you have to make it yourself. And then you have two pick loops for active and inactive players, which means you need to use a variable on the outer loop to hold the first player group.

Initialization
    Events
        Game - Map initialization
    Local Variables
        ActivePlayer = 0 <Integer>
        InactivePlayers = (Empty player group) <Player Group>
    Conditions
    Actions
        Player Group - Pick each player in (All players) and do (Actions)
            Actions
                General - If (Conditions) then do (Actions) else do (Actions)
                    If
                        (Status of player (Picked player)) != Playing
                    Then
                        Player Group - Add player (Picked player) to InactivePlayers
                    Else
        Player Group - Pick each player in (Active Players) and do (Actions)
            Actions
                Variable - Set ActivePlayer = (Picked player)
                Player Group - Pick each player in InactivePlayers and do (Actions)
                    Actions
                        Player - Turn player ActivePlayer Shared Control On towards player (Picked player)

Again, you might have to swap "ActivePlayer" and "(Picked player)" on the last line there; I can't test this code in a solo game.

Also, I'm not sure if SCII removes all inactive players' units automatically from the start of the game, but be aware that empty slots may have some differing functionality on map initialization.




Dec 3 2010, 7:27 pm payne Post #7

:payne:

Thanks.
For information: " Player - Turn player ActivePlayer Shared Control On towards player (Picked player)" was the proper syntax. :)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:56 pm]
Oh_Man -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
yeh thts straight up cheating
[12:24 pm]
Oh_Man -- arty's done another vid. he's also announced he's going to organise showmatches with pro, with NO maphacks, so we can see its actual capabilities
[10:09 am]
NimoStar -- It can by playing the same map thousands of times. It is similar to AI speedrunning games
[02:30 am]
Symmetry -- I dreamed about that as a kid. The idea of a computer capable of analyzing a starcraft map and calculating the fastest possible way to hit the victory condition
[02:29 am]
Symmetry -- But can AI beat my custom maps?
[2026-9-22. : 12:32 pm]
Oh_Man -- yea APM vs eAPM
[2026-9-22. : 8:48 am]
NimoStar -- plus most of the human APM is just spam clicking APM inflation
[2026-9-22. : 8:47 am]
NimoStar -- the thing with the "*12" thing is completely misleading. The AI isn't using two control groups, it can use each of those actions to command a single unit individually and issue different commands to each single unit.
[2026-9-22. : 8:06 am]
NudeRaider -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
*Pluto's wraiths
Please log in to shout.


Members Online: DarkenedFantasies