• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Casting-Channeling Bar v1.6.0

Casting-Channeling Bar v1.6.0

The casting bar is made out of floating text, and is displayed when a unit casts a spell.
The Casting Bar is hidden to players who don't have vision of the casting unit.
The casting bar's color variates depending on which player casted it.
NEW!
Reworked and removed a lot of useless GUI

This uses Bribe's Indexer
http://www.hiveworkshop.com/forums/spells-569/gui-unit-indexer-1-2-0-2-a-197329/?prev=search%3Dindexer%26d%3Dlist%26r%3D20

But this casting bar system can be used with any unit indexing system.



v1.0.0 - First release to hive.
v1.0.1 - Got rid of many hideous loops, removed the sight of bar (going to make it based off of player vision soon) and made size changeable. I also think I have made it easier to add/edit spells.
v1.0.2 - Added levels to casting time, also made it easier to add abilities.
v1.0.3 - Added offset and visibility of the bar to those who can see the casting unit.
v1.0.4 - Improved the code a TON, also fixed things due to request.
v1.5.0 - Added channeling bar and fixed a little bug at the beginning of the bar.
v1.5.1 - Quickly redid some logic to prevent spells that weren't set to have no casting bar
v1.5.2 - Changed how the bar is offset, made the bar follow the caster.
v1.6.0 - Removed as many BJs as possible whilst still keeping it GUI friendly

