• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to make an ATB Gauge system?

Status
Not open for further replies.
Level 11
Joined
Feb 11, 2010
Messages
199
Look at this here:
http://www.youtube.com/watch?v=Vjuf7DELz9s

See the little ATB gauge system at the bottom for each unit? How can I do this with my WC3 map in a multiboard? Any tutorials on this, or anything?

You just have a periodic event that adds a person's "speed" to their "ATB" number (say, 0 to 100, 100 meaning they're ready to act). Then, in your multiboard, you have, say, |||||||||||||||||||| (20 lines), and for each 5% that ATB is filled you change one of those lines to Green. ||||||||||||||||||||. When it's full (||||||||||||||||||||), you allow the unit to act.


Pretty simple, I think. Could easily make it for you.
 
Level 8
Joined
Jul 17, 2004
Messages
283
Hey, thank you for the quick reply!

Do you think you could whip me up an example real quick? I'd appreciate it so much. I don't think we even have a tutorial here at the Hive for ATB systems. I'll wait for your response.
 
Level 11
Joined
Feb 11, 2010
Messages
199
This will do what you want:

  • Map Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds (Or whenever you want to set up your ATB system, like when a battle starts)
    • Conditions
    • Actions
      • Set ATBActive[1] = True
      • Set ATBActive[2] = True
      • Set ATBActive[3] = True
      • Set Hero[1] = Paladin 0000 <gen>
      • Set Hero[2] = Archmage 0001 <gen>
      • Set Hero[3] = Blademaster 0002 <gen>
      • Unit - Pause Hero[1]
      • Unit - Pause Hero[2]
      • Unit - Pause Hero[3]
      • -------- Change the hero's "speed" to whatever you want. This determines how fast they fill their ATB gauge, --------
      • -------- and you can just set it to different values for effects like Slow or Haste. --------
      • Set ATBSpeed[1] = 0.90
      • Set ATBSpeed[2] = 1.25
      • Set ATBSpeed[3] = 1.85
      • Multiboard - Create a multiboard with 2 columns and 3 rows, titled ATB
      • Set ATBBoard = (Last created multiboard)
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Paladin
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Archmage
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to Blademaster
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to IIIIIIIIIIIIIIII...
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to IIIIIIIIIIIIIIII...
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to IIIIIIIIIIIIIIII...
      • Multiboard - Show (Last created multiboard)
      • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNHeroPaladin.blp
      • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNHeroArchMage.blp
      • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNHeroBlademaster.blp
      • For each (Integer MultiA) from 1 to 3, do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for (Last created multiboard) item in column 2, row MultiA to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 2 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 3 to 8.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 1 to 13.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 2 to 13.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 3 to 13.00% of the total screen width
      • Multiboard - Maximize (Last created multiboard)
      • Trigger - Turn on ATB System <gen>
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() ) (Don't include this line if you want to run the trigger more than once!)
  • ATB System
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ATBA) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ATBActive[ATBA] Equal to True
            • Then - Actions
              • Set ATB[ATBA] = (ATB[ATBA] + ATBSpeed[ATBA])
              • Set StringGreen[ATBA] = (Integer((ATB[ATBA] / 5.00)))
              • Set StringRed[ATBA] = (20 - (Integer((ATB[ATBA] / 5.00))))
              • Set ATBString[ATBA] = |cff32cd32
              • For each (Integer StringA[ATBA]) from 1 to StringGreen[ATBA], do (Actions)
                • Loop - Actions
                  • Set ATBString[ATBA] = (ATBString[ATBA] + l)
              • Set ATBString[ATBA] = (ATBString[ATBA] + |r|cffff0000)
              • For each (Integer StringA[ATBA]) from 1 to StringRed[ATBA], do (Actions)
                • Loop - Actions
                  • Set ATBString[ATBA] = (ATBString[ATBA] + l)
              • Set ATBString[ATBA] = (ATBString[ATBA] + |r)
              • Multiboard - Set the text for ATBBoard item in column 2, row ATBA to ATBString[ATBA]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ATB[ATBA] Greater than or equal to 100.00
                • Then - Actions
                  • Unit - Unpause Hero[ATBA]
                  • Set ATBActive[ATBA] = False
                  • Set ATB[ATBA] = 0.00
                • Else - Actions
            • Else - Actions
  • ATB System Cast
    • Events
      • Unit - A unit DOES SOMETHING (whatever actions you want to use up the ATB. Issued an order, starts the effect of an ability, whatever)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Hero[1]
          • ATBActive[1] Equal to False
        • Then - Actions
          • (Make your hero do whatever actions)
          • Unit - Pause Hero[1]
          • Set ATBActive[1] = True
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Hero[2]
              • ATBActive[2] Equal to False
            • Then - Actions
              • (Make your hero do whatever actions)
              • Unit - Pause Hero[2]
              • Set ATBActive[2] = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Triggering unit) Equal to Hero[3]
                  • ATBActive[3] Equal to False
                • Then - Actions
                  • (Make your hero do whatever actions)
                  • Unit - Pause Hero[3]
                  • Set ATBActive[3] = True
                • Else - Actions
