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.

How to stack standart buttons (remove Patrol, Hold Position, etc)

Discussion in 'General Mapping Tutorials' started by ALEXz407, Jan 19, 2015.

  1. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    It drops to about 1 fps for all of them as soon as the map starts, so I had to exit.
     
  2. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    6,789
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    holy amazeballs!

    I think this is easily the biggest WC3 exploit I've seen in a while. It's a shame that hotkeys don't work on these sidebar buttons. That could have been THE way to create an MMO-like ability HUD.

    It's still awesome though. I really have to check out if I can get a possible use out of this (probably not, as I use the quickbar for displaying allied heroes) ... there must be a way to use this for something really cool.
     
  3. ALEXz407

    ALEXz407

    Joined:
    Aug 23, 2014
    Messages:
    206
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    So it doesn't crash? I guess this happens because I use "Time - Periodic Event" with 0.00 value (tested it on PC - 10000 sidebar refresh actions per second) maybe on MAC it executed even more times.
    Here is another test map: View attachment Test_1.w3x - sidebar refresh starts after 5 seconds of gametime and executed every 0.03 s (33 times per second).

    For example you can make "Battle Mode" button. So default sidebar buttons will be:
    1. Hero
    2. Backpack
    3. Material Bag
    4. Talents Archive? (you can split them into 2 spellbooks: base and advanced - 24 talents total (or even add nested spellbooks pagination, then there is no limits!). And also add Learn talent button here, that will open hidden hero skills menu. And because you make talents choice one from three, you can place talent learn buttons to sidebar aswell)
    5. Usefull Things (revive mercenary, roll, etc)
    6. Game Options
    7. Battle Mode
    When you click on Battle Mode, all spellbook abilities (Talents Archive, Usefull Things, Game Options) and Material Bag (probably with Backpack for total 6 hero slots?) removed (just remove corresponding spellbook abilities and refresh sidebar with +/-1 skill point) and your Party interface activates. Battle Mode replaced with Peaceful Mode to make vice versa actions. This could even trigger automatically when entering/leaving battle, but I think it's better to add as option, not default behaviour.
    Sidebar spellbooks can contain sidebar buttons with "Cancel" at the bottom (so only 1 cancel + 3 buttons very comfortable for clicking + 12 normal buttons in command card).
    Also all buttons (+learned talents) can be repeated in backpack for user's convenience. (will require additional dummy abilities with normal positions and shortcuts ofc)

    So far I see three main problems:
    - Mac compatibility testing.
    - These black bars under sidebar buttons.
    - Sidebar clumsiness with low refresh rate.
    + It needs at least 1 hero for each player to hide stacked standart buttons and refresh sidebar.
     
    Last edited: Jul 24, 2015
  4. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    6,789
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    Yeah I actually had a similar idea... the problem is that it would be unintuitve to have the controls placed there. For someone who digs self-explanatory systems like me, this is not easy to get by.
     
  5. ALEXz407

    ALEXz407

    Joined:
    Aug 23, 2014
    Messages:
    206
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    I guess things that looks like buttons and appear on the screen when you select hero (and disappear when you select other unit) are pretty noticeable and self-explanatory. Just tell the player that he can click on them (introduction quest for example or big splashscreen with arrows pointing on buttons/backpack/etc and text descriptions, displayed when hero picked).

    Perhaps splitted buttons (i.e. spellbook with 3 buttons on sidebar and 4 on command card) may be confusing, because player will notice changes only in sidebar zone and command card will be in blind-spot.

    And tooltips appearing near to command card when you hover over sidebar buttons are little uncomfortable, but we can not change this - frameDef can not be modified at runtime.
     
  6. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    6,789
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    Hmm... I evaluated some possible designs for that in my head and just couldn't find any layout that was somewhat satisfying.

    But I could imagine this being amazing for 3rd person shooters or fullscreen systems. For example, you could use the skill point number of the icon to display ammo or just use those buttons like tabs that select specific sub-menus in FSI.


    But keep experimenting guys! Maybe you can find something even cooler, like having abilities displayed on the right side of the screen aswell.

    Also, have you found a method to replace the idle worker button with this? This could be really interesting, as you can't have a hero button there by normal means, so you could use it to trigger an interface element or have a spellbook or menu placed there.
    You can already do this with the idle worker button, but it introduces a nasty delay due to the selection event. Having an actual ability there would remove this lag.
     
  7. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,040
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    Wait... so I can have 12(command card)+7(heroes)+6(inventory) buttons per unit? Omfg

    EDIT: The F1-7 hotkeys don't work either for those abilities. Need to find a way.
    EDIT2: Found a way to make the hero buttons show cooldowns and the bluish thing for when they can't be cast due to mana. Just level up the hero.
    EDIT3: Found a way to make hero buttons castable by hotkey. If you have an ability with the same order ID in the command card, it will use its hotkey for both. While one is uncastable the other will use its hotkey instead.
     
    Last edited: Jul 24, 2015
  8. ALEXz407

    ALEXz407

    Joined:
    Aug 23, 2014
    Messages:
    206
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    I guess this happens because F1-F4 buttons read pointer to unit (hero) from specified location. So when we place skills here, it just points to nothing.

    Black background for bars displayed here with same reason - game can not retrieve unit, so check "is hero dead" returns 0, and hp/mp values are 0 - so we can see a blank bars.
    You can also just give and take away 1 skill point to player's hero, this will refresh everything in HeroBar.
    Sounds good.

    After searching for barewords in game.dll, I can guess that Blizz use these names for UI elements:
    HeroBar - 7 buttons at top left
    PeonBar - 1 button at bottom left
    CommandBar - 12 buttons bottom right
    Inventory - 6 buttons near to CommandBar
    Too bad what everything is compiled here, so I can not find used texture or understand logic (maybe it just hardcoded fill with #000 for these backgrounds).

    P.S. I found that black background under HeroBar buttons disappers when hero dies, but idk how it can be simulated without a hero and for all buttons, not only for one.
     
  9. leandrotp

    leandrotp

    Joined:
    Jul 30, 2012
    Messages:
    153
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Forget about that man, I had also found it in my testings, but didn't post it because it will surely crash on mac. The reason it works in windows is because the game uses Storm.dll to allocate memory, and Storm allocates similar objects near each other (based on class name).

    But the mac version uses the operating system's malloc to allocate everything, so the objects are placed in unpredictable places in the memory. I didn't really test it in mac because I didn't suceed in installing Mac OS, but I'm pretty sure it will crash unless you are extremely lucky. (But anyway, it would be technically unsafe, the only thing 100% safe is to stack buttons into one of the 12 slots)
     
  10. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,040
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    I don't care about macs, but I do have one problem. For some reason the hero icon buttons have started to disappear once in a while. I don't know what causes it though.
     
  11. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    6,789
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    Macs are basicly not supported by WC3 anyway. Sad but true. Having optimized textures with less mipmaps for example will crash macs aswell. All the good stuff doesn't work on macs either, like enabling local files.
     
  12. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    @Alex: Tested it. It worked fine with 33 fps.

    As for the issue around Macs:
    • Battle.net doesn't work for Mavericks (10.9) and above.
    • You can't even install the native wc3 binaries unless you're running 10.6 or below with PPC architecture (or Rosetta if you're on 10.6 with intel).
    • w3arena's mac client runs on WINE internally.

    For those reasons, most Mac users have had to switch to a wineskin configuration or they run wc3 through bootcamp -> Windows partition. The number of mac wc3 players are already small, and I doubt that anyone using a mac would want to sit on a 10.6 upgrade forever unless it is a really old computer. I don't think it is necessary to cater to those few people. Most ppl I've encountered on reddit or w/e asking about macs ended up using Wineskin. As long as they have a suitable alternative, it should be fine.

    Local files work through Wineskin, thankfully. :D The low mipmap blp thing is still an issue though, even on Wineskin.
     
  13. leandrotp

    leandrotp

    Joined:
    Jul 30, 2012
    Messages:
    153
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Did you test with the native Mac version of warcraft, or with the wineskin version? And what version of Mac OS are you running?
     
  14. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    I ran it with Wineskin (OS X 10.10 Yosemite), sorry if I was misleading with my post.

    You are probably correct in your suspicions. My post meant to outline why it might not be necessary to even support Macs to begin with as long as they have a suitable alternative.
     
  15. ALEXz407

    ALEXz407

    Joined:
    Aug 23, 2014
    Messages:
    206
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    So, I have bad and good news.
    Bad => HeroBar is compiled into game.dll and can not be modified with Jass functions.
    Good => We have a workaround for this!

    Just look at this: View attachment Test_2.w3x :)

    And how it works:
    - Game redraws HeroBar when any hero in game obtain skillpoint. You can add dummy hero for neutral passive and run refresh trigger for him.
    - Black bars under buttons removed when player's hero dies, and they stay hidden even if you remove hero from the game. You can add 7 dummy heroes for each player, kill them and then just remove from the game.
    - Also, because we use only PC safe code in map, we can use 0,-11 to hide unwanted command card buttons completely and make 7 buttons universal sidebar.

    P.S. I think to make separate tutorial for this feature, with nice demo map. :)

    UPD: Wow! Noticed that game crash after playsession with sidebar buttons. Right after closing scores screen.
    UPD2: I guess game tries to wipe heroes data after playsession, but our HeroBar doesn't contain real heroes data and crash happens.
     
    Last edited: Jul 25, 2015
  16. leandrotp

    leandrotp

    Joined:
    Jul 30, 2012
    Messages:
    153
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    I was able to reproduce the crash in your test map and debugged it: it's caused by the Repair ability. I don't really know why, but it seems that this ability can't be placed on the sidebar. Try changing its position back to the command card and tell me if the crashes happen.
     
  17. ALEXz407

    ALEXz407

    Joined:
    Aug 23, 2014
    Messages:
    206
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Looks like some buttons are safe for placing in sidebar, but certain buttons cause crash. For example in demo map if last opened sidebar was peasant's skills - game will crash, but if you open peasant's Build menu - game will end normally. Demo map updated, now there are only safe skills

    UPD: Looks like problem happens with activating abilities and buying items.
    Standart command button - ok
    Build - ok
    Train - ok
    Upgrade - ok
    Item in Shop - crash after score screen
    Learn Hero Ability - ok
    Normal Hero Ability - crash after score screen
    Autocast Hero Ability - crash after score screen
    Passive Hero Ability - ok
    Normal Unit Ability - crash after score screen
    Autocast Unit Ability - crash after score screen
    Passive Unit Ability - ok
    Active Item Ability - crash after score screen
    Passive Item Ability - ok
    Doesn't work on position of abilities placed inside spellbooks! - so idea with nested sidebar spellbooks isn't possible.

    So far I see one dirty solution for this: player types "quit", game disables selection, forces player to select dummy unit with 7 safe sidebar buttons, shows defeat for him and after that enables selection.

    UPD2: Hmm, Reincarnation ability cause crashes after score screen too. I guess all things with cooldowns add unsafe pointers that game tries to clear after score screen. Will try to figure how to avoid this.
    UPD3: Seems like all cooldown logic is compiled in game.dll and can not be modified. I guess game saves pointer to a timer for each cooldown, that cleared when score screen displayed, and when game tries to clear all data connected with hero bar it also uses pointer to a wrong location in memory and crash happens. Pretty interesting that game work with placed not hero buttons here anyway.
    UPD4: Just noticed that spellbook shows only 11 abilities, even if you totally hide Cancel button. I guess this is hardcoded limitation.



    So sidebar can be used to:
    - Show useful command buttons that doesn't require often use via shortcuts (i.e. Attack for friendly fire, or Patrol/Hold Position)
    - Add up to 7 buildings in Build menu
    - Add up to 7 trainable units in buildings
    - Add up to 7 upgrades in buildings
    - Move hero skill learning to sidebar
    - Display important passives (i.e. game rules, or maybe different passives that indicates something and changed with triggers)
    - Add up to 7 safe active abilities without cooldowns for any unit:
    >> Reveal (Andt) as dummy for ground-target skills.
    >> Defend, Magic Defense as dummy for toggleable skills (also it fire order id even if unit is stunned).
    >> Shadow Meld as dummy for non-target skills.
    >> Root as dummy for unit <-> structure skills.
    + You can make sidebar buttons with any shape using alpha channel, because HeroBar doesn't render any backgrounds behind buttons. ( it's possible to make interesting hero portraits with this knowledge, just don't forget about non-removable black bar behind HP/MP, hero button shiny square glow and skill points counter in bottom right corner )

    And if you think that game crash after play session is ok, or you can handle it with tricky triggers:
    - Add up to 7 abilities with cooldowns for any unit

    And I recommend not to move/hide cancel button, it doesn't give much bonuses (only +1 slot in build menu), but really annoying when you can not close opened spellbook with ESC button.

    UPD5: Demo map now use only safe skills - View attachment Sidebar.w3x
    P.S. Sidebar works a bit weird with standart save game option: game will save, but if there are ability buttons - game will crash on load. Interesting that game will load if there are only building buttons, but after that everything turns unstable and game can crash in next playsession. So sidebar is suitable for multiplayer or arcade maps only.
     
    Last edited: Jul 26, 2015
  18. Emm-A-

    Emm-A-

    Joined:
    Jul 1, 2008
    Messages:
    1,312
    Resources:
    0
    Resources:
    0
    Guys, thanks a lot for these amazing findings and elaboration :)

    Just a note: building the buildings from the sidebar does not work for me (newest wc3 patch, win7 64bit, started from JNGP newest version)
     
    Last edited: Mar 10, 2016
  19. Ivorywinter

    Ivorywinter

    Joined:
    Jul 28, 2010
    Messages:
    29
    Resources:
    0
    Resources:
    0
    The latest patch removed this exploit. Does anyone have a solution? :(
     
  20. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Yeah, use a spellbook or dummy unit with 0 movement speed as interface with rally as ability for copying point-orders. Both require a little bit of triggering though spellbook does actually cost quite a bit of object editor work if your using over 100 abilities.

    Might be other possibilities however I don't have enough knowledge about them yet to explain.