Triggers
  • Init Casting
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local integer i=0
      • Hashtable - Create a hashtable
      • Set BarHash = (Last created hashtable)
      • -------- The number of the llllllllllllllllllllllll on the casting bar. . . --------
      • Set NumberofTicks = 30
      • -------- Size of the Bar --------
      • Set CastingBarSize = 6.00
      • -------- The Z offset of the casting bar. --------
      • Set BarOffset = 50.00
      • -------- Color of the casting bar for each player. . . --------
      • Set PlayerColors[1] = |cffff0303
      • Set PlayerColors[2] = |cff0042ff
      • Set PlayerColors[3] = |cff1ce6b9
      • Set PlayerColors[4] = |cff540081
      • Set PlayerColors[5] = |cfffffc01
      • Set PlayerColors[6] = |cfffe8a0e
      • Set PlayerColors[7] = |cff20c000
      • Set PlayerColors[8] = |cffe55bb0
      • Set PlayerColors[9] = |cff959697
      • Set PlayerColors[10] = |cff7ebff1
      • Set PlayerColors[11] = |cff106246
      • Set PlayerColors[12] = |cff4e2a04
      • Set PlayerColors[13] = |c002F2F2F
      • Set PlayerColors[14] = |c002F2F2F
      • -------- Spell Configuration --------
      • -------- This is the ability for the spell you want to set the casting time of --------
      • Set TempAbil = Flame Strike
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 3.0)
      • -------- ^ --------
      • -------- That is the casting Time --------
      • Set TempAbil = Banish
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 2.0)
      • Set TempAbil = Phoenix
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 5.0)
      • Set TempAbil = Siphon Mana
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 1.5)
      • -------- ^ --------
      • -------- Some Abilities require less/more casting time per level so change this --------
      • -------- 1 being the level of the ability --------
      • -------- If every level of the spell have the same casting time then only set it once. --------
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 2, 1.0)
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 3, 0.5)
      • Set TempAbil = Starfall
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 10)
      • Custom script: call SaveBoolean(udg_BarHash,udg_TempAbil, udg_TempAbil,true)
      • -------- ^ --------
      • -------- If that is true, then the ability will be "channeled" and will go full bar to low bar instead of low bar to full bar. --------
      • -------- All you have to do is insert this boolean below ur casting times --------
      • Custom script: loop
      • Custom script: set i=i+1
      • Custom script: exitwhen i==udg_NumberofTicks
      • Custom script: set udg_LoadingBarText=udg_LoadingBarText+"l"
      • Custom script: endloop
      • Custom script: set udg_CastingBarSize=udg_CastingBarSize*.0023
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • BeginCast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • Custom script: local unit u=GetTriggerUnit()
      • Custom script: local integer i=GetSpellAbilityId()
      • Custom script: local integer c
      • Custom script: local string s
      • Custom script: local real r=LoadReal(udg_BarHash,i,GetUnitAbilityLevel(u,i))
      • Custom script: if r==0 then
      • Custom script: set r=LoadReal(udg_BarHash,i,1)
      • Custom script: endif
      • Custom script: if not IsUnitInGroup(u,udg_CastingGroup) and r>0 then
      • Custom script: set c=GetUnitUserData(u)
      • Custom script: set udg_BeginCastTime[c]=0
      • Custom script: set udg_EndCastTime[c]=r
      • Custom script: set udg_Channel[c]=LoadBoolean(udg_BarHash,i,i)
      • Custom script: if udg_Channel[c] then
      • Custom script: set s="["+udg_PlayerColors[GetPlayerId(GetOwningPlayer(u))+1]+udg_LoadingBarText+"|r]"
      • Custom script: else
      • Custom script: set s="["+udg_LoadingBarText+"]"
      • Custom script: endif
      • Custom script: set udg_CastingBar[c]=CreateTextTag()
      • Custom script: call SetTextTagVisibility(udg_CastingBar[c], IsUnitVisible(u,GetLocalPlayer()))
      • Custom script: call SetTextTagText(udg_CastingBar[c],s,udg_CastingBarSize)
      • Custom script: call SetTextTagPos(udg_CastingBar[c],GetUnitX(u),GetUnitY(u),udg_BarOffset)
      • Custom script: call GroupAddUnit(udg_CastingGroup,u)
      • Trigger - Turn on CastingPeiodic <gen>
      • Custom script: endif
      • Custom script: set u=null
  • EndCast
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
    • Actions
      • Custom script: local unit u=GetTriggerUnit()
      • Custom script: local integer c
      • Custom script: if IsUnitInGroup(u,udg_CastingGroup) then
      • Custom script: set c=GetUnitUserData(u)
      • Custom script: call GroupRemoveUnit(udg_CastingGroup,u)
      • Custom script: call DestroyTextTag(udg_CastingBar[c])
      • Custom script: if IsUnitGroupEmptyBJ(udg_CastingGroup) then
      • Trigger - Turn off CastingPeiodic <gen>
      • Custom script: endif
      • Custom script: endif
      • Custom script: set u=null
  • CastingPeiodic
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CastingGroup and do (Actions)
        • Loop - Actions
          • Custom script: local unit u=GetEnumUnit()
          • Custom script: local integer c=GetUnitUserData(u)
          • Custom script: local real r
          • Custom script: if udg_BeginCastTime[c]>=udg_EndCastTime[c] then
          • Custom script: call GroupRemoveUnit(udg_CastingGroup,u)
          • Custom script: call DestroyTextTag(udg_CastingBar[c])
          • Custom script: if IsUnitGroupEmptyBJ(udg_CastingGroup) then
          • Trigger - Turn off CastingPeiodic <gen>
          • Custom script: endif
          • Custom script: else
          • Custom script: set udg_BeginCastTime[c]=udg_BeginCastTime[c]+.1
          • Custom script: set r=udg_BeginCastTime[c]/udg_EndCastTime[c]
          • Custom script: if udg_Channel[c] then
          • Custom script: set r=1-r
          • Custom script: endif
          • Custom script: set r=r*udg_NumberofTicks
          • Custom script: if r>=1 then
          • Custom script: call SetTextTagText(udg_CastingBar[c],"["+udg_PlayerColors[GetPlayerId(GetOwningPlayer(u))+1]+SubString(udg_LoadingBarText,0,R2I(r))+"|r"+SubString(udg_LoadingBarText,R2I(r)-1,udg_NumberofTicks)+"]",udg_CastingBarSize)
          • Custom script: endif
          • Custom script: call SetTextTagVisibility(udg_CastingBar[c], IsUnitVisible(u,GetLocalPlayer()))
          • Custom script: call SetTextTagPos(udg_CastingBar[c],GetUnitX(u),GetUnitY(u),udg_BarOffset)
          • Custom script: endif
          • Custom script: set u=null

