• 🏆 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!

Serious help on cast bar

Status
Not open for further replies.
Level 7
Joined
Jun 14, 2009
Messages
235
I tried to make a cast bar in Gui, however it is still leaky, has many bugs, and I am confused on the approach to fix it.

It looks like this right now:

  • Set Cast Bar
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Casting[(Player number of (Triggering player))] Equal to True
        • Then - Actions
          • Floating Text - Destroy CastBar[(Player number of (Triggering player))]
        • Else - Actions
      • Set CastTime[NumofCastBars] = 3.00
      • Set NumOfTics[NumofCastBars] = 30
      • Set TicIntervil[NumofCastBars] = (CastTime[NumofCastBars] / (Real(NumOfTics[NumofCastBars])))
      • Set DisplayTics[NumofCastBars] = [
      • For each (Integer A) from 1 to NumOfTics[NumofCastBars], do (Actions)
        • Loop - Actions
          • Set DisplayTics[NumofCastBars] = (DisplayTics[NumofCastBars] + I)
      • Set DisplayTics[NumofCastBars] = (DisplayTics[NumofCastBars] + ])
      • Game - Display to (All players) the text: DisplayTics[NumofCastBars]
      • Set TempLoc = (Position of Hero[(Player number of (Triggering player))])
      • Floating Text - Create floating text that reads DisplayTics[NumofCastBars] at TempLoc with Z offset 0.00, using font size 7.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set CastBar[NumofCastBars] = (Last created floating text)
      • Set Casting[NumofCastBars] = True
Now I don't mind if you hate it, think its poorly made, or think I can code, however I need help to fix it and make it work.

Will give rep to anyone who helps or even tries.
 
Last edited:
Level 7
Joined
Jun 14, 2009
Messages
235
sorry, it seems to work once, but when I tried 2 at the same time it had a huge weird bug where it kept trying to create more and more until the game froze.

I was thinking of making it MPI instead of trying to let 100 be active at once by using player num when casting spell.

I will fix leaks later.... then again now is a good time too....

I fixed leak and am trying to give you guys the map (its just a guy and you press ESC to test it)
 

Attachments

  • Cast Bar System.w3x
    18.6 KB · Views: 74
Level 7
Joined
Jun 14, 2009
Messages
235
Oh yah I know, My computer has a problem with vJass, doesn't work for some reason (I have tried many times

but I would still like a Gui system for me...
 
Level 9
Joined
Nov 28, 2008
Messages
704
See, this is exactly why I quit GUI. This made my eyes hurt.

If you want my advice on how to do it though:

figure out number of bars you want, and how long to take. Then create a timer, running periodically with an interval of (time to take / bars). Then save into a hashtable everything you want about it, and load it whenever a timer expires, and update everything then.

Wait, can GUI handle timers going off as events? I forget.
 
Status
Not open for further replies.
Top