• 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.

TasSpellView

This bundle is marked as pending. It has not been reviewed by a staff member yet.

Introduction


TasSpellView is a custom UI system for Warcraft 3 V1.31 or higher.
It allows to see the abilities of units one can not command.

Details


Creates a set of custom buttons over the default command card while one selects an unit of which the player has no control.
The custom buttons display icon, tooltips, current cooldown & current Level. Does not display requirments nor disable state.
The tooltip contain manacosts, cooldown, range and aoe.
For (Warcraft V1.31.1) cooldown, Level & correct tooltip-Level are only displayed when the abilityCodes are provided on an unitCode ('Hpal') base. Does not matter if your map only has 1 level skills. Or when the system runs in a Warcraft 3 version with BlzGetAbilityId (with that it can calc it during the match). Reforged has it.

TasSpellView is not shown during ReplayMode.
Should work for Observers.

The Setup from the Lua map script.
Lua:
TasSpellView = {
    AutoRun = true --(true) will create Itself at 0s, (false) you need to InitSpellView()
    ,TocPath = "war3mapImported\\TasSpellView.toc"
    ,ParentFuncSimple = function()
        if GetHandleId(BlzGetFrameByName("CommandBarFrame", 0)) > 0 then return BlzGetFrameByName("CommandBarFrame",  0) end
        return BlzGetFrameByName("ConsoleUI", 0)
    end
    ,ParentFunc = function() return BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0) end
    ,UpdateTime = 0.1 -- lower number is faster
    ,ShowCooldown = true -- can be set async, needs BlzGetAbilityId for ability by index 
    ,ToolTipSizeX = 0.26
    ,ToolTipPosX = 0.79
    ,ToolTipPosY = 0.165
    ,ToolTipPos = FRAMEPOINT_BOTTOMRIGHT
    ,Data = {}        
    ,UnitSkills = { 
        -- you can store the abilities shown for that unitCode
        --, otherwise the system will show the abilites found by index which pass the filter
        [FourCC'Ulic'] = {[1]= FourCC'AUfn',[2]= FourCC'AUfu',[3]= FourCC'AUdr',[4]= FourCC'AUdd'}
    }
    ,MOD_ABI = 1
    ,MOD_ABI_CODE = 0
    ,AbilityCache = {} -- makes performance better in V1.31 cause it lacks ParseTags and needs to do tooltip nonsense which with a cachce needs to be done only once.
}
JASS:
// when REFORGED = false you need to tell the abilityCodes used by units to have cooldown display
// the unit does not need to have the skills they are displayed when added that way.
// call TasSpellView_AddUnitCodeData('Ulic', "AUfn,AUfu,AUdr,AUdd")

    globals
        constant boolean REFORGED = true // have BlzGetAbilityId? otherwise false
        public boolean AutoRun = true //(true) will create Itself at 0s, (false) you need to InitSpellView()
        public string TocPath = "war3mapImported\\TasSpellView.toc"

        public real UpdateTime = 0.1
        public boolean ShowCooldown = true // can be set async, needs BlzGetAbilityId for ability by index 

        //ToolTip
        public real ToolTipSizeX = 0.26
        public real ToolTipPosX = 0.79
        public real ToolTipPosY = 0.165
        public framepointtype ToolTipPos = FRAMEPOINT_BOTTOMRIGHT
...
...
endglobals

    public function ParentFuncSimple takes nothing returns framehandle
        if GetHandleId(BlzGetFrameByName("CommandBarFrame", 0)) > 0 then
            return BlzGetFrameByName("CommandBarFrame",  0)
        endif
        return BlzGetFrameByName("ConsoleUI", 0)
    endfunction
    public function ParentFunc takes nothing returns framehandle
        return BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0) 
    endfunction


How to install


Requiers Warcraft 3 1.31+ or higher
  • Copy TasSpellView Map Script (trigger Editor) (its content is enough).
  • export
    • war3mapImported\TasSpellView.fdf
    • war3mapImported\TasSpellView.toc
    • WHEN USING THE EXPORT ALL BUTTON, IT CAN HAPPEN THAT THE CONTENT OF THIS FILES SWAP
    • import them into your map
  • Installed


ChangeLog


V1.1c) buttonOverlay use ui scale options
V1.1b) vjass fixed a desync reason
V1.1a) added vjass Version
V1.1 First Release​
Previews
Contents

TasSpellView (Map)

Updated to V1.1b)
vjass
Fixed a desync reason (Removed ReplayDetection it entered the game in async context which would lead to a dc when not all players were forced to select an unit in the begining)
considers FrameLoader (Warcraft 3 Save&Load)
Fixed the jass AddUnitCodeData example
 
Level 6
Joined
Nov 3, 2018
Messages
79
This has so much potential , i wish it could be used on your own units or that has a way to customize it for certain units
(gui friendly would be a bless)
 
You mean like a custom tooltip system. meh that is not so easy or clean to do.

Because the map script api lacks something to know what uses a command button or what is displayed in the tooltip. Therefore one needs to guess it. The guess can fail, and group selection makes it more taxing/incorrect also excludes Warcraft3 V1.31.1 cause V1.31.1 cant know the current main selected unit in group selection, most of my stuff targets V1.31.1.
 
Uploaded V1.1c)
now uses the ui scale options for the command button overlay, that was done by adding a new default simple parent option. The tooltip will not scale.

It is only one line of change, if you want to change by yourself:
Lua:
,ParentFuncSimple = function()
            if GetHandleId(BlzGetFrameByName("CommandBarFrame", 0)) > 0 then return BlzGetFrameByName("CommandBarFrame",  0) end
            return BlzGetFrameByName("ConsoleUI", 0)
 end

JASS:
public function ParentFuncSimple takes nothing returns framehandle
        if GetHandleId(BlzGetFrameByName("CommandBarFrame", 0)) > 0 then
            return BlzGetFrameByName("CommandBarFrame",  0)
        endif
        return BlzGetFrameByName("ConsoleUI", 0)
    endfunction
 
Top