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.

Hiding base unit spells without spellbook?

Discussion in 'Triggers & Scripts' started by Cespie, Sep 23, 2019.

  1. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    I wanna hide the icons for the spells like "Move", "Attack", "Stop" and etc to make room for more abilities.
    This has been a desired feature for ages, with no real "out of the box" solution available, but seeing how a bunch of natives allowing manipulation of the UI has been introduced recently, it got me wondering if it's possible to hide these buttons by now.
    If not, is there a different way to achieve a similar result? Preferably something that uses the standard features of WE/JASS/LUA to ensure compatibility with future patches and Reforged.
    I know that spellbook is an option, but that actually disables the standard spells rather than just hiding them, so it kinda impairs movement a bit.
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    • Move, Patrol, and Hold Position can only be removed by removing the 'Amov' ability, and doing so renders the unit unable to move at all.
    • Attack can be removed by setting the "show UI" field to false for all units' attacks in the OE.
    • Stop cannot be removed at all.
    • For some reason the 0,-11 button position doesn't work for these abilities.
    • The closest you can get is this: How to get rid of Patrol and Stop - Wc3C.net
    • Search and go down the rabbit hole: Removing/Hiding order icons
    The UI natives existing doesn't alter this in any way as their appearance was always editable through MiscData.txt, though now you can reflavor them to look and read however you want ad-hoc. This doesn't do much and also forces you to intercept the orders given and issue the 'right' one. If every unit in your map had 2 no-target and 1 unit/point targeted abilities they needed then yes you could reskin those orders to look like whatever those would do in the map.
     
  3. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    Alright, so I guess in other words, nothing much has changed.
    You did post a few interesting ideas that I will look into though. I think I wanna avoid a super hacky workaround, as I don't percieve the added value to be greater than the amount of issues that it'd likely add, but it certainly helps to know which options I have at my disposal.
    Thanks!
     
  4. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,304
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    Try this approach (1.29+)

    Code (vJASS):

    // disableAbility, hideAbility are boolean values.
    // abilityId corresponds to rawcode
    call BlzUnitDisableAbility(whichUnit, abilityId, disableAbility, hideAbility)

    // Rawcode for move ability is 'Amov'
     
     
  5. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,178
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    You can import a custom CommandStrings.txt file into the map. The path after import needs to be "Units\CommandStrings.txt".

    Attached is a file from a map where I used it. Move/Patrol/HoldPosition are hidden in the example, and Stop is moved to position 0/0.
     

    Attached Files:

  6. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    Woah, this works? Just like that?
    Thanks a lot, will try it later.
     
  7. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,178
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Disabling the ability will probably make it unuseable, not just hiding.

    A note for custom CommandString, that hiding the move etc will make the ability still work, but the hotkeys won't work anymore. Might probably depend on map if people want to use hotkeys.
     
  8. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    As far as I can tell, the command has 2 booleans, one for hiding, one for disabling.
    Doesn't this means that you could set "disable" to false and "hide" to true?

    As for hotkeys. Wouldnt it be possible to make those work through dummy spells?
    Say you have a dummy spell for Hold Position. You just make that spell issue an order to Hold Position. I think hidden spells like channel can still work with hoykeys, but maybe I am wrong. Do you recall?
     
  9. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,178
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    I don't know for both, sorry.
     
  10. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,304
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    There is another approach, via using the newer oskey natives (v.1.31+). The principle is that you would want to listen to the moment a key is pressed down. However, this might be more cumbersome on your part.

    The native for it goes like this:
    Code (vJASS):

    native BlzTriggerRegisterPlayerKeyEvent(trigger, player, oskeyType (this is a type), metaKey (integer), onPress (boolean)) returns event
    native BlzGetTriggerPlayerKey() -> oskeytype
    native BlzGetTriggerPlayerMetaKey() -> integer
    native BlzGetTriggerPlayerIsKeyDown() -> boolean
     


    This is for the oskeytype parameter
    Code (vJASS):

        constant oskeytype              OSKEY_BACKSPACE                      = ConvertOsKeyType($08)
        constant oskeytype              OSKEY_TAB                            = ConvertOsKeyType($09)
        constant oskeytype              OSKEY_CLEAR                          = ConvertOsKeyType($0C)
        constant oskeytype              OSKEY_RETURN                         = ConvertOsKeyType($0D)
        constant oskeytype              OSKEY_SHIFT                          = ConvertOsKeyType($10)
        constant oskeytype              OSKEY_CONTROL                        = ConvertOsKeyType($11)
        constant oskeytype              OSKEY_ALT                            = ConvertOsKeyType($12)
        constant oskeytype              OSKEY_PAUSE                          = ConvertOsKeyType($13)
        constant oskeytype              OSKEY_CAPSLOCK                       = ConvertOsKeyType($14)
        constant oskeytype              OSKEY_KANA                           = ConvertOsKeyType($15)
        constant oskeytype              OSKEY_HANGUL                         = ConvertOsKeyType($15)
        constant oskeytype              OSKEY_JUNJA                          = ConvertOsKeyType($17)
        constant oskeytype              OSKEY_FINAL                          = ConvertOsKeyType($18)
        constant oskeytype              OSKEY_HANJA                          = ConvertOsKeyType($19)
        constant oskeytype              OSKEY_KANJI                          = ConvertOsKeyType($19)
        constant oskeytype              OSKEY_ESCAPE                         = ConvertOsKeyType($1B)
        constant oskeytype              OSKEY_CONVERT                        = ConvertOsKeyType($1C)
        constant oskeytype              OSKEY_NONCONVERT                     = ConvertOsKeyType($1D)
        constant oskeytype              OSKEY_ACCEPT                         = ConvertOsKeyType($1E)
        constant oskeytype              OSKEY_MODECHANGE                     = ConvertOsKeyType($1F)
        constant oskeytype              OSKEY_SPACE                          = ConvertOsKeyType($20)
        constant oskeytype              OSKEY_PAGEUP                         = ConvertOsKeyType($21)
        constant oskeytype              OSKEY_PAGEDOWN                       = ConvertOsKeyType($22)
        constant oskeytype              OSKEY_END                            = ConvertOsKeyType($23)
        constant oskeytype              OSKEY_HOME                           = ConvertOsKeyType($24)
        constant oskeytype              OSKEY_LEFT                           = ConvertOsKeyType($25)
        constant oskeytype              OSKEY_UP                             = ConvertOsKeyType($26)
        constant oskeytype              OSKEY_RIGHT                          = ConvertOsKeyType($27)
        constant oskeytype              OSKEY_DOWN                           = ConvertOsKeyType($28)
        constant oskeytype              OSKEY_SELECT                         = ConvertOsKeyType($29)
        constant oskeytype              OSKEY_PRINT                          = ConvertOsKeyType($2A)
        constant oskeytype              OSKEY_EXECUTE                        = ConvertOsKeyType($2B)
        constant oskeytype              OSKEY_PRINTSCREEN                    = ConvertOsKeyType($2C)
        constant oskeytype              OSKEY_INSERT                         = ConvertOsKeyType($2D)
        constant oskeytype              OSKEY_DELETE                         = ConvertOsKeyType($2E)
        constant oskeytype              OSKEY_HELP                           = ConvertOsKeyType($2F)
        constant oskeytype              OSKEY_0                              = ConvertOsKeyType($30)
        constant oskeytype              OSKEY_1                              = ConvertOsKeyType($31)
        constant oskeytype              OSKEY_2                              = ConvertOsKeyType($32)
        constant oskeytype              OSKEY_3                              = ConvertOsKeyType($33)
        constant oskeytype              OSKEY_4                              = ConvertOsKeyType($34)
        constant oskeytype              OSKEY_5                              = ConvertOsKeyType($35)
        constant oskeytype              OSKEY_6                              = ConvertOsKeyType($36)
        constant oskeytype              OSKEY_7                              = ConvertOsKeyType($37)
        constant oskeytype              OSKEY_8                              = ConvertOsKeyType($38)
        constant oskeytype              OSKEY_9                              = ConvertOsKeyType($39)
        constant oskeytype              OSKEY_A                              = ConvertOsKeyType($41)
        constant oskeytype              OSKEY_B                              = ConvertOsKeyType($42)
        constant oskeytype              OSKEY_C                              = ConvertOsKeyType($43)
        constant oskeytype              OSKEY_D                              = ConvertOsKeyType($44)
        constant oskeytype              OSKEY_E                              = ConvertOsKeyType($45)
        constant oskeytype              OSKEY_F                              = ConvertOsKeyType($46)
        constant oskeytype              OSKEY_G                              = ConvertOsKeyType($47)
        constant oskeytype              OSKEY_H                              = ConvertOsKeyType($48)
        constant oskeytype              OSKEY_I                              = ConvertOsKeyType($49)
        constant oskeytype              OSKEY_J                              = ConvertOsKeyType($4A)
        constant oskeytype              OSKEY_K                              = ConvertOsKeyType($4B)
        constant oskeytype              OSKEY_L                              = ConvertOsKeyType($4C)
        constant oskeytype              OSKEY_M                              = ConvertOsKeyType($4D)
        constant oskeytype              OSKEY_N                              = ConvertOsKeyType($4E)
        constant oskeytype              OSKEY_O                              = ConvertOsKeyType($4F)
        constant oskeytype              OSKEY_P                              = ConvertOsKeyType($50)
        constant oskeytype              OSKEY_Q                              = ConvertOsKeyType($51)
        constant oskeytype              OSKEY_R                              = ConvertOsKeyType($52)
        constant oskeytype              OSKEY_S                              = ConvertOsKeyType($53)
        constant oskeytype              OSKEY_T                              = ConvertOsKeyType($54)
        constant oskeytype              OSKEY_U                              = ConvertOsKeyType($55)
        constant oskeytype              OSKEY_V                              = ConvertOsKeyType($56)
        constant oskeytype              OSKEY_W                              = ConvertOsKeyType($57)
        constant oskeytype              OSKEY_X                              = ConvertOsKeyType($58)
        constant oskeytype              OSKEY_Y                              = ConvertOsKeyType($59)
        constant oskeytype              OSKEY_Z                              = ConvertOsKeyType($5A)
        constant oskeytype              OSKEY_LMETA                          = ConvertOsKeyType($5B)
        constant oskeytype              OSKEY_RMETA                          = ConvertOsKeyType($5C)
        constant oskeytype              OSKEY_APPS                           = ConvertOsKeyType($5D)
        constant oskeytype              OSKEY_SLEEP                          = ConvertOsKeyType($5F)
        constant oskeytype              OSKEY_NUMPAD0                        = ConvertOsKeyType($60)
        constant oskeytype              OSKEY_NUMPAD1                        = ConvertOsKeyType($61)
        constant oskeytype              OSKEY_NUMPAD2                        = ConvertOsKeyType($62)
        constant oskeytype              OSKEY_NUMPAD3                        = ConvertOsKeyType($63)
        constant oskeytype              OSKEY_NUMPAD4                        = ConvertOsKeyType($64)
        constant oskeytype              OSKEY_NUMPAD5                        = ConvertOsKeyType($65)
        constant oskeytype              OSKEY_NUMPAD6                        = ConvertOsKeyType($66)
        constant oskeytype              OSKEY_NUMPAD7                        = ConvertOsKeyType($67)
        constant oskeytype              OSKEY_NUMPAD8                        = ConvertOsKeyType($68)
        constant oskeytype              OSKEY_NUMPAD9                        = ConvertOsKeyType($69)
        constant oskeytype              OSKEY_MULTIPLY                       = ConvertOsKeyType($6A)
        constant oskeytype              OSKEY_ADD                            = ConvertOsKeyType($6B)
        constant oskeytype              OSKEY_SEPARATOR                      = ConvertOsKeyType($6C)
        constant oskeytype              OSKEY_SUBTRACT                       = ConvertOsKeyType($6D)
        constant oskeytype              OSKEY_DECIMAL                        = ConvertOsKeyType($6E)
        constant oskeytype              OSKEY_DIVIDE                         = ConvertOsKeyType($6F)
        constant oskeytype              OSKEY_F1                             = ConvertOsKeyType($70)
        constant oskeytype              OSKEY_F2                             = ConvertOsKeyType($71)
        constant oskeytype              OSKEY_F3                             = ConvertOsKeyType($72)
        constant oskeytype              OSKEY_F4                             = ConvertOsKeyType($73)
        constant oskeytype              OSKEY_F5                             = ConvertOsKeyType($74)
        constant oskeytype              OSKEY_F6                             = ConvertOsKeyType($75)
        constant oskeytype              OSKEY_F7                             = ConvertOsKeyType($76)
        constant oskeytype              OSKEY_F8                             = ConvertOsKeyType($77)
        constant oskeytype              OSKEY_F9                             = ConvertOsKeyType($78)
        constant oskeytype              OSKEY_F10                            = ConvertOsKeyType($79)
        constant oskeytype              OSKEY_F11                            = ConvertOsKeyType($7A)
        constant oskeytype              OSKEY_F12                            = ConvertOsKeyType($7B)
        constant oskeytype              OSKEY_F13                            = ConvertOsKeyType($7C)
        constant oskeytype              OSKEY_F14                            = ConvertOsKeyType($7D)
        constant oskeytype              OSKEY_F15                            = ConvertOsKeyType($7E)
        constant oskeytype              OSKEY_F16                            = ConvertOsKeyType($7F)
        constant oskeytype              OSKEY_F17                            = ConvertOsKeyType($80)
        constant oskeytype              OSKEY_F18                            = ConvertOsKeyType($81)
        constant oskeytype              OSKEY_F19                            = ConvertOsKeyType($82)
        constant oskeytype              OSKEY_F20                            = ConvertOsKeyType($83)
        constant oskeytype              OSKEY_F21                            = ConvertOsKeyType($84)
        constant oskeytype              OSKEY_F22                            = ConvertOsKeyType($85)
        constant oskeytype              OSKEY_F23                            = ConvertOsKeyType($86)
        constant oskeytype              OSKEY_F24                            = ConvertOsKeyType($87)
        constant oskeytype              OSKEY_NUMLOCK                        = ConvertOsKeyType($90)
        constant oskeytype              OSKEY_SCROLLLOCK                     = ConvertOsKeyType($91)
        constant oskeytype              OSKEY_OEM_NEC_EQUAL                  = ConvertOsKeyType($92)
        constant oskeytype              OSKEY_OEM_FJ_JISHO                   = ConvertOsKeyType($92)
        constant oskeytype              OSKEY_OEM_FJ_MASSHOU                 = ConvertOsKeyType($93)
        constant oskeytype              OSKEY_OEM_FJ_TOUROKU                 = ConvertOsKeyType($94)
        constant oskeytype              OSKEY_OEM_FJ_LOYA                    = ConvertOsKeyType($95)
        constant oskeytype              OSKEY_OEM_FJ_ROYA                    = ConvertOsKeyType($96)
        constant oskeytype              OSKEY_LSHIFT                         = ConvertOsKeyType($A0)
        constant oskeytype              OSKEY_RSHIFT                         = ConvertOsKeyType($A1)
        constant oskeytype              OSKEY_LCONTROL                       = ConvertOsKeyType($A2)
        constant oskeytype              OSKEY_RCONTROL                       = ConvertOsKeyType($A3)
        constant oskeytype              OSKEY_LALT                           = ConvertOsKeyType($A4)
        constant oskeytype              OSKEY_RALT                           = ConvertOsKeyType($A5)
        constant oskeytype              OSKEY_BROWSER_BACK                   = ConvertOsKeyType($A6)
        constant oskeytype              OSKEY_BROWSER_FORWARD                = ConvertOsKeyType($A7)
        constant oskeytype              OSKEY_BROWSER_REFRESH                = ConvertOsKeyType($A8)
        constant oskeytype              OSKEY_BROWSER_STOP                   = ConvertOsKeyType($A9)
        constant oskeytype              OSKEY_BROWSER_SEARCH                 = ConvertOsKeyType($AA)
        constant oskeytype              OSKEY_BROWSER_FAVORITES              = ConvertOsKeyType($AB)
        constant oskeytype              OSKEY_BROWSER_HOME                   = ConvertOsKeyType($AC)
        constant oskeytype              OSKEY_VOLUME_MUTE                    = ConvertOsKeyType($AD)
        constant oskeytype              OSKEY_VOLUME_DOWN                    = ConvertOsKeyType($AE)
        constant oskeytype              OSKEY_VOLUME_UP                      = ConvertOsKeyType($AF)
        constant oskeytype              OSKEY_MEDIA_NEXT_TRACK               = ConvertOsKeyType($B0)
        constant oskeytype              OSKEY_MEDIA_PREV_TRACK               = ConvertOsKeyType($B1)
        constant oskeytype              OSKEY_MEDIA_STOP                     = ConvertOsKeyType($B2)
        constant oskeytype              OSKEY_MEDIA_PLAY_PAUSE               = ConvertOsKeyType($B3)
        constant oskeytype              OSKEY_LAUNCH_MAIL                    = ConvertOsKeyType($B4)
        constant oskeytype              OSKEY_LAUNCH_MEDIA_SELECT            = ConvertOsKeyType($B5)
        constant oskeytype              OSKEY_LAUNCH_APP1                    = ConvertOsKeyType($B6)
        constant oskeytype              OSKEY_LAUNCH_APP2                    = ConvertOsKeyType($B7)
        constant oskeytype              OSKEY_OEM_1                          = ConvertOsKeyType($BA)
        constant oskeytype              OSKEY_OEM_PLUS                       = ConvertOsKeyType($BB)
        constant oskeytype              OSKEY_OEM_COMMA                      = ConvertOsKeyType($BC)
        constant oskeytype              OSKEY_OEM_MINUS                      = ConvertOsKeyType($BD)
        constant oskeytype              OSKEY_OEM_PERIOD                     = ConvertOsKeyType($BE)
        constant oskeytype              OSKEY_OEM_2                          = ConvertOsKeyType($BF)
        constant oskeytype              OSKEY_OEM_3                          = ConvertOsKeyType($C0)
        constant oskeytype              OSKEY_OEM_4                          = ConvertOsKeyType($DB)
        constant oskeytype              OSKEY_OEM_5                          = ConvertOsKeyType($DC)
        constant oskeytype              OSKEY_OEM_6                          = ConvertOsKeyType($DD)
        constant oskeytype              OSKEY_OEM_7                          = ConvertOsKeyType($DE)
        constant oskeytype              OSKEY_OEM_8                          = ConvertOsKeyType($DF)
        constant oskeytype              OSKEY_OEM_AX                         = ConvertOsKeyType($E1)
        constant oskeytype              OSKEY_OEM_102                        = ConvertOsKeyType($E2)
        constant oskeytype              OSKEY_ICO_HELP                       = ConvertOsKeyType($E3)
        constant oskeytype              OSKEY_ICO_00                         = ConvertOsKeyType($E4)
        constant oskeytype              OSKEY_PROCESSKEY                     = ConvertOsKeyType($E5)
        constant oskeytype              OSKEY_ICO_CLEAR                      = ConvertOsKeyType($E6)
        constant oskeytype              OSKEY_PACKET                         = ConvertOsKeyType($E7)
        constant oskeytype              OSKEY_OEM_RESET                      = ConvertOsKeyType($E9)
        constant oskeytype              OSKEY_OEM_JUMP                       = ConvertOsKeyType($EA)
        constant oskeytype              OSKEY_OEM_PA1                        = ConvertOsKeyType($EB)
        constant oskeytype              OSKEY_OEM_PA2                        = ConvertOsKeyType($EC)
        constant oskeytype              OSKEY_OEM_PA3                        = ConvertOsKeyType($ED)
        constant oskeytype              OSKEY_OEM_WSCTRL                     = ConvertOsKeyType($EE)
        constant oskeytype              OSKEY_OEM_CUSEL                      = ConvertOsKeyType($EF)
        constant oskeytype              OSKEY_OEM_ATTN                       = ConvertOsKeyType($F0)
        constant oskeytype              OSKEY_OEM_FINISH                     = ConvertOsKeyType($F1)
        constant oskeytype              OSKEY_OEM_COPY                       = ConvertOsKeyType($F2)
        constant oskeytype              OSKEY_OEM_AUTO                       = ConvertOsKeyType($F3)
        constant oskeytype              OSKEY_OEM_ENLW                       = ConvertOsKeyType($F4)
        constant oskeytype              OSKEY_OEM_BACKTAB                    = ConvertOsKeyType($F5)
        constant oskeytype              OSKEY_ATTN                           = ConvertOsKeyType($F6)
        constant oskeytype              OSKEY_CRSEL                          = ConvertOsKeyType($F7)
        constant oskeytype              OSKEY_EXSEL                          = ConvertOsKeyType($F8)
        constant oskeytype              OSKEY_EREOF                          = ConvertOsKeyType($F9)
        constant oskeytype              OSKEY_PLAY                           = ConvertOsKeyType($FA)
        constant oskeytype              OSKEY_ZOOM                           = ConvertOsKeyType($FB)
        constant oskeytype              OSKEY_NONAME                         = ConvertOsKeyType($FC)
        constant oskeytype              OSKEY_PA1                            = ConvertOsKeyType($FD)
        constant oskeytype              OSKEY_OEM_CLEAR                      = ConvertOsKeyType($FE)
     

    Register a trigger to the event when a key is pressed, then manually enforce the desired order. (I think this will only be desirable for orders with no target.)
     
  11. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    I get the concept, but how do you relate this to a unit? Using the player's current selection? I can't remember, is it possible to get a unit group from a player's current selection?
    Also, is there an inherent advantage to doing this over hidden dummy spells (keeping in mind that I have no idea if that would actually work)?
     
  12. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,178
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Yes, one can also do it in GUI, to PickAllUnits currently selected by a player. But it doesn't seem very clean.
     
  13. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,304
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    I suppose the only advantage (right now) is that you don't have to create those hidden dummy spells.
     
  14. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    Right, so that would work great for Stop and Hold Position, but I don't know if it would work nicely with targeted actions like attack and patrol. Not that I give a shit about Patrol (I doubt people ever use that outside of competitive melee), but attack ground/target is a pretty big one, so I guess I'd wanna code that one as a spell.
    I don't recall ever designing a spell that targets both ground and units, how do I go about determining if the ability targets the ground or a unit? Can I just check if target unit is null or something?
     
  15. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,304
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    Yeah. If you really want to make sure it isn't targeting anything (point target), check if target destructible and target item are null.
     
  16. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I would treat it like a 'smartcast on release' action as is available in LoL keybinds. Press the key down and you see an indicator hovering on your cursor of the location the order will be issued; release the key and the order is issued. This is entirely feasible with MyPad's [vJASS] - [Snippet] Mouse Utility.
     
  17. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    That's nice, but I think I'd be hessitant to use this for "attack". People sort of expect that thing to work with the standard targeting mechanic, I fear the way it's used is too in-grained for most people to appreciate the convenience of smartcasting it.
    I'd definitely consider using it for targeted spells in general though, so thanks for bringing my attention to it.
     
  18. Cespie

    Cespie

    Joined:
    May 21, 2019
    Messages:
    344
    Resources:
    0
    Resources:
    0
    Alright, thanks a bunch.
    Say, if I get this thing to work nicely, would it be worth uploading it to The Lab?
    I know that this is a feature a lot of people want, but I don't know if someone else has already uploaded something for it.