Staredit Network > Forums > SC2 Assistance > Topic: Reduce selection radius
Reduce selection radius
Mar 1 2017, 1:48 am
By: rockz  

Mar 1 2017, 1:48 am rockz Post #1

ᴄʜᴇᴇsᴇ ɪᴛ!

The Nova model seems to be extremely large, so if you click anywhere close to her, it will select her. This doesn't happen on Marines and other units.

To be clear, I don't want to change the size of the selection circle that tells you if a unit is selected, just radius in which if you right or left click, the unit will be selected.

Ahli tried to explain this a bit in the shoutbox, but I'm afraid like much of the SC2 editor, it's going over my head.

Method 1: modify the Model to have a smaller selection radius.


This looks to be impossible, which is surprising considering the vast scope of the Galaxy Editor. Not sure why Blizzard would hard code this since the selection circle can be modified easily, and it scales with Model and Actor Scale size as well.

Method 2: Attach an invisible sphere actor to the unit that will perform as its new selection radius


I'm not sure I understand how to do this. Since Marines work fine, I've duplicated the marine actor and called it "SmallerNova", but there's no way for me to attach the SmallerNova actor to "Nova (Nova)" actor. If I right click on "Nova (Nova)", I get the "add actor" which seems like it will create a new actor, not add an actor to an existing actor, which is what I want to do.

Can someone help clarify where I'm going wrong?



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Mar 1 2017, 1:51 am Pr0nogo Post #2



In actor data for nova (nova), go to actor events and create a new event with the header ActorCreation and the term Create. Then click actor and set the field to smallernova.




Mar 3 2017, 5:57 am Ahli Post #3

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Example map

In actor data, there is a generic actor "MouseHitZoneGeneric" that contains the logic of a mouse hit zone and the basic settings. It is used as a template/parent for the attached mouse hit sphere for the Marauder and the Marine.

For example, it is possible to add mouse hit zones to models that have no selection area by default, e.g. the force field model.

Since you want to disable the mouse hit zone of the unit actor, you need to clear the unit actor's "Model Flag" called "Allow Hit Test". Clearing that flag disables the model's selection area.

In triggers, there is a small tool that can help you figure out the correct size of the scaling to get the hitbox right. The chat command is "wizzard on".

Possibly, the generic actor could be made easier now as I assume that the actor events that are triggered by a player change of the unit are not required anymore. I added that as a workaround to fix that bug when I created this a few years ago.

Quote from rockz
Method 1: modify the Model to have a smaller selection radius.


This looks to be impossible, which is surprising considering the vast scope of the Galaxy Editor. Not sure why Blizzard would hard code this since the selection circle can be modified easily, and it scales with Model and Actor Scale size as well.

The selection radius is only visual. I wrote that because you wrote about selection and it is not 100% clear if you meant clicking or the circle around the unit.

The actual selection areas are baked into the model file. You would either modify the actual model file (.m3) or disable the selection area of that model in its actor and attach another model with an active selection area (as described above).



Btw, the model data entity also contains the setting which selection layer it has, e.g. making structures, units and larva not be able to be selected together with a single selection box drawn with your mouse (-> requires shift + selection, etc...).

Post has been edited 1 time(s), last time on Apr 7 2017, 1:12 pm by Ahli.




Mar 3 2017, 11:21 am rockz Post #4

ᴄʜᴇᴇsᴇ ɪᴛ!

OK, so I've disabled "Model Allow Hit Test" and that seems to work, though it was a major pain trying to find it because search doesn't work, and nobody refers to it as "Model Allow Hit Test".

I am able to also create an event for the Invisible actor acting as the selection by doing "ActorCreation - SetOpacity to 0". I can also do ActorCreation - Set Visibility and uncheck it.

When I add an Actor Event Actor Creation - Create NovaSmaller, it appears to use the NovaSmaller command card, wireframe, and voice/portrait. I went ahead and duplicated Nova, but I'm getting this error message:
[3/3/2017 3:06:05 AM] USER: [ b 1] CActorUnit[Nova3] Cannot create a CActorUnit outside of an underlying CUnit's CActorScope. Try creating the actor inside of a live unit's CActorScope or create a CActorModel instead.

So far it's really promising, as the ghost model is almost identical to nova. It's still outrageously silly that I can't change her model allow hit test size. It seems that even custom models have this issue.

Post has been edited 1 time(s), last time on Mar 3 2017, 11:53 am by rockz.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Mar 5 2017, 10:15 pm Ahli Post #5

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Seems like you are creating a new unit actor as Pronogo suggested. That's something the game does not like and it will throw errors at you.

