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

Floating Text Show Interger Help

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2019
Messages
198
-: (.) : Generator Show Number System : (.) :-

Hey, i wanna add to my map, each time a unit generates a Interger, or gold, lumber, it shows above the building how much it generated, every so often when it generates.


So a Lumber Mill for example, generates 100 Lumber every 4 seconds, want it to show +100 above the unit for a second or 2, every 4 seconds Depening on what type of Generator you got Tier I, II, III ect +100 per generator, for upto 12 players.


  • GenerateWood
    • Events
      • Time - Elapsed game time is 4.00 seconds
      • Time - GeneratorTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Start GeneratorTimer as a One-shot timer that will expire in 4.00 seconds
      • 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
              • (Number of units in (Units owned by (Player((Integer A))) of type Generator1)) Equal to 1
            • Then - Actions
              • Player - Set (Player((Integer A))).Current lumber to (((Player((Integer A))) Current lumber) + 100)
              • Floating Text - Create floating text that reads +100 Lumber above (Generator1) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Destroy (Last created floating text)// After 1 Second
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Player((Integer A))) of type Generator2)) Equal to 1
                • Then - Actions
                  • Player - Set (Player((Integer A))).Current lumber to (((Player((Integer A))) Current lumber) + 200)
                  • Floating Text - Create floating text that reads +200 Lumber above (Generator2) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Floating Text - Destroy (Last created floating text)// After 1 Second
                • Else - Actions
