Snippet Casting Time

rodead

Active Member
Reaction score
42
I made a Snippet for Casting Time:

It creates the Time a Spell is casting At the heroes location.
it is leakless and MPI.

enjoy!

Code:
Code:
Let Unit Cast
    Events
        Unit - A unit Begins casting an ability
        Unit - A unit Begins channeling an ability
    Conditions
    Actions
        Set Casting[(Player number of (Owner of (Casting unit)))] = 0.00
        Set Casting_Unit_Loc[(Player number of (Owner of (Casting unit)))] = (Position of (Casting unit))
        Set Casting_Time[(Player number of (Owner of (Casting unit)))] = True

Code:
Casting Time
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Casting_Time[(Integer A)] Equal to True
                    Then - Actions
                        Set Casting[(Integer A)] = (Casting[(Integer A)] + 0.01)
                        Floating Text - Destroy Casting_Floating_Text[(Integer A)]
                        Floating Text - Create floating text that reads (Casting Time:  + (String(Casting[(Integer A)]))) at Casting_Unit_Loc[(Integer A)] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                        Set Casting_Floating_Text[(Integer A)] = (Last created floating text)
                    Else - Actions

Code:
Stop Unit Cast
    Events
        Unit - A unit Stops casting an ability
        Unit - A unit Finishes casting an ability
    Conditions
    Actions
        Set Casting_Time[(Player number of (Owner of (Casting unit)))] = False
        Floating Text - Destroy Casting_Floating_Text[(Player number of (Owner of (Casting unit)))]
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Casting unit)) Equal to (Player((Integer A)))
                    Then - Actions
                        Custom script:   call RemoveLocation (udg_Casting_Unit_Loc[GetForLoopIndexA()])
                    Else - Actions
 

Attachments

  • Casting time system.w3x
    17.2 KB · Views: 220
  • Screenshot casting time!.JPG
    Screenshot casting time!.JPG
    75.5 KB · Views: 280

PoZoR

New Member
Reaction score
5
well, it IS interesting, but in most maps that people make today, it would look pretty ugly i think?
 

Cohadar

master of fugue
Reaction score
209
Meh, it could perhaps be used for debugging a spell.
Post some pictures...
 

Darius34

New Member
Reaction score
30
Granted, it is useful, maybe for debugging. Still, in most cases, you don't ever have variable casting times (unless you have some spells which have variable casting delays as a feature - this would be really useful there), and you can control the value directly in the Object Editor.

I think this would only be useful in-game in some unique map with dynamic/random casting times. But yeah, good snippet. Serves its purpose, though can't be used very widely.
 
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