Keywords:
Casting, Casting Bar, Channel, String, Text Bar, Info Bar, channel
Contents

Casting-Channeling Bar v1.6.0 (Map)

Reviews
Approved since it works nicely. -Change the version number to 1.x.x, obviously it is not 0.0.x -Change the Temp real conditions as suggested in my reply to this thread -Rethink the way you show/hide the floating text for player, now you do too...

Moderator

M

Moderator

Maker, Casting Bar v0.0.3, 17th Oct 2011

Approved since it works nicely.

-Change the version number to 1.x.x, obviously it is not 0.0.x
-Change the Temp real conditions as suggested in my reply to this thread
-Rethink the way you show/hide the floating text for player, now you do too many actions
-Add "unit is in cast group" condition to stops casting trigger, since now it triggers for all abilities
 
Level 23
Joined
Jan 1, 2011
Messages
1,504
  • Int Casting Stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set BarHash = (Last created hashtable)
      • -------- The number of the little lllllllll on the casting bar. . . --------
      • Set NumberofTicks = 60
      • -------- Size of the Bar --------
      • Set CastingBarSize = 6.00
      • -------- The Z offset of the casting bar. --------
      • Set BarOffset = 50.00
      • -------- Color of the casting bar for each player. . . --------
      • Set PlayerColors[1] = |cffff0303
      • Set PlayerColors[2] = |cff0042ff
      • Set PlayerColors[3] = |cff1ce6b9
      • Set PlayerColors[4] = |cff540081
      • Set PlayerColors[5] = |cfffffc01
      • Set PlayerColors[6] = |cfffe8a0e
      • Set PlayerColors[7] = |cff20c000
      • Set PlayerColors[8] = |cffe55bb0
      • Set PlayerColors[9] = |cff959697
      • Set PlayerColors[10] = |cff7ebff1
      • Set PlayerColors[11] = |cff106246
      • Set PlayerColors[12] = |cff4e2a04
      • Set PlayerColors[13] = |c002F2F2F
      • Set PlayerColors[14] = |c002F2F2F
      • -------- Spell Configuration --------
      • -------- This is the ability for the spell you want to set the casting time of --------
      • Set TempAbil = Flame Strike
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 3.0)
      • -------- ^ --------
      • -------- That is the casting Time --------
      • Set TempAbil = Banish
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 2.0)
      • Set TempAbil = Phoenix
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 5.0)
      • Set TempAbil = Siphon Mana
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 1, 1.5)
      • -------- ^ --------
      • -------- Some Abilities require less/more casting time per level so change this --------
      • -------- 1 being the level of the ability --------
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 2, 1.0)
      • Custom script: call SaveReal(udg_BarHash,udg_TempAbil, 3, 0.5)
      • For each (Integer TempInteger) from 1 to NumberofTicks, do (Actions)
        • Loop - Actions
          • Set LoadingBarText = (LoadingBarText + l)
  • BeginCast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempInteger = (Custom value of TempUnit)
      • Set BeginCastTime[TempInteger] = 0.00
      • Custom script: set udg_TempReal = LoadReal(udg_BarHash, GetSpellAbilityId(), GetUnitAbilityLevelSwapped(GetSpellAbilityId(), udg_TempUnit))
      • Custom script: set udg_Temp_Real = LoadReal(udg_BarHash, GetSpellAbilityId(),1)
      • -------- Some Abilities wont have a changing casting time, this makes it so that you --------
      • -------- Dont have to copy and paste the casting time per each level --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • TempReal Greater than 0.00
              • Temp_Real Greater than 0.00
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempReal Equal to 0.00
            • Then - Actions
              • Set EndCastTime[TempInteger] = Temp_Real
            • Else - Actions
              • Set EndCastTime[TempInteger] = TempReal
          • Set TempString = ([ + (LoadingBarText + ]))
          • Floating Text - Create floating text that reads TempString above TempUnit with Z offset BarOffset, using font size CastingBarSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set CastingBar[TempInteger] = (Last created floating text)
          • Unit Group - Add TempUnit to CastingGroup
          • Trigger - Turn on CastingPeiodic <gen>
          • Floating Text - Hide CastingBar[TempInteger] for (All players)
          • Set TempPGroup = (All players matching (((Matching player) controller) Equal to User))
          • Player Group - Pick every player in TempPGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TempUnit is visible to (Picked player)) Equal to True
                • Then - Actions
                  • Set TempPGroup2 = (Player group((Picked player)))
                  • Floating Text - Show CastingBar[TempInteger] for TempPGroup2
                  • Custom script: call DestroyForce(udg_TempPGroup2)
                • Else - Actions
          • Custom script: call DestroyForce(udg_TempPGroup)
        • Else - Actions
  • EndCast
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempInteger = (Custom value of TempUnit)
      • Unit Group - Remove TempUnit from CastingGroup
      • Floating Text - Destroy CastingBar[TempInteger]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CastingGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off CastingPeiodic <gen>
        • Else - Actions
  • CastingPeiodic
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CastingGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set TempInteger = (Custom value of TempUnit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BeginCastTime[TempInteger] Greater than or equal to EndCastTime[TempInteger]
            • Then - Actions
              • Floating Text - Destroy CastingBar[TempInteger]
              • Unit Group - Remove TempUnit from CastingGroup
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in CastingGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Set BeginCastTime[TempInteger] = (BeginCastTime[TempInteger] + 0.05)
              • Set TempReal = ((BeginCastTime[TempInteger] / EndCastTime[TempInteger]) x (Real(NumberofTicks)))
              • Set TempString = ([ + (PlayerColors[(Player number of (Owner of TempUnit))] + ((Substring(LoadingBarText, 1, (Integer(TempReal)))) + (|r + ((Substring(LoadingBarText, (Integer(TempReal)), NumberofTicks)) + ])))))
              • Floating Text - Change text of CastingBar[TempInteger] to TempString using font size CastingBarSize
              • Floating Text - Hide CastingBar[TempInteger] for (All players)
              • Set TempPGroup = (All players matching (((Matching player) controller) Equal to User))
              • Player Group - Pick every player in TempPGroup and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TempUnit is visible to (Picked player)) Equal to True
                    • Then - Actions
                      • Set TempPGroup2 = (Player group((Picked player)))
                      • Floating Text - Show CastingBar[TempInteger] for TempPGroup2
                      • Custom script: call DestroyForce(udg_TempPGroup2)
                    • Else - Actions
              • Custom script: call DestroyForce(udg_TempPGroup)
 
