Antares' Hero Selection v1.5

This bundle is marked as director's cut. It exceeds all expectations and excels in every regard.
RbeQz1.png


Create stunning, cinematic hero selection screens and easily integrate them into your map!

RbeQz1.png



RbeQz1.png


I am putting up all of my resources for free. If you like my work and find these resources useful, please consider buying me a coffee!



Overview

Installation

Change Log

Credits


Overview

This hero selection system allows players to get a full preview of the hero they're about to pick, with a mouse-over tooltip and a preview of their abilities. Heroes are represented as special effects, not as units, allowing for the hero to be shown locally, only to the player selecting it. Heroes can play animations and emotes when they are preselected and/or picked.

There are many additional features, such as All Random, Ban Phase, and Repick. You can set up multiple pages of heroes or enable certain heroes only for specific players or teams. You can define your own callback functions to add functionality that is not possible with the default options.

While the config is quite long, it is only because every part of the presentation can be customized. If you don't like any of the features shown in the showcase map, you can simply disable it. Getting a working system should be relatively easy, although copying all your heroes may be tedious if you have a lot of them.

I recommend using this system in conjunction with Neat Text Messages, which allows you to have more control over where text messages are shown.

Features
  • Supports any number of heroes with multiple pages.
  • Repick, Restart, Ban phase, and All Random.
  • Shared and separate hero selection.
  • Open and concealed hero selection.
  • Different selection screens for each team/player.
  • Different hero rosters for each team/player.

This system is based on the hero selection system used in Particle Party.

Installation

(GUI only) Make sure that in your editor under File -> Preferences, the flag "Automatically create unknown variables when pasting trigger data" is set.
(GUI only) Make sure you have JassHelper and vJASS enabled in the Trigger Editor under JassHelper.

Copy the Hero Selection parent folder from the test map of the respective language into your map. Do the same for Neat Text Messages if you want to use it.

Import
  • HeroSelectionMenu.fdf
  • CustomTooltip.fdf
  • HeroSelectionTemplates.toc
  • GeneralHeroGlow.mdx (optional)

Copy Destructables (optional)
  • Hero No Shadow
  • Hero Shadow
These destructables are used to cast a shadow that only those players previewing a hero can see.


To get started with your setup and customization, follow the steps laid out in the Hero Selection Documentation script file in the Hero Selection folder.

Change Log

Version 1.4
  • Added the BanHeroFromSelectionForPlayer function.

Version 1.3.4
  • Fixed an issue that could cause the game to desync during initialization when a player hasn't focused the Warcraft 3 window.
  • Fixed an issue that caused the hero selection buttons to remain focused after selecting a hero.

Version 1.3.3
  • Fixed a bug that caused the menu to not go into the widescreen area in the vJASS and GUI versions.
  • Fixed a bug that caused the pages to not cycle to a hero on a different page when selected through Suggest Random.

Version 1.3.2
  • Fixed a bug that could cause a desync due hiding/showing ConsoleUIBackdrop locally.
  • Two additional arguments are passed to the HeroSelectionOnPick callback function. These are wasRandomPick and wasRepick.

Version 1.3
  • Improved GUI documentation and import instructions.
  • Enabled hero selection menu and tooltips to be put into the widescreen area. For the menu, this is done by setting MENU_X_LEFT to a negative number. The menu will automatically be adjusted for players who aren't using widescreen monitors.
  • Added the option to add player name texttags over the background heroes. The option in the config is PLAYER_TEXT_TAGS under "Sounds and visuals of background heroes."

Version 1.2
  • Added many page cycle button styles.
  • Added OnRestart callback function.
  • Moved all globals that can be used in callbacks into the callbacks block.
  • Cleaned up code and fixed minor bugs.

Version 1.1
  • Added support for large number of heroes by adding option to setup multiple pages.
  • Split config and callbacks into two files.
  • You no longer need to set the model paths of heroes manually.
  • Tinting colors of heroes will now be shown.
  • Consolidated select and ban buttons into one button.
  • Added option to set the scale of the accept button.
  • Added option to lock top edge of tooltips instead of bottom edge.
  • Cleaned up code and fixed minor bugs.

Credits

Showcase map terrain by illbean.

Trees - Fingolfin
Night Elf Archway - eubz, Stormknight
Fog and Glow - Embercraft
Hero Highlight Effects - Vinz
Music - Nightsong (World of Warcraft)

Thank you to Wrda for the extensive review and all the suggestions!
[/CENTER]
Contents

Antares' Hero Selection v1.5 GUI (Map)

Antares' Hero Selection v1.5 Lua (Map)

Antares' Hero Selection v1.5 vJASS (Map)

Reviews
Wrda
Awarded Director's Cut due to: 1. how the resource outshines others alike and how it exceeds common expectations; 2. supports GUI, vJASS, and LUA; 3. high quality in performance, documentation and configuration. It's a very inspiring resource, full...
You can write custom code into the HeroSelectionOnPick function. The whichHero parameter in the vJASS version or the ahs_hero variable in the GUI version specifies the hero that was selected. Now you should be able to write your custom logic and disable heroes based on which hero was selected with BanHeroFromSelection.
 
Level 11
Joined
Dec 16, 2017
Messages
418
How can i fix players overlapping on the circle? I am trying with 1 user(me) and 5 computers to use it, player 2 and player 3 get's well put the heroes, but player 4 get stacked on player 3 circle, while players 5 and 6 aren't showed when they pick, and there are created only 3 circles, 1 for user and 2 for computers, instead of a total of 7.

