• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Need Info] Restrict movement to circular region

Status
Not open for further replies.
Level 9
Joined
Mar 27, 2009
Messages
309
What would be the easiest way to limit a unit's movement to a circular region?

I believe I can achieve this by checking that the point the unit is being sent to is withing a, say, 256 circular region from where the unit is located...

I also need a way to graphically show this, something around the range indicator for an ability would work, or some splat borrowed from a AOE image may work.

I am considering also making a circle from special effects, as was done in warcraft 3.

I'm new to sc2 modding, so I'm sure theres some easy way to do this.

Thanks :thumbs_up:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Use a circular region. When your unit moves outside it pull it back in. Enter and leave events work as usual.

256 circular region
That is the size of the entire map... SC2 maps are only 256*256 units in size at most with each tile being exactly 1 unit in width and height.

You should be able to make the region visible in-game so it appears as a map overlay. Or maybe that is just for points.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
And.. I'm used to the point system in wc3, didn't know it wasn't counter intutive in sc2 aswell lol
It is pretty intuitive. I mean unlike WC3 where each tile was 128 units, in SC2 each tile is 1!

If you want to use an overlay you will need an actor for it. Actors are asynchronous objects that are used by the graphics system of SC2. All ability overlays and things are actors. This can be trigger created using appropriate actor actions. Locally controlled trigger actors is more difficult last I checked with the only way being some kind of hacky workaround using flyer circles (the circles used to help show users where a flying unit is physically).
 
Status
Not open for further replies.
Top