Last edited:
Level 5
Joined
Jul 16, 2009
Messages
88
Suggestion for you:

- The use dynamic indexing is better (and cleaner).
- Unit group should be destroyed when number of units equals to 0. (It doesn't hurt to recreate it.)
- Note that you used "Begin CHANNELING". I would say, use "Begin CASTING". (I hope you know the difference.)


Comments:

- Fairly good idea.
- Troublesome casting time set-up for different spells.
- Just don't get confused with "casting time" and "channeling time".


Example:
- Click Storm Bolt icon, click on a target. (Issued order)
- Hero faces the target and getting ready to throw after 2 seconds of casting time. (Casting starts)
- 2 seconds passed, Storm Bolt thrown, cooldown starts. (Effect of ability starts)
- OR alternatively, Starfall starts. (Channeling starts)
 
Level 7
Joined
Sep 2, 2011
Messages
350
Wow. Great Idea :D I was like thinking of this system but unfortunately, I don't know how to code or make these kind of stuff. You made my dreams come true :3
 
Level 7
Joined
Sep 2, 2011
Messages
350
I think it bugs. When I cast a spell, specifically Phoenix. I tried to hold the hotkey, it casts however the floating text is not visible.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Player Group(picked player) leaks.
There is IsLocationVisibleToPlayer function, but I don't think it is in GUI. You could use that to decide whether to show the text or not.
Maybe create two strings at init, different colours for empty and full. Replace the loops that create the bars with using substring.
I'd use hashtable to load the EndCastTime.

Init values like this:
  • Custom script: call SaveInteger(udg_hash, 'AHfs', 0, 2)
AHfs is the raw code of Flame Strike, 2 is the duration. Use 0 as the child key for every ability.

Load values like this:
  • Untitled Trigger 009
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • Custom script: if HaveSavedInteger(udg_hash, GetSpellAbilityId(), 0) then
      • Set TempUnit = (Triggering unit)
      • Set TempInteger1 = (Custom value of TempUnit)
      • Custom script: Set udg_EndCastTime[udg_TempInteger1] = LoadInteger(udg_hash, GetSpellAbilityId(), 0)
      • -------- *rest of the actions* --------
      • Custom script: endif
This way you can get rid og the potentially very long if/then/else.

- The use dynamic indexing is better (and cleaner).
- Unit group should be destroyed when number of units equals to 0. (It doesn't hurt to recreate it.)
- Note that you used "Begin CHANNELING". I would say, use "Begin CASTING". (I hope you know the difference.)

-Bribe's unit indexer is perfect for this
-The group shouldn't be destroyed
-Begins Channeling is the correct event

This system shoudn't be used for abilities that have no real channeling time, like Storm Bolt.
 
Last edited:
Level 7
Joined
Sep 2, 2011
Messages
350
And for the effects. I think it's rather ugly seeing a large bar while playing. Imagine 12 players with their own units spamming spells with it. That is uhm. Hell'a ugly.
 
Level 23
Joined
Jan 1, 2011
Messages
1,504
Thanks for the comments guys, I'll work on this when I have the time. But I have some quick questions.

IsLocationVisibleToPlayer, could someone post a demo or something of this? I know what the Boolean is I just don't know how to do it.

And as for saving abilities into hashtables, I had no idea you could do that =D
Totally great to know, and I'll definitely get rid of all those if/then/else
 
Level 5
Joined
Oct 8, 2010
Messages
134
I really like this for the following reasons:
1. I always wanted to add something like this to my maps.
2. Useful in boss-fights, because the players can now see if a boss is starting to cast a spell and see how much time there is left to get the heck out of there.
3. there was a VJASS version, but I don't use VJASS.
4. It is also useful for players, and it looks good (if made smaller)
5. It is just AWESOME!!!

You will get +REP From me for sure,
and thanks for creating this.

This system shoudn't be used for abilities that have no real channeling time, like Storm Bolt.

So instant spells won't get a casting bar?
(which I understand since there instant)
But what if the ability does not have to be channelled to remain in play?
(when the caster is interupted the spell stops, like death and decay.
More like "fire bolt" were you aim, cast and fire!)

So is using "begins casting an ability" also right?
or am I wrong?

Just curious...
 
Level 10
Joined
Nov 24, 2010
Messages
546
WOW I really like it!:)
Also supports interrupting cast with stun!
Anyone can tell me if there are leaks wich cause lagg? If not I am importing it:)
And if i have 50 spells do I have to make them all in one trigger (like you have banish, fire strike etc), or i can make them in separated triggers?
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Looking really good so far.

