1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  3. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  4. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  5. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  6. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  7. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  8. 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.

[vJass] Heath & Mana bar system v2.1

Submitted by nhocklanhox6
This bundle is marked as approved. It works and satisfies the submission rules.
-------------------------------------------
**
**M A N A**
**
**B A R S**
**
**S Y S T E M**

I/ How to use and how to import
How to import
Code (vJASS):

//               H O W   T O   I M P O R T
//    1: Export LightningData.slk, nhocklanhox6-Elphis.blp, nhocklanhox6-Nyuu.blp, Elphis-Nyuu and import it into your map
//    2: Change path of LightningData.slk = Splats\LightningData.slk
//    3: Change path of nhocklanhox6-Nyuu.blp = ReplaceableTextures\Manabar\nhocklanhox6-Nyuu.blp
//    4: Change path of nhocklanhox6-Elphis.blp = ReplaceableTextures\Manabar\nhocklanhox6-Elphis.blp
//    5: Change path of Elphis-Nyuu = ReplaceableTextures\HitPointBar\Elphis-Nyuu.blp
//    WARNING: DO NOT CHANGE THIS PATH, IF YOU CHAGE THIS PATH, ALL LIGHTNING WILL CRASH
//    5: Copy trigger Mana bars and all trigger of folder Resources into your map
//    6: Read how to use
//    7: Enjoy :D

How to use
Code (vJASS):

//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//         M A N A & H E A T H    B A R    S Y S T E M
//                    =======
//         System created by:
//                           - Elphis
//                           - Special thanks to Bowser499 for help me improve this system.
//  What system does:
//                   This system allow you to create a mana bars on unit :)
//
//                   HOW TO USES:
//!                                 novjass
    struct Manabars......
    //===========================ALL ABOUT HELPING METHOD===========================
    //**This method help you to hide mana bars for player**
    method hideBarsToPlayer takes /*
    */
player p /* Which player you want to hide
    */
boolean hide /* Boolean hide bars
    */
returns nothing /*
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsToPlayer(Player(0),true) /*
                        //if you want to show again
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarstoPlayer(Player(0),false) /*
    //This method help to hide bars to all enemies of this player, that mean, only you and your allies can see this bars
    */
method hideBarsToEnemies takes /*
    */
boolean hide /* Boolean hide bars
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsToEnemies(true) /*
                        //if you want to show again
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsToEnemies(false) /*
    //This method help to hide bars to all player, that mean, only you can see this bars
    */
method hideBarsAllPlayers takes /*
    */
boolean hide /* Boolean hide bars
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsAllPlayers(true) /*
                        //if you want to show again
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsAllPlayers(false) /*
    **This method help you to destroy data and also destroy bars**
    */
method removeBars takes nothing returns nothing /*
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.removeBars()
    //******************************************************************************
    //                      MAIN SYSTEM
    //******************************************************************************
    //This method add bars to unit
    static method add takes /*
    */
unit u /* Which unit you want to add
    */
real scale /* Scale (Size) of unit
    */
integer data /* Save data of bars with number, very important ( Like Hastable )
    */
boolean hpbaractivator /* Allow to create hp bar to unit
    */
boolean mpbaractivator /* Allow to create mana bar to unit
    */
boolean hidebars /* if = true, only you can see this bars
    */
boolean hidebarsenemies /* if = true, only you and your allies can see this bars
    */
returns nothing
    //NOW FOR EXAMPLE
                    call Manabars.add(udg_u,1.,50,false,true /*that mean, only you and your allies can see this bars :)*/)
                    /*Save this bars with number 50, when you want to destroy this bars or stuff, you need to use this number*/
    //This method help you chage data of bars to another unit.
    method changeData takes /*
    */
unit u /* Which unit you want to change bars
    */
real scale /* Scale (Size) of unit
    */
integer savenumber /* With data number
    */