You should attach a model to the unit actor instead.




Apr 7 2017, 4:40 am rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

How do I attach a model to the unit actor?

when I do UnitBirth.Nova -> Create, it only lets me attach actors, which leads to an error message.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Apr 7 2017, 1:59 pm Ahli Post #7

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from rockz
How do I attach a model to the unit actor?

when I do UnitBirth.Nova -> Create, it only lets me attach actors, which leads to an error message.
Models cannot be created on their own, they are always used by an actor.

So, you create an actor of the type "model".
The parent is usually "ModelAddition", but that's just the source for the grey base values, so it does not matter too much.

You either create the attached model within the unit actor with the actor message you stated. Usually, I would use ActorCreation as the parent because you are attaching actors to actors. This might be the source of the error message, though. But I do not know for sure as that would require me to know what the error message was.


Which actor to attach to?
- The "Host" is usually set to use "_Selectable" which is an alias that all unit actors should receive (as set in the unit actor by default).


Where does it attach on the hosts model?
- If you do not specify anything, usually an actor is attached to the center of the unit model like the one in the example map I linked above. A model has attachment points and you can specify which one you want to attach to via "Host Site Operations".
- You can see the attachment points on a model in the cutscene editor after adding a model to the scene. Select the model in the scene and hit "A" to see the attachment points. Hit Shift+D to see the properties window which lists the attachment points the model has. If you click on an attachment point in the list, the marker on the model will light up and alter its size.


What are Site Operations?
- Site Operations alter an actor. There are multiple "Site Operation" actors already defined in the editor, but it is possible to create new ones. Usually, they are abbreviated with "SOp" in their name.
They are able to make actors rotate, offset them from the attachment point, make flying units visually rotate sideways when turning, etc... and as already mentioned they allow you to attach an actor to another. The actor having the site operation in its settings is the one that is attached to another actor.
- The "Site Operation (Attachment)" specifies an attachment point in its query. Methods are supported, too, if you need to have a random point.


An example for an attached model is a weapon attached to the player's hero in my Diablo map:
Code
   <CActorModel id="___carryBluntWeaponAttachment" parent="ModelAnimationStyleContinuousUNIT">
       <Inherits index="CloakEffect" value="1"/>
       <Inherits index="Opacity" value="1"/>
       <Inherits index="WarpGroup" value="1"/>
       <On Terms="Behavior.aaaCarriesBluntWeaponAttachment.Create" Send="Create"/>
       <On Terms="Behavior.aaaCarriesBluntWeaponAttachment.Destroy" Send="AnimBracketStop BSD"/>
       <HostSiteOps Ops="SOpAttachWeapon"/>
       <Model value="aaaBlunt"/>
       <ModelFlags index="AllowHitTest" value="0"/>
   </CActorModel>

- The parent is different, but that just means that you might have less properties to edit.
- It inherits a few properties from its host like opacity and cloack effect. I actually do not know what warpGroup is, but I enabled it anyway. It might be used when you teleport a unit.
- The actor is created when the "aaaCarriesBluntWeaponAttachment" behavior is added to a unit and destroyed when it is removed. The AnimBracketStop message references BSD which is usually used as the name for the "Birth Stand Death" animation as defined in its parent.
- The host is not altered here, so it is "_Selectable" aka the unit actor and its model.
- The Site Operation is "SOpAttachWeapon", so this actor's model will be attached to the weapon attachment point of the host's model.
- This actor's model is "aaaBlunt" which is a model showing a blunt weapon like a mace.
- In the model flags, I disabled "allowHitTest", so the attached actor's model will not add a selection area. In your case, you would want that enabled.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:24 pm]
Oh_Man -- da real donwano
da real donwano shouted: Who can crack into an old protected map & remove the trigger for insta-defeat for playing solo?
me
[12:48 am]
RIVE -- j
[2024-11-08. : 10:41 pm]
lil-Inferno -- p
[2024-11-07. : 7:38 pm]
Zoan -- M
[2024-11-07. : 11:26 am]
Zycorax -- F
[2024-11-06. : 7:31 pm]
O)FaRTy1billion[MM] -- L
[2024-11-06. : 9:45 am]
TF- -- Blumph win :wob:
[2024-11-06. : 3:43 am]
da real donwano -- Who can crack into an old protected map & remove the trigger for insta-defeat for playing solo?
[2024-11-04. : 3:21 am]
Ultraviolet -- surprised it runs at all anymore
[2024-11-04. : 3:21 am]
Ultraviolet -- DLDB is fucked
Please log in to shout.


Members Online: Roy, IlyaSnopchenko, jjf28