Please give credit if you use my systems.
 
Last edited:
Level 8
Joined
Jul 17, 2004
Messages
283
Wow, that was a lot of work. Thank you so much. You should submit this to the Tutorials section. Looks flawless.
 
Level 11
Joined
Feb 11, 2010
Messages
199
Wow, that was a lot of work. Thank you so much.
No problem. I also recommend adding a little "ding" sound and a little flash on the hero at the "if equal to or greater than 100" event in the second trigger for the sake of polish. But that goes without saying ;)

You should submit this to the Tutorials section. Looks flawless.
Maybe. But then I'd have to add pretty screenshots and stuff. I can do that though.
 
Level 8
Joined
Jul 17, 2004
Messages
283
Hey man, I'm going to give you credit in my map for making me that ATB system.

Is there any way I can get the example map though?
 
Level 8
Joined
Jul 17, 2004
Messages
283
Thank you so much! I needed this to specify some of the variable types.

I see you are using three players and three heroes. My map uses four players and four heroes. I know everything of what I need to add in for four players and four heroes, but it gets a little confusing on what to add during the ATB System trigger. I'll see if I can figure it out though.
 
Level 11
Joined
Feb 11, 2010
Messages
199
Thank you so much! I needed this to specify some of the variable types.

I see you are using three players and three heroes. My map uses four players and four heroes. I know everything of what I need to add in for four players and four heroes, but it gets a little confusing on what to add during the ATB System trigger. I'll see if I can figure it out though.

In the loop, just change "from 1 to 3" to "from 1 to (number of heroes)." You are now done modifying the system trigger to accomodate any number of heroes (just set HeroCount to however many heroes are in your party). Easy, huh? :grin:

  • ATB System
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ATBA) from 1 to 3, do (Actions)
        • Loop - Actions
Should become...

  • ATB System
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ATBA) from 1 to HeroCount (integer), do (Actions)
        • Loop - Actions
You can also easily modify the system with just a line or two to do things like "stop the ATB timer from running when someone's turn comes up and select them" (like in that video you linked). The point is that the core system is there already and you can modify it as you like for your game.
 
Level 8
Joined
Jul 17, 2004
Messages
283
So then that would just be: For each (Integer ATBA) from 1 to 4, do (Actions)

Since I have four heroes?
 
Level 11
Joined
Feb 11, 2010
Messages
199
So then that would just be: For each (Integer ATBA) from 1 to 4, do (Actions)

Since I have four heroes?

Yes. But you'd want it to be an integer variable if, for example, your number of heroes ever changed (e.g., say you have just Joe RPG Guy at the beginning of the game, but get other characters later). If it's always going to be 4 though you can just put in 4.
 
Level 8
Joined
Jul 17, 2004
Messages
283
Okay, that makes sense. Thanks again. I'll let you know if I have any further questions, and I'll be sure to give you credit in my map. I'll let you know when my map is ready to be tested too.
 