I recommend letting there be a GUI variable in the configuration, which is set before each custom script hashtable save, that way you can select the variable ID from GUI if you don't want/don't know how to look up the rawcode every time.

  • Set TempAbil = Blizzard //TempAbil is of type "ability"
  • Custom script: call SaveReal(udg_BarHash, udg_TempAbil, 0, 3.0)
Also, I recommend taking advantage of the first key to represent each individual level in case there are different channeling times. Like this:

  • Set TempAbil = Blizzard
  • Custom script: call SaveReal(udg_BarHash, udg_TempAbil, 1, 3.0)
  • Custom script: call SaveReal(udg_BarHash, udg_TempAbil, 2, 4.0)
  • Custom script: call SaveReal(udg_BarHash, udg_TempAbil, 3, 5.0)
 
Level 5
Joined
Oct 8, 2010
Messages
134
epic and realistic!

I like your style!
since I use floods camera system, this is a great improvement

My rating 5/5
reasons:
-It is GUI
-Really useful
-I always wanted to have a system like this for my maps
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
GetUnitAbilityLevelSwapped(abilID, unit) -> GetUnitAbilityLevel(unit, abilID)

The if/then/else:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Temp_Real Greater than 0.00
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempReal Equal to 0.00
        • Then - Actions
          • Set EndCastTime[TempInteger] = Temp_Real
        • Else - Actions
          • Set EndCastTime[TempInteger] = TempReal

  • Floating Text - Hide CastingBar[TempInteger] for (All players)
  • Set TempPGroup = (All players matching (((Matching player) controller) Equal to User))
  • Player Group - Pick every player in TempPGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TempUnit is visible to (Picked player)) Equal to True
        • Then - Actions
          • Set TempPGroup2 = (Player group((Picked player)))
          • Floating Text - Show CastingBar[TempInteger] for TempPGroup2
          • Custom script: call DestroyForce(udg_TempPGroup2)
        • Else - Actions
  • Custom script: call DestroyForce(udg_TempPGroup)
  • Else - Actions

