• 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.

[Trigger] ATB Gauge

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
I'm currently working on a Final Fantasy map, which ofcourse needs an ATB Gauge (A meter that fill in time, and when it's full, the character can perform an action). However I was wondering if anybody had any idea's to make that in the leaderboard. I've got a trigger that causes the ATB Gauge to fill, but that's just the info. I want to make it visible in the leaderboard now. That means, I got a line in the leaderboard: '||||||||||||||||||||', of which I want more and more to change color and when an action has been performed, the Gauge should all be the old color again. Anybody who played any Final Fantasy game knows what I mean. This battle system is also seen in other Single Player RPGs like Hero RPG, but the creator of that game hasn't been active for over 2 years...

Any idea's on how to do this is welcome. For the ATB Gauge info, I just use a Integer variable that increases periodically until it reaches the maximum, which causes the player to do an action.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You could make global strings with your colors and change between them.

You could also try to make a string containing a not colored "|" and a colored "|", then you use the module function to check what is the integer value of your variable/10.
This number should represent how much colored "|"'s there should be, so you'll write colored "|"'s * that number.
I'm not sure if you can really do string concatenation this way, so you may need to use substrings.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I never used any JASS, so I think that solution isn't going to become mine quickly, Dr Super Good. But thanks for your effort in trying to help me :smile:

As for GhostWolf's idea, I know I have to use the |||'s, but how do I change the colours by percentage of the ATB meter?
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
==Off-topic==

I know that JASS allows you to make a lot more advanced triggers, but I've came very far with just GUI. JASS is too annoying for me and I know it'll ruin the fun I have with making Wc3 maps. So I rather keep JASS out of the picture (except against leaks :wink:)
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
Crap, I deleted that post so that people will not see it :p
Anyway, I believe there is a way to do the bar, but a really good one will take quite some time.
I think there is a way to make this bar in GUI but I don't have permission to release the code, I will ask the creator and give you the triggers, though it might not be in GUI.
EDIT: I looked through the code and its practically JASS (tons of custom scripts). Do you still want it?
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
JASS aint going to help me.

So far I've got a lot of If/Then/Else triggers.
  • Actions
    • If/Then/Else
      • If - Conditions
        • ATBGauge[1] is less then 5
      • Then - Actions
        • Set text of multiboard[1] in column 1 and row 1 to llllllllllllllllllll
      • Else - Actions
        • If/Then/Else
          • If - Conditions
            • AND (All conditions are true)
              • If - Conditions
                • ATBGauge[1] is less then 10
                • ATBGauge[1] is greater then or equal to 5
              • Then - Actions
                • Set text of multiboard[1] in column 1 and row 1 to <whatever color>l<end of color>lllllllllllllllllll
              • Else - Actions
                • etc.
If anybody got an easier way, I'd like to know. Would save a lot of time/effort.
 
Level 6
Joined
Aug 19, 2007
Messages
109
This may take ages but it could work: Have each 'I' in a seperate multiboard box and use the "Integer A" function to place them. Then make a trigger where something like: A unit is attacked, attacked unit equal to (Hero name) :
  • test
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacked unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kill_Count[(Player number of (Owner of (Attacked unit)))] Not equal to 10
        • Then - Actions
          • Set Kill_Count[(Player number of (Owner of (Attacked unit)))] = (Kill_Count[(Player number of (Owner of (Attacked unit)))] + 1)
          • Multiboard - Set the color for Multiboard item in column Kill_Count[(Player number of (Owner of (Attacked unit)))], row (Player number of (Owner of (Attacked unit))) to (100.00%, 80.00%, 20.00%) with 0.00% transparency
          • -------- Note that the colour can be changed to w/e you want --------
        • Else - Actions
          • Do nothing
And then another trigg like:
  • test2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Avatar
    • Actions
      • Set Kill_Count[(Player number of (Owner of (Casting unit)))] = 0
      • Remove ability avatar from (casting unit)
Make sure "avater" is like the limit break and add another trigg where when unit "Kill_Count[number]" equals to 10 give player's hero the ability "avatar".:grin:
 
Level 16
Joined
Mar 26, 2004
Messages
569
I copied this from my own ff-battle system i posted on wc3c. Hope it helps.

  • ATB
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[1] is alive) Equal to (==) True
        • Then - Actions
          • Set ATB[1] = (ATB[1] + 1)
          • Set ATB_String[1] = (ATB_String[1] + I)
          • Multiboard - Set the text for BattleBoard item in column 5, row 2 to (TextColor2 + ATB_String[1])
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[2] is alive) Equal to (==) True
        • Then - Actions
          • Set ATB[2] = (ATB[2] + 1)
          • Set ATB_String[2] = (ATB_String[2] + I)
          • Multiboard - Set the text for BattleBoard item in column 5, row 3 to (TextColor2 + ATB_String[2])
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[3] is alive) Equal to (==) True
        • Then - Actions
          • Set ATB[3] = (ATB[3] + 1)
          • Set ATB_String[3] = (ATB_String[3] + I)
          • Multiboard - Set the text for BattleBoard item in column 5, row 4 to (TextColor2 + ATB_String[3])
        • Else - Actions
          • Do nothing
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Can you explain to me what 'Textcolor2 + ATB_String[x]' is? If I'm not mistaken this doesn't change colors, but only adds I's. If that's correct, I can use the same by making it a 'Textcolor2 + ATB_String[x] + ATBLeft_String[x]', where 'ATBLeft_String' is reduces by 1 each time ATB_String[x] is increased by 1.

