Progress Casting Bar MUI GUI

This bundle is marked as pending. It has not been reviewed by a staff member yet.
Progress Casting Bar MUI GUI
Simple but useful Casting Bar system. I found a surprisingly simple and beautiful solution that needed improvement to use. Based on - C:\fakepath\ProgressTest | HIVE Example and
JesusHipster's model.
I added the ability to use many times at the same time and different players.

Made on triggers and simple arrays without hashtables. Based on custom values of units.

update 0.2b Fixed the possibility of conflict with other spells

Registering spells
  • CBar Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet CBar_Ability = Thunder Clap
      • Trigger - Run CBar Generate <gen> (checking conditions)
      • Set VariableSet CBar_Ability = Storm Hammer
      • Trigger - Run CBar Generate <gen> (checking conditions)
Saving data
  • CBar Generate
    • Events
    • Conditions
    • Actions
      • Set VariableSet CBar_Abilities_c = (CBar_Abilities_c + 1)
      • Set VariableSet CBar_Abilities[CBar_Abilities_c] = CBar_Ability
Creating Casting Bar
  • CBar Cast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • For each (Integer CBar_Loop) from 1 to CBar_Abilities_c, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to CBar_Abilities[CBar_Loop]
            • Then - Actions
              • Set VariableSet CBar_Rnd = (Random integer number between 1 and 100)
              • Set VariableSet CBar_Time[CBar_Rnd] = (Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Real Level Field Casting Time ('acas'), of Level: ((Level of (Ability being cast) for (Triggering unit)) - 1))
              • Set VariableSet CBar_Time[CBar_Rnd] = (1.00 / (CBar_Time[CBar_Rnd] + 0.20))
              • Set VariableSet CBar_Point_A = ((Position of (Triggering unit)) offset by (0.00, 50.00))
              • Unit - Create 1 Progress Bar (Dummy) for (Owner of (Triggering unit)) at CBar_Point_A facing 270.00 degrees
              • Unit - Set the custom value of (Last created unit) to CBar_Rnd
              • Unit - Set the custom value of (Casting unit) to CBar_Rnd
              • Custom script: call RemoveLocation(udg_CBar_Point_A)
              • Set VariableSet CBar_Bar_c[CBar_Rnd] = (Last created unit)
            • Else - Actions
Run Bar
  • CBar DummyBar
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Progress Bar (Dummy)
    • Actions
      • Animation - Change (Triggering unit)'s animation speed to (CBar_Time[(Custom value of (Triggering unit))] x 100.00)% of its original speed
Stop
  • CBar Cast Stop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
    • Actions
      • For each (Integer CBar_Loop) from 1 to CBar_Abilities_c, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to CBar_Abilities[CBar_Loop]
              • CBar_Bar_c[(Custom value of (Triggering unit))] Not equal to No unit
            • Then - Actions
              • Set VariableSet CBar_Temp_i = (Custom value of (Triggering unit))
              • Unit - Change color of CBar_Bar_c[CBar_Temp_i] to Red
              • Animation - Change CBar_Bar_c[CBar_Temp_i]'s animation speed to 0.00% of its original speed
              • Animation - Change CBar_Bar_c[CBar_Temp_i]'s vertex coloring to (100.00%, 35.00%, 35.00%) with 0.00% transparency
              • Unit - Kill CBar_Bar_c[CBar_Temp_i]
              • Set VariableSet CBar_Bar_c[CBar_Temp_i] = No unit
              • Unit - Set the custom value of (Triggering unit) to 0
            • Else - Actions
And Finish (Color difference)
  • CBar Cast Finish
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • For each (Integer CBar_Loop) from 1 to CBar_Abilities_c, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to CBar_Abilities[CBar_Loop]
              • CBar_Bar_c[(Custom value of (Triggering unit))] Not equal to No unit
            • Then - Actions
              • Set VariableSet CBar_Temp_i = (Custom value of (Triggering unit))
              • Unit - Change color of CBar_Bar_c[CBar_Temp_i] to Light Blue
              • Animation - Change CBar_Bar_c[CBar_Temp_i]'s animation speed to 0.00% of its original speed
              • Animation - Change CBar_Bar_c[CBar_Temp_i]'s vertex coloring to (100.00%, 35.00%, 35.00%) with 0.00% transparency
              • Unit - Kill CBar_Bar_c[CBar_Temp_i]
              • Set VariableSet CBar_Bar_c[CBar_Temp_i] = No unit
              • Unit - Set the custom value of (Triggering unit) to 0
            • Else - Actions
Contents

Progress Bar Dummy Test Map (Map)

Level 4
Joined
Dec 30, 2019
Messages
54
Small Update: Fixed the possibility of conflict with other spells (because of using loop inside)
This is useful. Thank you
Thank you for your feedback
I'm conflicted:
Scumbag me wants to make a system using special effects behind your back.
Decent Me wants to inform you that special effects can easily replace the bar unit.
Here it works by changing the animation speed of the unit.
The animation speed is calculated via cast time.
 