return nothing /*
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call changeData(GetTriggerUnit(),GetHandleId(GetTriggerUnit())
    //
//!                                 endnovjass

II/ System Code:
HPMP Bars
Code (vJASS):

//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//         M A N A & H E A T H    B A R     S Y S T E M
//                    =======
//         System created by:
//                           - Elphis
//                           - Special thanks to Bowser499 for help me improve this system.
//  What system does:
//                   This system allow you to create a mana bars on unit :)
//
//                   HOW TO USES:
//!                                 novjass
    struct Manabars......
    //===========================ALL ABOUT HELPING METHOD===========================
    //**This method help you to hide mana bars for player**
    method hideBarsToPlayer takes /*
    */
player p /* Which player you want to hide
    */
boolean hide /* Boolean hide bars
    */
returns nothing /*
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsToPlayer(Player(0),true) /*
                        //if you want to show again
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarstoPlayer(Player(0),false) /*
    //This method help to hide bars to all enemies of this player, that mean, only you and your allies can see this bars
    */
method hideBarsToEnemies takes /*
    */
boolean hide /* Boolean hide bars
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsToEnemies(true) /*
                        //if you want to show again
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsToEnemies(false) /*
    //This method help to hide bars to all player, that mean, only you can see this bars
    */
method hideBarsAllPlayers takes /*
    */
boolean hide /* Boolean hide bars
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsAllPlayers(true) /*
                        //if you want to show again
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.hideBarsAllPlayers(false) /*
    **This method help you to destroy data and also destroy bars**
    */
method removeBars takes nothing returns nothing /*
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call m.removeBars()
    //******************************************************************************
    //                      MAIN SYSTEM
    //******************************************************************************
    //This method add bars to unit
    static method add takes /*
    */
unit u /* Which unit you want to add
    */
real scale /* Scale (Size) of unit
    */
integer data /* Save data of bars with number, very important ( Like Hastable )
    */
boolean hpbaractivator /* Allow to create hp bar to unit
    */
boolean mpbaractivator /* Allow to create mana bar to unit
    */
boolean hidebars /* if = true, only you can see this bars
    */
boolean hidebarsenemies /* if = true, only you and your allies can see this bars
    */
returns nothing
    //NOW FOR EXAMPLE
                    call Manabars.add(udg_u,1.,50,false,true /*that mean, only you and your allies can see this bars :)*/)
                    /*Save this bars with number 50, when you want to destroy this bars or stuff, you need to use this number*/
    //This method help you chage data of bars to another unit.
    method changeData takes /*
    */
unit u /* Which unit you want to change bars
    */
real scale /* Scale (Size) of unit
    */
integer savenumber /* With data number
    */
return nothing /*
    //NOW FOR EXAMPLE:
                        */
local Manabars m = BARS_TAB[<whichdata>] /*
                        */