something like this, obviously, this is a mess, but was my way of explaining what am seeking.
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
  • Events
    • Time - Elapsed Game Time is 0.50 seconds
  • Conditions
  • Actions
    • Set GENERATOR_TYPE_COUNT = GENERATOR_TYPE_COUNT + 1
    • Set GENERATOR_TYPE[GENERATOR_TYPE_COUNT] = Generator 1
    • Set GENERATOR_AMOUNT[GENERATOR_TYPE_COUNT] = 100
    • -------- --------
    • Set GENERATOR_TYPE_COUNT = GENERATOR_TYPE_COUNT + 1
    • Set GENERATOR_TYPE[GENERATOR_TYPE_COUNT] = Generator 2
    • Set GENERATOR_AMOUNT[GENERATOR_TYPE_COUNT] = 200
    • -------- --------
    • Set GENERATOR_TYPE_COUNT = GENERATOR_TYPE_COUNT + 1
    • Set GENERATOR_TYPE[GENERATOR_TYPE_COUNT] = Generator 3
    • Set GENERATOR_AMOUNT[GENERATOR_TYPE_COUNT] = 300
  • GenerateWood
    • Events
      • Time - Elapsed game time is 4.00 seconds
      • Time - GeneratorTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Start GeneratorTimer as a One-shot timer that will expire in 4.00 seconds
      • For each (Integer A) from 1 to GENERATOR_TYPE_COUNT, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable Map Area) matching (((Unit-type of (Matching Unit)) equal to GENERATOR_UNIT[(Integer A)])) and (((Matching Unit) is alive) equal to true)) and do (Actions)
            • Loop - Actions
              • Player - Add GENERATOR_AMOUNT[(Integer A)] to (Owner of (Picked Unit)) current lumber
              • Floating Text - Create floating text that reads ("+" + (GENERATOR_AMOUNT[(Integer A)] + " Lumber")) above (Picked Unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Set (Last created floating text) to Disable permanence //have to do this before setting lifespan
              • Floating Text - Set Lifespan of (Last created floating text) to 1.00
 
Level 7
Joined
Nov 6, 2019
Messages
198
  • Events
    • Time - Elapsed Game Time is 0.50 seconds
  • Conditions
  • Actions
    • Set GENERATOR_TYPE_COUNT = GENERATOR_TYPE_COUNT + 1
    • Set GENERATOR_TYPE[GENERATOR_TYPE_COUNT] = Generator 1
    • Set GENERATOR_AMOUNT[GENERATOR_TYPE_COUNT] = 100
    • -------- --------
    • Set GENERATOR_TYPE_COUNT = GENERATOR_TYPE_COUNT + 1
    • Set GENERATOR_TYPE[GENERATOR_TYPE_COUNT] = Generator 2
    • Set GENERATOR_AMOUNT[GENERATOR_TYPE_COUNT] = 200
    • -------- --------
    • Set GENERATOR_TYPE_COUNT = GENERATOR_TYPE_COUNT + 1
    • Set GENERATOR_TYPE[GENERATOR_TYPE_COUNT] = Generator 3
    • Set GENERATOR_AMOUNT[GENERATOR_TYPE_COUNT] = 300
  • GenerateWood
    • Events
      • Time - Elapsed game time is 4.00 seconds
      • Time - GeneratorTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Start GeneratorTimer as a One-shot timer that will expire in 4.00 seconds
      • For each (Integer A) from 1 to GENERATOR_TYPE_COUNT, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable Map Area) matching (((Unit-type of (Matching Unit)) equal to GENERATOR_UNIT[(Integer A)])) and (((Matching Unit) is alive) equal to true)) and do (Actions)
            • Loop - Actions
              • Player - Add GENERATOR_AMOUNT[(Integer A)] to (Owner of (Picked Unit)) current lumber
              • Floating Text - Create floating text that reads ("+" + (GENERATOR_AMOUNT[(Integer A)] + " Lumber")) above (Picked Unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Set (Last created floating text) to Disable permanence //have to do this before setting lifespan
              • Floating Text - Set Lifespan of (Last created floating text) to 1.00


i was going along well till it got to

  • Unit Group - Pick every unit in (Units in (Playable Map Area) matching (((Unit-type of (Matching Unit)) equal to GENERATOR_UNIT[(Integer A)])) and (((Matching Unit) is alive) equal to true)) and do (Actions)
you mean GENERATOR_UNIT_TYPE not GENERATOR_UNIT?

So Basically This?

  • SetUpGS
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • -------- x1 --------
      • -------- Generator 1 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 1
      • Set VariableSet x1GAmount[x1GCount] = 1
      • -------- Generator 2 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 2
      • Set VariableSet x1GAmount[x1GCount] = 2
      • -------- Generator 3 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 3
      • Set VariableSet x1GAmount[x1GCount] = 4
      • -------- Generator 4 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 4
      • Set VariableSet x1GAmount[x1GCount] = 8
      • -------- Generator 5 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 5
      • Set VariableSet x1GAmount[x1GCount] = 16
      • -------- Generator 6 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 6
      • Set VariableSet x1GAmount[x1GCount] = 32
      • -------- Generator 7 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 7
      • Set VariableSet x1GAmount[x1GCount] = 64
      • -------- Generator 8 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 8
      • Set VariableSet x1GAmount[x1GCount] = 128
      • -------- Generator 9 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 9
      • Set VariableSet x1GAmount[x1GCount] = 256
      • -------- Generator 10 --------
      • Set VariableSet x1GCount = (x1GCount + 1)
      • Set VariableSet x1GType[x1GCount] = Generator 10
      • Set VariableSet x1GAmount[x1GCount] = 512
      • -------- x2 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x3 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x4 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x5 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x6 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x7 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x8 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x9 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
      • -------- x10 --------
      • -------- Generator 1 --------
      • -------- Generator 2 --------
      • -------- Generator 3 --------
      • -------- Generator 4 --------
      • -------- Generator 5 --------
      • -------- Generator 6 --------
      • -------- Generator 7 --------
      • -------- Generator 8 --------
      • -------- Generator 9 --------
      • -------- Generator 10 --------
  • x1House
    • Events
      • Time - Elapsed game time is 1.00 seconds
      • Time - x1Timer expires
    • Conditions
    • Actions
      • Countdown Timer - Start x1Timer as a One-shot timer that will expire in 1.00 seconds
      • For each (Integer A) from 1 to x1GCount, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to x1GType[(Integer A)]) and (((Matching unit) is alive) Equal to True))) and do (Actions)
            • Loop - Actions
              • Player - Add x1GAmount[(Integer A)] to (Owner of (Picked unit)).Current gold
              • Floating Text - Create floating text that reads (|cff808000+ + ((String(x1GAmount[(Integer A)])) + Gold|r)) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 0.75 seconds
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Yeah, he meant Type not Unit, you did it correctly. But the Elapsed game time Event is unnecessary in your x1House trigger. Also, delete the "Start x1Timer" from your x1House trigger. Instead, start a Repeating Timer in your SetUpGS trigger.
  • SetUpGS
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • -------- Put your Setup Generator Variables here --------
      • Countdown Timer - Start x1Timer as a Repeating timer that will expire in 4.00 seconds
  • x1House
    • Events
      • Time - x1Timer expires
    • Conditions
    • Actions
      • -------- Put your actions here. For Each Integer, Pick every unit, Add Gold, Create floating text, etc... --------
 
Level 7
Joined
Nov 6, 2019
Messages
198
Yeah, he meant Type not Unit, you did it correctly. But the Elapsed game time Event is unnecessary in your x1House trigger. Also, delete the "Start x1Timer" from your x1House trigger. Instead, start a Repeating Timer in your SetUpGS trigger.
  • SetUpGS
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • -------- Put your Setup Generator Variables here --------
      • Countdown Timer - Start x1Timer as a Repeating timer that will expire in 4.00 seconds
  • x1House
    • Events
      • Time - x1Timer expires
    • Conditions
    • Actions
      • -------- Put your actions here. For Each Integer, Pick every unit, Add Gold, Create floating text, etc... --------


yeah i changed that so timer is chosen depending on what mode you chose. but ty for info and confirming i didnt mess up for once :p
 
Status
Not open for further replies.
Top