StarCraft® II

[Help] Changing selection ring and area

Posts: 73
How do I change the scale of the selection ring (the green ring that appears around a unit when your mouse is over it) and offset the selection area (the area where you are able to select the unit when you click it) without changing the scale of the model?
Reply Quote
Posts: 103
The selection circle radius for a given unit can be quickly modified in its Model Data under Art: Selection Radius.

Changing the selection area of the model as you're describing is not as trivial. The selection information is actually embedded in the model with a group of invisible selection geometry that dictates its selectability for click and drag selection.

One option to modify selectability is to attach another model to your actor at the scale you need and use it for selection. As a quick test, I just created a new ModelAdditionStatic actor for the Marine and it worked pretty well, so I'll give that as an example from the Data module (F7):

First, let's create a new model entry:
  • Open the Models tab (Data->Edit Art and Sound Data->Models)
  • Create a new model
  • Name it MarineSelector
  • Hit the Suggest button to duplicate its name as its ID
  • Hit Okay
  • Select a model for it to use by hitting Browse under Art->CModel Model
  • Enter Marine into the search field to narrow the file list
  • Select the Marine.m3 model
  • Hit Okay

Next, we'll set up the actor for this model:
  • Open the Actors tab (Data->Edit Actor Data->Actors)
  • Create a new Actor
  • Name it MarineSelector (by giving it the same Name/ID as the Model, they will automatically be associated with one another)
  • Hit the Suggest button to duplicate its name as its ID
  • Set its Actor Type to CActorModel
  • Change its parent to ModelAdditionStatic
  • Hit Okay
  • Click the Art tab if it's not already selected
  • Modify the CActorModel Scale value to something bigger (say, 5 for X, Y and Z)
  • Click the Event tab
  • Right-click in the event list and hit Add Event
  • Set its Msg Type to Actor Creation (should default to ActionDamage)
  • Set the Msg Type to Set Opacity and leave the values at their defaults of 0 (this makes the model invisible, but still selectable)

Finally, we'll modify the Marine to use our new Model/Actor:
  • Select the Marine actor
  • Right-click in the Event tab's window and select Add Event
  • Set the Msg Type to Unit Birth (should default to Action Damage)
  • Set the Source Name to Marine
  • Change the Action dropdown to Create (should default to ActionDamagePhysics)
  • Set the Name radio button to Actor
  • Set the value to MarineSelector from the dropdown

Then just place a Marine on your map and test it - your Marine should be normal, except that it now has a giant, invisible secondary marine attached at its Origin which provides much more click and drag selection area than the standard model. You can dial in the actor scale that we set to 5 on your MarineSelector actor to fine tune the selection size.

After doing this, I've realized that mapmakers would benefit from some plain selection-geometry-only models in a few shapes that they can use for this purpose rather than duplicating real game models. I'll explore adding that support for Heart of the Swarm.

Let me know if you have any questions or problems with this, and if anyone has more elegant solutions for this that you've worked out, please call them out as this is not something we encounter when making StarCraft II. That said, there will probably be some unintended fallout from my solution as well that may need further solves.

Edited by Xuzaca on 11/20/2012 5:56 PM PST
Reply Quote
Posts: 73
I was able to change the radius of the selection circle, but it is still too thick. Is there anyway to change the thickness of the ring? As for the selection area, I used a battlecruiser actor, for my unit and it has a lot of events already placed in the Events tab. So should I replace the events that are there, delete all of the battlecruiser events and add the new events, or just add the events to the bottom of the list. What I did was replace the events, but I didn't try anything else. As for what I've done so far, and I think I did the things correctly, all I've accomplished was changing the unit's scale.

My unit is a enlarged D-8 Charge with the scale of (20, 20, 60) and the selection area is way to tall, so when you click above it onto the ground behind the unit, it still selects the unit, making the selection area seem offset, but the rest of the selection area is okay. Would doing what's mentioned above help reduce the scale, or is it just overlapping the original selection area and adding extra selection area, which in this case, would still leave the original selection area, affecting nothing?

FYI: The unit is spawned once per player by triggers at the beginning of the game, and cannot be created any other way.
Edited by FrozenFire on 11/23/2012 10:00 AM PST
Reply Quote
Posts: 73
Any help?
Reply Quote
Posts: 130
Xuzaca's simple example assumed enlarging the select area. In the actor for your D-8 charge, if you go to Art: Model Flags and uncheck "Allow hit test", this will make the base actor completely unclickable. Then using Xuzaca's method you can completely define the select area rather than just expand on it. At least, I think "Allow hit test" being off won't be inherited. If you actually can't get a select this way at all, you could reverse the relation of the two actors. That is, give the unit your selection model and 0 opacity, and attach the unclickable D-8 model for visual purposes.

I'm having a hard time figuring out why this selection ring would be extra thick. You can set a number of selection ring properties on a global basis in Game UI Data, but if this one unit has a unique problem, there must be something else influencing it. Sometimes fields I'm looking for turn out to have been right under my nose, so I'll take another look later.
Edited by TheFed on 12/4/2012 10:53 AM PST
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Explain (256 characters max)
Submit Cancel