call changeData(GetTriggerUnit(),GetHandleId(GetTriggerUnit())
    //
//!                                 endnovjass
//
//
//               H O W   T O   I M P O R T
//    1: Export LightningData.slk, nhocklanhox6-Elphis.blp, nhocklanhox6-Nyuu.blp, Elphis-Nyuu and import it into your map
//    2: Change path of LightningData.slk = Splats\LightningData.slk
//    3: Change path of nhocklanhox6-Nyuu.blp = ReplaceableTextures\Manabar\nhocklanhox6-Nyuu.blp
//    4: Change path of nhocklanhox6-Elphis.blp = ReplaceableTextures\Manabar\nhocklanhox6-Elphis.blp
//    5: Change path of Elphis-Nyuu = ReplaceableTextures\HitPointBar\Elphis-Nyuu.blp
//    WARNING: DO NOT CHANGE THIS PATH, IF YOU CHAGE THIS PATH, ALL LIGHTNING WILL CRASH
//    5: Copy trigger Mana bars and all trigger of folder Resources into your map
//    6: Read how to use
//    7: Enjoy :D
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
//********************************************************************************
library Manabars/*
                                */
requires /*
                                */
         CTL        /*
                                */
         Table      /*
                                */
         Alloc
    //
    globals
        //===================================CONFIGURATION===================================
        //***********************************SYSTEM SETTINGS*********************************
        //System Periodic
        private         constant            real            PERIODIC            =           0.031250000
        //Location you want to move when unit dead
        private         constant            real            DEAD_LOC            =           0.
        //
        //==================================NON-CONFIGURATION=================================
        private                             location        barLocation         =           Location(0.,0.)
        //
        private         constant            string          MP_MODEL            =           "ELPH"
        private         constant            string          HP_MODEL            =           "ICEF"
        private         constant            string          MP_EMPTY            =           "NYUU"
        //
        private         constant            real            Z_OFFSET            =           181.
        private         constant            real            MP_LONG             =           66.
        private         constant            real            SAFE_MP             =           20.
        private         constant            real            Z_HP_OFFSET         =           21.
        //
                                            Table           BARS_TAB
        //*************************************************************************************
    endglobals
    //====================================DO NOT CHANGE ANYTHING BELOW====================================
    struct Manabars extends array
        implement Alloc
        private boolean         release
        private unit            caster
        private integer         barsData
        private real            unitScale
        private lightning       firstLightning
        private lightning       secondLightning
        private lightning       thirdLightning
        private lightning       fourthLightning
        private static boolean   array barsHidden

        method changeData takes unit whichUnit, real newScale, integer saveNumber returns boolean
            local boolean dataExist = BARS_TAB.has(barsData)
           
            if dataExist then
                call BARS_TAB.remove(barsData)
                set unitScale          = newScale
                set caster             = whichUnit
                set BARS_TAB[barsData] = this
            else
                debug call BJDebugMsg("Can't change data.")
            endif
           
            return dataExist
        endmethod
       
        method removeBars takes nothing returns boolean
            local boolean barsRemoved = caster != null
       
            if barsRemoved then
                set release = true
                call BARS_TAB.remove(barsData)
                call DestroyLightning(firstLightning)
                call DestroyLightning(secondLightning)
                call DestroyLightning(thirdLightning)
                call DestroyLightning(fourthLightning)
                set firstLightning  = null
                set secondLightning = null
                set caster          = null
                call this.deallocate()
            else
                debug call BJDebugMsg("Can't remove bars: the unit does not exist.")
            endif

            return barsRemoved
        endmethod
       
        method isHidden takes player whichPlayer returns boolean
            return barsHidden[GetPlayerId(whichPlayer)]
        endmethod
       
        method hideBarsToPlayer takes player whichPlayer, boolean doHide returns nothing
            local real    alphaNum = 1
            local integer playerId = GetPlayerId(whichPlayer)
           
            if caster != null then
                set barsHidden[playerId] = doHide
               
                // Special case: hidden units.
                if not doHide and IsUnitHidden(caster) then
                    debug call BJDebugMsg("Can't show bars: the unit is hidden.")
                else
                    if doHide then
                        set alphaNum = 0
                    endif
                   
                    if GetLocalPlayer() == whichPlayer then
                        call SetLightningColor(firstLightning ,1.,1.,1.,alphaNum)
                        call SetLightningColor(secondLightning,1.,1.,1.,alphaNum)
                        call SetLightningColor(thirdLightning,1.,1.,1.,alphaNum)
                        call SetLightningColor(fourthLightning,1.,1.,1.,alphaNum)
                    endif  
                endif
            else
                debug call BJDebugMsg("Can't operate bars: the unit does not exist.")
            endif
        endmethod
       
        method hideBarsAllPlayers takes boolean doHide returns nothing
            local integer i           = 0
            local player  casterOwner = GetOwningPlayer(caster)
            local player  curPlayer

            if caster != null then
                loop
                    exitwhen i > 11
                    set curPlayer = Player(i)
                    call hideBarsToPlayer(curPlayer,curPlayer != casterOwner)
                    set i = i + 1
                endloop
            else
                debug call BJDebugMsg("Can't operate bars: the unit does not exist.")
            endif
        endmethod
       
        method hideBarsToEnemies takes boolean doHide returns nothing
            local integer i           = 0
            local player  casterOwner = GetOwningPlayer(caster)
            local player  curPlayer

            if caster != null then
                loop
                    exitwhen i > 11
                    set curPlayer = Player(i)
                    call hideBarsToPlayer(curPlayer,IsPlayerEnemy(curPlayer,casterOwner))
                    set i = i + 1
                endloop
            else
                debug call BJDebugMsg("Can't operate bars: the unit does not exist.")
            endif
        endmethod

            //Periodic of this system.
            implement CTL
                local real locX  = 0.
                local real locY  = 0.
                local real locZ  = 0.
                local real barX  = 0.
                local real barZ  = 0.
                local real indX  = 0.
                local real ind2X = 0.
                local real percentage
            implement CTLExpire
                if GetUnitTypeId(caster) == 0 or release then
                    call removeBars()
                elseif IsUnitType(caster,UNIT_TYPE_DEAD) then
                    call MoveLightning(firstLightning ,true,DEAD_LOC,DEAD_LOC,DEAD_LOC,DEAD_LOC)
                    call MoveLightning(secondLightning,true,DEAD_LOC,DEAD_LOC,DEAD_LOC,DEAD_LOC)
                    call MoveLightning(thirdLightning,true,DEAD_LOC,DEAD_LOC,DEAD_LOC,DEAD_LOC)
                    call MoveLightning(fourthLightning,true,DEAD_LOC,DEAD_LOC,DEAD_LOC,DEAD_LOC)
                else
                    set locX = GetWidgetX(caster)
                    set locY = GetWidgetY(caster)

                    call MoveLocation(barLocation,locX,locY)
                   
                    set locZ = GetLocationZ(barLocation)
                   
                    set percentage = GetCameraField(CAMERA_FIELD_TARGET_DISTANCE)/(bj_CAMERA_DEFAULT_DISTANCE+250)

                    set barX = locX - MP_LONG*percentage
                    set barZ = locZ + GetUnitFlyHeight(caster) + Z_OFFSET*unitScale - SAFE_MP
                   
                    set indX  = barX + percentage*MP_LONG*2*GetUnitState(caster,UNIT_STATE_MANA)/GetUnitState(caster,UNIT_STATE_MAX_MANA)
                    set ind2X = locX + MP_LONG*percentage
                   
                    call MoveLightningEx(secondLightning,true,ind2X,locY,barZ,barX,locY,barZ)
                    call MoveLightningEx(thirdLightning,true,ind2X,locY,barZ+Z_HP_OFFSET,barX,locY,barZ+Z_HP_OFFSET)
                    call MoveLightningEx(firstLightning,true,barX,locY,barZ,indX,locY,barZ)
                    call MoveLightningEx(fourthLightning,true,barX,locY,barZ+Z_HP_OFFSET,indX,locY,barZ+Z_HP_OFFSET)
                endif
            implement CTLEnd
       
        static method add takes unit u,real scale,integer data,boolean hpbaractivator,boolean mpbaractivator,boolean hidebars,boolean hidebarsenemies returns nothing
            local thistype this
            local real     x    
            local real     y    
            local player   p    
            local integer  i    = 0
            //
            if not hpbaractivator and not mpbaractivator then
                return
            endif
            //
            if BARS_TAB.has(data) then
                debug call BJDebugMsg("Can't add bars")
            else
                set this = create()
                set p = GetOwningPlayer(u)
                //Save data with number
                set BARS_TAB[data] = this

                set caster = u
                set barsData = data
                set unitScale = scale

                set release = false

                set x = GetWidgetX(caster)
                set y = GetWidgetY(caster)
                if mpbaractivator then
                    set firstLightning  = AddLightning(MP_MODEL,true,x,y,x,y)
                    set secondLightning = AddLightning(MP_EMPTY,true,x,y,x,y)
                else
                    set firstLightning = null
                    set secondLightning = null
                endif
                //
                if hpbaractivator then
                    set thirdLightning = AddLightning(MP_EMPTY,true,x,y,x,y)
                    set fourthLightning = AddLightning(HP_MODEL,true,x,y,x,y)
                else
                    set thirdLightning = null
                    set fourthLightning = null
                endif
                if hidebars then
                    call hideBarsAllPlayers(hidebars)
                elseif hidebarsenemies then
                    call hideBarsToEnemies(hidebarsenemies)
                endif
            endif
        endmethod

        private static method onInit takes nothing returns nothing
            //Table install
            set BARS_TAB = Table.create()
        endmethod
    endstruct
endlibrary
[/HIDDEN]

III/ System Screen Shot
[​IMG]
IV/ Credits:
Click to view CTL
Click to view ErrorMessages
Click to view Alloc
Click to view Table
-------------------------------------------
HPMP Bars

Change Log

v1.0: First release version.
v1.1: Optimized, add new method, bars color changed.
v1.2: A REAL MP BARS.
v1.3: Optimized, fix method.
v1.4: Add new data.
v1.5: Optimized.
v1.6: Bugs fixed.
v1.7: Using CTL instead of TimerUtils.
v1.8: Optimized.
v1.9: Fixed the bar has incorrect height offset on uneven ground.
v1.20: - Improved changeData's method structure. It also returns a boolean now that will identify if the data was changed or not.
- Improved removeBars's method structure. It now contains a debug message if bar removal failed and also returns a boolean that will indicate such a situation.
- Optimized hideBarsToPlayer method: minimized the local data amount, making the overall code safer.
- Added isHidden method that allows to track if the bar is hidden or shown.
- Added barsHidden boolean array to the struct for tracking if the bar is hidden or shown.
- Variables got decent names.
v2.1: Hp bar added


Keywords:
mana, bars, lightning
Contents

Mana bars (Map)

Reviews
Moderator
Mana bars system v1.9 | Reviewed by Maker | 19th October 2013 Concept[/COLOR]] [IMG] People are always looking for ways to differentiate their maps from others. Adding customization is one way to do it an you provide a nice system that many...
  1. Mana bars system v1.9 | Reviewed by Maker | 19th October 2013
    • Concept[/COLOR]]
      [​IMG]
      People are always looking for ways to differentiate their maps from others.
      Adding customization is one way to do it an you provide a nice system
      that many people can find useful

      There could be a health bar added to the system
    • Triggers[/COLOR]]
      [​IMG]
      • The code is leakless an MUI
      • The code is neat and clean and efficient
      [​IMG]
      • Instead of the unit group working as a boolean,
        use
        method has
        from
        Table
      • You could check if the unit is hidden
      • The height of the bar is bugged on flying units, but that can prove
        to be difficult to fix
    • Effects[/COLOR]]
      [​IMG]
      • Both the empty and the full bars look sufficiently good, however
        I think they could be slightly sharper or higher resolution
    • Rating[/COLOR]]
      CONCEPT TRIGGERS EFFECTS RATING STATUS

      5

      4

      4

      4

      APPROVED

    • Links[/COLOR]]
    [/td]

    Old reviews

    Mana bars system v1.7 | Reviewed by Maker | 18th Oct 2013
    NEEDS FIX

    [​IMG]
    • The bar has incorrect height offset on uneven ground
    [​IMG]
    • Instead of the unit group working as a boolean,
      use
      method has
      from
      Table
    • You do not need to null
      local player p
    • Organize the checks like this
      Code (vJASS):

      if GetUnitTypeId(caster) == 0 or release then
          Remove
      elseif IsUnitType(caster,UNIT_TYPE_DEAD) then
          MoveToDeadLoc
      else
          Update
      endif
    • Don't call
      MoveLocation
      or get the x/y if you don't go to the update block

    [tr]
    [/tr]
     
  2. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    New system updated !
     
  3. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    open again, yeah yeah
     
  4. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,926
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    Cool, and awesome system
    i love that mana bar
    good job, nee-san

    5/5
     
  5. DeuceGorgon

    DeuceGorgon

    Joined:
    Nov 25, 2012
    Messages:
    171
    Resources:
    7
    Models:
    6
    Maps:
    1
    Resources:
    7
    Make health and mana bar in GUI and i will love you :D Jass is bad for me.
     
  6. TheWrecker

    TheWrecker

    Joined:
    Jul 4, 2012
    Messages:
    74
    Resources:
    1
    JASS:
    1
    Resources:
    1
    o_O, GJ, + Rep , 5/5
     
  7. xyzier_24

    xyzier_24

    Joined:
    Oct 16, 2011
    Messages:
    235
    Resources:
    7
    Models:
    4
    Icons:
    1
    Spells:
    2
    Resources:
    7
  8. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,926
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    onee-san's is much better! D:
     
  9. Kazeon

    Kazeon

    Joined:
    Oct 12, 2011
    Messages:
    3,296
    Resources:
    38
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    3
    JASS:
    4
    Resources:
    38
    the bars won't shows. I have entered all possible command, but still it wont appears
     
  10. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,926
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    did you follow the "How to use"?
     
  11. Kazeon

    Kazeon

    Joined:
    Oct 12, 2011
    Messages:
    3,296
    Resources:
    38
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    3
    JASS:
    4
    Resources:
    38
    no =))
     
  12. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    Sorry, after fix system, i fotgot about enable system again, my bad, you can download again and see how it work :)
     
  13. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    maybe try to make the bar itself look more like the hp bar? so that it will feel like it's been there ever since
     
  14. Kazeon

    Kazeon

    Joined:
    Oct 12, 2011
    Messages:
    3,296
    Resources:
    38
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    3
    JASS:
    4
    Resources:
    38
    I have retried this, everything's work fine now, the only thing I dislike is that the bar is a little transparent, so it looks like fused with the flame strike sfx.
     
  15. chobibo

    chobibo

    Joined:
    Sep 24, 2005
    Messages:
    2,707
    Resources:
    0
    Resources:
    0
    Does this use a lightning to display the mp bars? cool...
     
  16. bowser499

    bowser499

    Joined:
    Jul 20, 2009
    Messages:
    782
    Resources:
    7
    Tools:
    1
    Maps:
    3
    Spells:
    3
    Resources:
    7
    It's pretty much nice idea about these bars :)
    Review for v1.6.

    Originality: 4.5/5. This system isn't something that can be called a breakthrough, but it's still nice idea to make custom mana bar displaying. It is handy for many players and actual for many map makers that want to make players' life a bit more easier. Talking about originality, similar system can be seen in Invasion in Duskwood map. I am also providing some examples of similar 'bar' systems:
    Execution: 4.2/5. Some problems that I've pointed out:
    • Bad variable naming. Here this naming is especially bad. I think that you must read JPAG for many tips about the proper variable naming. That must help you in writing your code and making it more readable!
    • if not IsUnitType(caster,UNIT_TYPE_DEAD) and GetUnitTypeId(caster) != 0 and not release then
      is the bright example of very bad condition block forming. The thing is that
      not
      is an operator aswell and it consumes some resources while executing the code. In many cases you can just invert this block with
      else
      to get more performance. The correct condition must look like that:
      if IsUnitType(caster,UNIT_TYPE_DEAD) and GetUnitTypeId(caster) == 0 and release then
      Please keep it in mind. Same with
      if not IsUnitInGroup(u,G) then
      and many others.
    • I strictly advise you to use LightningUtils there. There is absolutely no need for fatal errors from this system.

    Usability: 5/5. Very nice system for the map of any genre. Nothing more to say.

    Overall: (4.5+4.2+5)/3 = 4.5 = 4/5. Nice and easy to use system. I can not give Highly Recommended rating because of not very clean execution there, so until it's changed and improved, I will place Recommended here.

    4/5: Recommended
     
  17. Lord_Marrowgrath

    Lord_Marrowgrath

    Joined:
    Aug 23, 2011
    Messages:
    652
    Resources:
    9
    Maps:
    5
    Template:
    4
    Resources:
    9
  18. scy5115

    scy5115

    Joined:
    May 27, 2013
    Messages:
    16
    Resources:
    0
    Resources:
    0
    I must say the way this works is really quite ingenious! I'm going to use this for my map :) +rep
     
  19. Noobsmoke

    Noobsmoke

    Joined:
    Nov 20, 2007
    Messages:
    631
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Well done dude