1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Need Info] Restrict movement to circular region

Discussion in 'StarCraft II Modding' started by Zhall, Sep 27, 2014.

  1. Zhall

    Zhall

    Joined:
    Mar 27, 2009
    Messages:
    275
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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:
     
  2. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,546
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Use a circular region. When your unit moves outside it pull it back in. Enter and leave events work as usual.

    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.
     
  3. Zhall

    Zhall

    Joined:
    Mar 27, 2009
    Messages:
    275
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Actually I found an overlay that the point defense drone uses, that would look nice, just unsure of how to implement it.

    And.. I'm used to the point system in wc3, didn't know it wasn't counter intutive in sc2 aswell lol
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,546
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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).