Staredit Network > Forums > SC2 Assistance > Topic: Selected Unit?
Selected Unit?
Feb 21 2011, 12:35 am
By: Deev  

Feb 21 2011, 12:35 am Deev Post #1



Gaaah, I am tryin to use the trigger "Set unit color" and the "change unit propperty" but I can't get a way, to have it do it on, a selected unit!? .. Gaaah, I tried creating another trigger called "player selects unit" store that unit, and THEN do it on that variable unit. Anyone?! :(



None.

Feb 21 2011, 3:16 am Riney Post #2

Thigh high affectionado

If you put the unit into a unit group when it is spawned, youll have the location of the unit you need to change at all times. To do this, make a variable and change it to Unit Group, then set the variable to Last Created Unit after making the unit using a trigger. Then calling up the unit is a breeze.

Use the Set Unit Color action, then make it look like this


Set (Random Living unit from My Unit Group (Or whatever you define)) team color to (Player ##) Whatever


For the first option, choose Random Unit from Unit Group, and then assign the unit group to the next field it asks for, then the color to whatever. Same goes for the change unit property action.



.riney on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

Sure I didn't pop off on SCBW like I wanted to, but I won VRChat. Map maker for life.

Feb 21 2011, 3:29 am Roy Post #3

An artist's depiction of an Extended Unit Death

Are you trying to get the effect when a player selects the unit? I'm assuming you tried using the Unit is Selected event, but it didn't work?

SelectedColors
    Events
        Unit Selection - Any Unit is Selected by player Any Player
    Local Variables
    Conditions
    Actions
        Unit - Set (Triggering unit) team color to (Current player (Triggering player) color)

(Sets the color of the selected unit to the color of the player that selects it)

If the above didn't work, you can try using a unit group, like Riney suggested. However, I would just use the "Selected Units" function to get the unit group.

SelectedColors
    Events
        ------- Your event here. If you want it to happen constantly, use Periodic Event with a low interval.
    Local Variables
    Conditions
    Actions
        Unit Group - Pick each unit in (Selected units for player 1) and do (Actions)
            Actions
                Unit - Set (Picked unit) team color to (Player 13) Light Green





Feb 22 2011, 12:20 am Riney Post #4

Thigh high affectionado

Either way works for one unit, though Roy's method is much better for multiple units.



.riney on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

Sure I didn't pop off on SCBW like I wanted to, but I won VRChat. Map maker for life.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[07:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[2026-7-26. : 3:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[2026-7-26. : 3:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[2026-7-26. : 3:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[2026-7-26. : 3:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
[2026-7-23. : 6:40 am]
Oh_Man -- true
[2026-7-23. : 3:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
Please log in to shout.


Members Online: lil-Inferno