There you hide it for all players, even though you create a group containing all human players.
You might also end up hiding it for a player and the showing it right away. Same thing in the loop.

  • Group = human players
  • Pick players
    • If unit is not visible for player
    • Then hide text
    • Endif
In the loop, show if visible, hide if not visible.
 
Maker helped me notice this:

  • Floating Text - Hide CastingBar[TempInteger] for (All players)
  • Set TempPGroup = (All players matching (((Matching player) controller) Equal to User))
  • Player Group - Pick every player in TempPGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TempUnit is visible to (Picked player)) Equal to True
        • Then - Actions
          • Set TempPGroup2 = (Player group((Picked player)))
          • Floating Text - Show CastingBar[TempInteger] for TempPGroup2
          • Custom script: call DestroyForce(udg_TempPGroup2)
        • Else - Actions
  • Custom script: call DestroyForce(udg_TempPGroup)
>_> Fail

Do this:

  • Custom script: call SetTextTagVisibility(udg_CastingBar[udg_TempInteger], IsUnitVisible(udg_TempUnit, GetLocalPlayer()))
Now tell me, wasn't that code at first an uber fail compared to this? ;)

edit
Another thing:

  • Custom script: set udg_TempReal = LoadReal(udg_BarHash, GetSpellAbilityId(), GetUnitAbilityLevelSwapped(GetSpellAbilityId(), udg_TempUnit))
  • Custom script: set udg_Temp_Real = LoadReal(udg_BarHash, GetSpellAbilityId(),1)
->

  • // top of the trigger
  • Custom script: local integer id = GetSpellAbilityId()
  • // trigger code
  • Custom script: set udg_TempReal = LoadReal(udg_BarHash, id, GetUnitAbilityLevel(udg_TempUnit, id))
  • Custom script: set udg_Temp_Real = LoadReal(udg_BarHash, id,1)
 
Level 10
Joined
Nov 24, 2010
Messages
546
Hello guys, I got some baddy problem :(
I can easilly modify original map wich I download, like casting time, number of ticks and siúch things, but once I import triggers into my map i got this big bad error. Anyone got advice for me what should I do?

This system is too great to not be in my project :)

set udg_TempInteger2 = GetSpellAbilityId()

This line is bad

 
Top