Level 21
Joined
Jan 1, 2011
Messages
1,420
Please save the abilities into a hashtable to reduce lookup time. If you have hundreds of spells registered to the system, it will really bog it down.

Also why aren't you using effects, they are a lot less overhead performance wise and installing the script. Effects are now capable of doing anything a unit can, animation wise (and more).
 
Level 4
Joined
Dec 30, 2019
Messages
54
Please save the abilities into a hashtable to reduce lookup time. If you have hundreds of spells registered to the system, it will really bog it down.

Also why aren't you using effects, they are a lot less overhead performance wise and installing the script. Effects are now capable of doing anything a unit can, animation wise (and more).
Ok ill do it ASAP. I didnt use hashtable to reduce loading time, because it needs to be initialized.
 
Level 4
Joined
Dec 30, 2019
Messages
54
I have 2 problem to make it with SFX and with Hashtable.
1 - I cant get how to up attached to unit sfx (was trying z coords, height - makes crash and so on)
2 - Cant play animation thru the time, its always 1 sec and doesnt matter what i change.
  • CBar Cast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • For each (Integer CBar_Loop) from 1 to CBar_Abilities_c, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to CBar_Abilities[CBar_Loop]
            • Then - Actions
              • Set VariableSet CBar_Point_A = ((Position of (Triggering unit)) offset by (0.00, 200.00))
              • Special Effect - Create a special effect at CBar_Point_A using war3mapImported\ProgressBarDummyFinal.mdx
              • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using war3mapImported\ProgressBarDummyFinal.mdx
              • Special Effect - Set Position - X of (Last created special effect) to ((Position - X of (Last created special effect).) + 100.00)
              • Special Effect - Set Height of (Last created special effect) to: ((Position - Z of (Last created special effect).) + 400.00)
              • Special Effect - Set Position - Z of (Last created special effect) to ((Position - Z of (Last created special effect).) + 500.00)
              • Special Effect - Set Color of (Last created special effect) to color of (Owner of (Triggering unit))
              • Special Effect - Set Time of (Last created special effect) to 0.20
              • Special Effect - Play Special Effect: (Last created special effect), Animation: Birth
              • Special Effect - Set Time Scale of (Last created special effect) to 2.00
              • Special Effect - Set Time of (Last created special effect) to (Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Real Level Field Casting Time ('acas'), of Level: ((Level of (Ability being cast) for (Triggering unit)) - 0))
              • Special Effect - Set Time Scale of (Last created special effect) to (((1.00 / (Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Real Level Field Casting Time ('acas'), of Level: 1)) + 0.20) x 100.00)
              • Game - Display to (All players) the text: (String((Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Real Level Field Casting Time ('acas'), of Level: 1)))
              • Hashtable - Save Handle Of(Last created special effect) as (Key (Triggering unit).) of (Key (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast)).) in CBar_HT.
              • Game - Display to (All players) the text: (String((Key (Triggering unit).)))
              • Game - Display to (All players) the text: (String((Key (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast)).)))
              • Game - Display to (All players) the text: (String((Key (Last created special effect).)))
              • Custom script: call RemoveLocation(udg_CBar_Point_A)
            • Else - Actions
  • CBar Cast Stop
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Key (Triggering unit).) is stored as a Handle of (Key (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast)).) in CBar_HT..) Equal to True
        • Then - Actions
          • Special Effect - Set Color of (Load (Key (Triggering unit).) of (Key (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast)).) in CBar_HT.) to r: 255, g: 100, b: 100
          • Special Effect - Set Alpha of (Load (Key (Triggering unit).) of (Key (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast)).) in CBar_HT.) to 0
          • Special Effect - Play Special Effect: (Load (Key (Triggering unit).) of (Key (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast)).) in CBar_HT.), Animation: Death
          • Special Effect - Set Time of (Load (Key (Triggering unit).) of (Key (Unit: (Transporting unit)'s Ability with Ability Code: (Ability being cast)).) in CBar_HT.) to 0.25
          • Special Effect - Destroy (Load (Key (Triggering unit).) of (Key (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast)).) in CBar_HT.)
        • Else - Actions
Map is attached
 

Attachments

  • progressbar_v0.2b.w3x
    12.6 KB · Views: 50
Level 4
Joined
Jun 6, 2015
Messages
65
When I imported the progress bar unit to my map ALL my imported files got broken except the progress bar... Anyone know why?

Edit: I realize this has nothing to do with this system. It is obviously just what happens some times...
 
Last edited:
Level 3
Joined
May 17, 2019
Messages
43
There are some strange behaviours when Casting Time is higher than 5.
For instance with 7 the unit starts casting before the gauge is filled (easy to notice).

It also occurs with casting time higher than 10 which will always start casting before the gauge is filled.
 
Level 3
Joined
Mar 15, 2020
Messages
48
I've double and triple checked the triggers after importing them to another map yet when I try to cast a spell ingame, the progress bar fills up with the speed of the cast time of the spell, yet there is a long delay after that fact before the hero actually finishes casting the ability.

The Progress Bar (Dummy) unit and the model has been imported properly and so are the triggers.
 
Top