Level 8
Joined
Jul 17, 2004
Messages
283
  • ATB System Startup
    • Events
    • Conditions
    • Actions
      • Set ATBActive[1] = True
      • Set ATBActive[2] = True
      • Set ATBActive[3] = True
      • Set ATBActive[4] = True
      • Set Hero[1] = Castle Crasher 0000 <gen>
      • Set Hero[2] = Castle Crasher 0001 <gen>
      • Set Hero[3] = Castle Crasher 0002 <gen>
      • Set Hero[4] = Castle Crasher 0003 <gen>
      • Set Enemy[1] = Wolf 0004 <gen>
      • Set Enemy[2] = Wolf 0005 <gen>
      • Set Enemy[3] = Wolf 0006 <gen>
      • Set ATBSpeed[1] = 2.45
      • Set ATBSpeed[2] = 2.20
      • Set ATBSpeed[3] = 1.40
      • Set ATBSpeed[4] = 0.90
      • Multiboard - Create a multiboard with 2 columns and 4 rows, titled ATB
      • Set ATBBoard = (Last created multiboard)
      • Multiboard - Set the text for ATBBoard item in column 1, row 1 to Paladin
      • Multiboard - Set the text for ATBBoard item in column 1, row 2 to Archmage
      • Multiboard - Set the text for ATBBoard item in column 1, row 3 to Blademaster
      • Multiboard - Set the text for ATBBoard item in column 1, row 4 to Mountain King
      • Multiboard - Set the text for ATBBoard item in column 2, row 1 to IIIIIIIIIIIIIIII...
      • Multiboard - Set the text for ATBBoard item in column 2, row 2 to IIIIIIIIIIIIIIII...
      • Multiboard - Set the text for ATBBoard item in column 2, row 3 to IIIIIIIIIIIIIIII...
      • Multiboard - Set the text for ATBBoard item in column 2, row 4 to IIIIIIIIIIIIIIII...
      • Multiboard - Set the icon for ATBBoard item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNHeroPaladin.blp
      • Multiboard - Set the icon for ATBBoard item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNHeroArchMage.blp
      • Multiboard - Set the icon for ATBBoard item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNHeroBlademaster.blp
      • Multiboard - Set the icon for ATBBoard item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
      • Multiboard - Set the width for ATBBoard item in column 1, row 1 to 8.00% of the total screen width
      • Multiboard - Set the width for ATBBoard item in column 1, row 2 to 8.00% of the total screen width
      • Multiboard - Set the width for ATBBoard item in column 1, row 3 to 8.00% of the total screen width
      • Multiboard - Set the width for ATBBoard item in column 1, row 4 to 8.00% of the total screen width
      • Multiboard - Set the width for ATBBoard item in column 2, row 1 to 13.00% of the total screen width
      • Multiboard - Set the width for ATBBoard item in column 2, row 2 to 13.00% of the total screen width
      • Multiboard - Set the width for ATBBoard item in column 2, row 3 to 13.00% of the total screen width
      • Multiboard - Set the width for ATBBoard item in column 2, row 4 to 13.00% of the total screen width
      • For each (Integer MultiA) from 1 to 4, do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for ATBBoard item in column 2, row MultiA to Show text and Hide icons
      • Multiboard - Show (Last created multiboard)
      • Multiboard - Maximize (Last created multiboard)
      • Trigger - Turn on ATB System <gen>
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • ATB System (Initially Off)
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ATBA) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ATBActive[ATBA] Equal to True
            • Then - Actions
              • Set ATB[ATBA] = (ATB[ATBA] + ATBSpeed[ATBA])
              • Set StringGreen[ATBA] = (Integer((ATB[ATBA] / 5.00)))
              • Set StringRed[ATBA] = (20 - (Integer((ATB[ATBA] / 5.00))))
              • Set ATBString[ATBA] = |cff32cd32
              • For each (Integer StringA[ATBA]) from 1 to StringGreen[ATBA], do (Actions)
                • Loop - Actions
                  • Set ATBString[ATBA] = (ATBString[ATBA] + l)
              • Set ATBString[ATBA] = (ATBString[ATBA] + |r|cffff0000)
              • For each (Integer StringA[ATBA]) from 1 to StringRed[ATBA], do (Actions)
                • Loop - Actions
                  • Set ATBString[ATBA] = (ATBString[ATBA] + l)
              • Set ATBString[ATBA] = (ATBString[ATBA] + |r)
              • Multiboard - Set the text for ATBBoard item in column 2, row ATBA to ATBString[ATBA]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ATB[ATBA] Greater than or equal to 100.00
                • Then - Actions
                  • Sound - Play ATB_Full <gen>
                  • Set Player = (Owner of Hero[ATBA])
                  • Set Attacker = Hero[ATBA]
                  • Set ATBActive[ATBA] = False
                  • Set ATB[ATBA] = 0.00
                  • Dialog - Clear Dialog[1]
                  • Dialog - Change the title of Dialog[1] to Command Menu
                  • Dialog - Create a dialog button for Dialog[1] labelled Attack
                  • Set DialogButton[1] = (Last created dialog Button)
                  • Dialog - Show Dialog[1] for Player
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
  • Attack
    • Events
      • Dialog - A dialog button is clicked for Dialog[1]
    • Conditions
      • (Clicked dialog button) Equal to DialogButton[1]
    • Actions
      • Dialog - Clear Dialog[1]
      • Dialog - Hide Dialog[1] for Player
      • Dialog - Clear Dialog[2]
      • Dialog - Change the title of Dialog[2] to Attack
      • Dialog - Create a dialog button for Dialog[2] labelled Wolf (1)
      • Set DialogButton[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog[2] labelled Wolf (2)
      • Set DialogButton[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog[2] labelled Wolf (3)
      • Set DialogButton[4] = (Last created dialog Button)
      • Dialog - Show Dialog[2] for Player
  • Engage Attack
    • Events
      • Dialog - A dialog button is clicked for Dialog[2]
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[2]
        • Then - Actions
          • Unit - Unpause Attacker
          • Unit - Order Attacker to Attack Enemy[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButton[3]
            • Then - Actions
              • Unit - Unpause Attacker
              • Unit - Order Attacker to Attack Enemy[2]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to DialogButton[4]
                • Then - Actions
                  • Unit - Unpause Attacker
                  • Unit - Order Attacker to Attack Enemy[3]
                • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top