Then if I need to make the text to change 1 I's color at every 5 points, I still need to make all those If/Then/Else trigger as I posted in my previous post.
 
Level 6
Joined
Sep 5, 2007
Messages
264
My idea on what you need to do:

Setup your multiboard so that it has a set number of columns, eg: 10 or 20
Determine your value against these columns... (current value / max value) * number of columns. This number is how many columns need to be your "active" color (eg: green, with red being inactive) lets call this number "ActiveColumns" for reference.
  • For Integer A = 1 to <number of columns>
    • if Integer A less than or equal to "ActiveColumns" then
      • set Multiboard Text in column <Integer A> to "|cff00ff00||r"
    • else
      • set Multiboard Text in column <Integer A> to "|cffff0000||r"
The above example is very basic (I'm not good at doing GUI in forums)

The strings used: "|cff00ff00" and "|cffff0000" are color codes... Let me break it down:
The color codes are in Hexidecimal. To convert hex("ff") into normal numbers (255) then open up windows calculator, set it to scientific calculations, click the "Hex" combo-button, type your value, click the "Dec" combo-button. The same works in reverse for decimal to hex.

The "|c" just let Wc3 know that the following string is a color code, the color code is ALWAYS 8 characters long.

The next 2 characters are the alpha value of the color code (the transparency)
The next 2 characters are the red value.
The next 2 characters are the green value.
The next 2 characters are the blue value.

The text to be colored is straight after the blue value. After your colored text you need to put "|r" to let Wc3 know that you've finished with your colored text and that it can go back to normal.

They are easy once you get the grasp of them. If you need any more examples, just look at tooltips in the object editor, nearly all of them use colored text (it's how they do Train Footman for example).

I hope this has helped you to figure things out.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I understand the colouring stuff, but about your suggestion in general: Do you suggest I make a column for each bar in the ATB meter? Wouldn't that cause the bars to have way too much space between to look like 1 whole ATB meter?
 
Level 9
Joined
May 27, 2006
Messages
498
Substrings can take a single letter or entire word or phrase from a string. They work like:
  • Actions:
    • Set Text1 = I want this spell to work
    • Set Text2 = (Substring(Text1, 3, 6))
In this case Text2 would be equal to "want". Note, that the Text1 string is "I want this spell to work", and the first letter of the word "want" is the third in whole string. Thats why there is the 3 in the substring action. It sets the first letter from which you start "selecting" text. The second number does the same, it just marks the end of the text you want to get.

But be careful with those, if you do it wrong, they can crash wc3.

Edit:
Nah, now as im working with it i think that there is other solution: create an array string variable, set it like
  • Set GaugeFill[1] = |
  • Set GaugeFill[2] = ||
  • Set GaugeFill[3] = |||
  • etc
and the second trigger would launch when ability is cast:
  • Actions:
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Set Gauge = (|cffffcc00 + (GaugeFill[(Integer A)] + (|r + GaugeFill[(10 - (Integer A))])))
        • Multiboard - Set the text for ATBGaugeBoard item in column 2, row 1 to Gauge
        • Wait 1.00 seconds
And i would advise using 'I' (capital 'i') instead of '|'s, this would cause a minor display bug :p (Someone said that before, though)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
So if I would have an ATB Gauge with string variable 'Set blabla = llllllllll', then I need to make a substring '(substring(blabla,1,4))' to take the first 4 l's in blabla, and I make a command that colours those. I guess that'll do.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I'm currently working on a Final Fantasy map, which ofcourse needs an ATB Gauge (A meter that fill in time, and when it's full, the character can perform an action). However I was wondering if anybody had any idea's to make that in the leaderboard. I've got a trigger that causes the ATB Gauge to fill, but that's just the info. I want to make it visible in the leaderboard now. That means, I got a line in the leaderboard: '||||||||||||||||||||', of which I want more and more to change color and when an action has been performed, the Gauge should all be the old color again. Anybody who played any Final Fantasy game knows what I mean. This battle system is also seen in other Single Player RPGs like Hero RPG, but the creator of that game hasn't been active for over 2 years...

Any idea's on how to do this is welcome. For the ATB Gauge info, I just use a Integer variable that increases periodically until it reaches the maximum, which causes the player to do an action.

As you see, I noticed that already. The creator is inactive and the map is protected. Anyway, the problem has already been solved.
 
Status
Not open for further replies.
Top