And also, the tooltips of abilities and from hero description, aren't showed either when i have the mouse over them like in the template.
WC3ScrnShot_121624_140819_000.png
 
The locations of the background heroes are controlled by the GetPlayerBackgroundHeroLocation function / SetPlayerBackgroundHeroLocations trigger.

The reason the tooltips do not show up is most likely because you forgot to import the CustomTooltip.fdf file or imported it to the wrong path.
 
Level 11
Joined
Dec 16, 2017
Messages
418
Ah, yeah, the path was wrong for customtooltip, didn't saw it.

And about locations, shouldn't it get the same way it does in the template? I am using the vjass version, and i copied it the exact same way and tried to test it with computers, shouldn't it behave the same way?
 
If you take a look at the default hero location function, it looks at the player's slot in his or her respective team, puts the hero on the first location if the player is in the first slot, into the second location if it's the second slot, and in the third location otherwise. Then, if the player is in team 2, it reflects the angle so it appears on the other side.
Lua:
        --Example code:
        local angle ---@type number
        local dist ---@type number
        local BACKGROUND_HERO_OFFSET_BACKROW      = 1425 ---@type number
        local BACKGROUND_HERO_OFFSET_FRONTROW     = 1250 ---@type number

        if teamSize == 1 then
            angle = 9
            dist = BACKGROUND_HERO_OFFSET_BACKROW
        elseif slotInTeam == 1 then
            angle = 5
            dist = BACKGROUND_HERO_OFFSET_BACKROW
        elseif slotInTeam == 2 then
            angle = 13
            dist = BACKGROUND_HERO_OFFSET_BACKROW
        else
            angle = 9
            dist = BACKGROUND_HERO_OFFSET_FRONTROW
        end

        if whichTeam == 2 then
            angle = -angle
        end
So, in your map, you must have changed the team compositions and therefore the hero locations.
 
Level 6
Joined
Sep 5, 2022
Messages
24
Was a pleasure to work on the terrain for the project. Now that I'm trying to install it in my own map, I can why it was awarded "Directors Cut"

There are so many things to this, so many layers that Shrek would be in awe.

Im having difficulties installing it properly because I don't speak Lua, but i'm getting there... slowly... And boy oh boy does my map seem a lot more proffesional with this system only half implemented!
 
How come you set Tooltip as an ability instead of just a string?
I set it to be a string and found it much easier to manage.

JASS:
set Warden.tooltipAbility             = "Cunning Hero, adept at ..."
...
string tooltipAbility
...
            call BlzFrameSetText(heroSelectionButtonTooltipText[whichHero.index] , whichHero.tooltipAbility)
 
Last edited:
So am having a wierd issue when setting the flag unavailableToTeam = true, for heroes on team 2 only, across my two teams.

For team 1 (horde) everything appears to be working correctly. These images should show how it should be, and how I'd expect it to work for team 2.

(Page 1 & 2)

Team1.PNG
team1-pg2.PNG


However,

For team 2 (alliance). When I first load in, I immediately see that the rows are off. There should only ever 3 heroes per row.


start.PNG


Once I change to the second page, we can a see bit more clearly that some of the horde heroes are still displaying. This is despite setting them all unavailable to team 2. (And yes I tripled checked this)
e.g:
set Arcane_Mage_H.unavailableToTeam[2] = true

(Team 2, page 2)

Error with Team page-22.PNG


Finally, going back to the 1st page on team 2, we can now see the unavailable heroes are now populating. However, it appears to be just the last hero in that respective category for team 1 is being displayed.

Error with Team 2-hilights.PNG



So I am not sure what is happening here.


I double-checked these variables to see if one team was loading differently than the other, but they are exactly the same across teams.

start1-1-png.519381



I know something is likely going wrong in InitMenu and DisplayNewPage, but can't figure out exactly where.

probably dealing with call BlzFrameSetVisible(heroSelectionButton but I haven't been able to figure out where. (Jass)


JASS:
    private function DisplayNewPage takes integer P returns nothing
        local integer i
        call BlzFrameSetVisible(heroSelectionButtonHighlight, PAGE_OF_CATEGORY[Hero.list[preselectedHeroIndex[P]].category] == currentPage)
        set i = 1
        loop
            exitwhen i > NUMBER_OF_CATEGORIES
            call BlzFrameSetVisible(heroSelectionCategory[i], PAGE_OF_CATEGORY[i] == currentPage)
            set i = i + 1
        endloop
        set i = 1
        loop
            exitwhen i > NUMBER_OF_HEROES
            call BlzFrameSetVisible(heroSelectionButton[i], PAGE_OF_CATEGORY[Hero.list[i].category] == currentPage)
            set i = i + 1
        endloop
    endfunction
 

Attachments

  • start1-1.PNG
    start1-1.PNG
    195.7 KB · Views: 32
Last edited:
Version 1.5
  • Fixed a bug that occured when both heroes that are disabled for teams and multiple pages exist.
  • Fixed a bug that caused the foreground hero's glow to not be colored to the local player's player color.
  • Added the "LeftVerticalButton" page cycle button option.
  • You can now choose between a tooltip ability or a tooltip string to generate the hero tooltips. This is not available in the GUI version. In the GUI version, you can now set the tooltip to the hero's unit tooltip by leaving the tooltipAbility field blank. It has been added to the documentation of all versions that the tooltipAbility can also point to a unit tooltip.

Thank you to @DarkePacific for bug reports and suggestions!
 
Top