System Zwiebelchen's Casting Bar System

Flare

Stops copies me!
Reaction score
662
im not sure how to get this to work, do you have to base the ability off of channel or something because it shows the casting bar, but the rest of the trigger fires right away.
No, you just call the function when the ability is cast - if we take, for example, an ability with a 3-second cast time, and let's say it's based on Stormbolt
Code:
Events:
  Any unit starts the effect of an ability
Conditions:
  Ability being cast Equal To (Ability X)
Actions:
  Custom script: call Castingbar (3., "thunderbolt", GetTriggerUnit (), 1, false)
That should display the casting time bar to all allies of the caster player.
 

MasterOfRa

New Member
Reaction score
10
no, my problem is that the spell does stuff before the bar finishes, i thought the idea was that the bar had to finish before the spell's effect occured
 

CaptDeath

New Member
Reaction score
103
youd
A need to know jass
B mod the function displaying to return a value
C call it i suppose and use the return to give the go ahead on the spell for every spell
 

Kenny

Back for now.
Reaction score
202
Not sure if its already been explained, but why do you pause the timer each interval, then start the timer again? Why not just let it go?

Also GetPlayersAllies() leaks a force, use ForceEnumAllies(TextTagForce,LocalPlayer,null).

Also:

JASS:
if IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS) then
        call SetTextTagVisibility(FloatingText, false)
    endif
    if ShowCastingBar == 2 then
        if IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS) then
            call SetTextTagVisibility(FloatingText, true)
        endif
    else
        if IsPlayerInForce(GetLocalPlayer(), TextTagForce) then
            call SetTextTagVisibility(FloatingText, true)
        endif
    endif


Couldnt you just use your LocalPlayer variable instead of GetLocalPlayer() there, or am i missing something?
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
Then how would i make it work like that?
Just add a casting time to your spell in the object editor and call the Castingbar() function when the event "unit is casting a spell" fires.

If you want the spell to not have a casting time (or you want the castingbar to display the duration of an effect or something) just change the orderstring in the call function to an underline; like this: call Castingbar(2.50, GetTriggerUnit(), 2, false)

You should try it out anyways. Most of the modern computers have so much processing power, that this still is a piece of cake.

Couldnt you just use your LocalPlayer variable instead of GetLocalPlayer() there, or am i missing something?
Dunno really ... actually, I just cnp'ed the code from the BJ setvisibilitystatus function to avoid a useless function call. I don't get really how the GetLocalPlayer() thingy works ... since it behaves special on some times


I checked up your reported leak and you were right: it did create a leak. Fixed.
Not sure if its already been explained, but why do you pause the timer each interval, then start the timer again? Why not just let it go?
Because I'm not sure wether you can remove or null a timer that is not paused.
 

BlackRose

Forum User
Reaction score
239
MY comp is not modern, it's from 2007, the one I'm using now is from 2003 (or 2004), Windows XP, 192 RAM..... 64 MB Graphics Thingy....

The newer one only has 1 GB RAM but it's broken....

I should get my parents to get a new one XD

But I don't understand, what sorta maps would you put this in?

Didn't Blizzard make on already in their Skibi TD map?
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
Edit: Fixed a bug preventing the trigger from ending properly when using the the showtoall setting of the casting bar.
 

Leazy

You can change this now in User CP.
Reaction score
50
I copied ABC and the trigger named ''CastingBar'' to my map, and added this line to a spell:
Code:
Custom Script: call Castingbar(2.50, "barkskin", GetTriggerUnit(), 2.5, false)

When saving the map/testing it, I get syntax error. How can I solve this? Also, I got a spell based on ''Finger of Death'' and I noticed that it doesn't have a order string, can I add a order string to it and still have the system to work with it?

+rep for a good system.
 

Leazy

You can change this now in User CP.
Reaction score
50
use newgen.

I do. However, I noticed that I did the mistake to think that
Code:
Custom Script: call Castingbar(2.50, "barkskin", GetTriggerUnit(), [COLOR="SandyBrown"]2.5[/COLOR], false)
Were the place for casting time, no error now.

Edit: Noticed that the bar don't show up though, I call it like this:
Trigger:
  • Untitled Trigger 003
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Chain Lightning
    • Actions
      • Custom script: call Castingbar(2.50, "barkskin", GetTriggerUnit(), 0, false)
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
It's because the order string is wrong. Chain lightning is not barkskin ... :nuts:

And besides: Your spell must maintain the order string during the casting time. Dunno if there are exceptions, but if you do not set up a proper casting time, it doesn't work. Check out the sample map; there are two examples on how you can set it up properly.
 

Leazy

You can change this now in User CP.
Reaction score
50
The chain lightning skill is based on channel, which has been given the order ''barkskin''.
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
Maybe the event is the problem? Set up a Text Message for debug purposes to find out, wether the trigger fires correctly.

PS: The system doesn't work anymore with the latest patch. Maybe I will fix that next week.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top