• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Set floating texts

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
329
How can I fix my floating texts like this picture?!


  • King Floating Text
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- West King --------
      • Set VariableSet Point_FloatingTexts = (Center of King Attack <gen>)
      • Floating Text - Create floating text that reads (|cffff0000King Attack:|r + (String((Current research level of King Attack for (Player((Number of players in (All allies of Player 23 (Emerald).)))))))) at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • Set VariableSet Point_FloatingTexts = (Center of King Hit Point <gen>)
      • Floating Text - Create floating text that reads (|cff8080ffKing Hit Point:|r + (String((Current research level of King Hit Point for (Player((Number of players in (All allies of Player 23 (Emerald).)))))))) at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • Set VariableSet Point_FloatingTexts = (Center of King Regeneration <gen>)
      • Floating Text - Create floating text that reads (|cffffcc00King Regeneration:|r + (String((Current research level of King Regeneration for (Player((Number of players in (All allies of Player 23 (Emerald).)))))))) at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • -------- East King --------
  • King Upgrades
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Attack
          • (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
          • (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Selling unit)) is an ally of Player 23 (Emerald).) Equal to True
        • Then - Actions
          • Set VariableSet Player_King = Player 23 (Emerald)
          • Set VariableSet Unit_King = West King 0448 <gen>
        • Else - Actions
          • Set VariableSet Player_King = Player 24 (Peanut)
          • Set VariableSet Unit_King = East King 0447 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Attack
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Attack for Player_King) Less than (Max research level of King Attack for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Attack to ((Current research level of King Attack for (Picked player)) + 1) for (Picked player)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Upgrade] King Damage for Unit_King) Equal to 0
                • Then - Actions
                  • Unit - Add [Upgrade] King Damage to Unit_King
                • Else - Actions
                  • Unit - Set level of [Upgrade] King Damage for Unit_King to ((Level of [Upgrade] King Damage for Unit_King) + 1)
              • Set VariableSet Point_FloatingTexts = (Center of King Attack <gen>)
              • Floating Text - Create floating text that reads (|cffff0000King Attack:|r + (String((Current research level of King Attack for Player_King)))) at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's attack to level |cffffcc00) + ((String((Current research level of King Attack for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Attack Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Hit Point for Player_King) Less than (Max research level of King Hit Point for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Hit Point to ((Current research level of King Hit Point for (Picked player)) + 1) for (Picked player)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Upgrade] King Hit Points for Unit_King) Equal to 0
                • Then - Actions
                  • Unit - Add King Life (Pseudoupgrade) to Unit_King
                  • Unit - Set level of King Life (Pseudoupgrade) for Unit_King to ((Current research level of King Hit Point for (Owner of Unit_King)) + 1)
                  • Unit - Remove King Life (Pseudoupgrade) from Unit_King
                • Else - Actions
              • Set VariableSet Point_FloatingTexts = (Center of King Hit Point <gen>)
              • Floating Text - Create floating text that reads (|cff8080ffKing Hit Point:|r + (String((Current research level of King Hit Point for Player_King)))) at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's hit points to level |cffffcc00) + ((String((Current research level of King Hit Point for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Hit Points Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Regeneration for Player_King) Less than (Max research level of King Regeneration for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Regeneration to ((Current research level of King Regeneration for (Picked player)) + 1) for (Picked player)
              • Set VariableSet Point_FloatingTexts = (Center of King Regeneration <gen>)
              • Floating Text - Create floating text that reads (|cffffcc00King Regeneration:|r + (String((Current research level of King Regeneration for Player_King)))) at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's regeneration to level |cffffcc00) + ((String((Current research level of King Regeneration for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Regeneration Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • -------- --------
      • Trigger - Run Update Income <gen> (ignoring conditions)
      • Unit - Remove (Sold unit) from the game
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_King Equal to Player 23 (Emerald)
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of West King 0448 <gen> using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Special Effect - Create a special effect attached to the origin of East King 0447 <gen> using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
329
So I solved the previous problem, but I encountered another problem, the floating texts show for everyone! I want to be shown only for a specific group. Also, when I use the zoom command, the text size increases!
  • Floating Texts
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- West King --------
      • Player Group - Pick every player in (All allies of Player 23 (Emerald).) and do (Actions)
        • Loop - Actions
          • Set VariableSet Point_FloatingTexts = (Center of West King Upgrades <gen>)
          • Floating Text - Create floating text that reads ((|cffff0000King Attack Damage:|r + ((String((Current research level of King Attack for (Picked player)))) + |n)) + ((|cff8080ffKing Hit Point:|r + ((String((Current research level of King Hit Point for (Picked player)))) + |n)) + (|cffffcc00King Regenera at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set VariableSet FloatingTexts_KingUpgrades[1] = (Last created floating text)
          • Floating Text - Show FloatingTexts_KingUpgrades[1] for (All allies of Player 23 (Emerald).)
          • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • -------- East King --------
      • Player Group - Pick every player in (All allies of Player 24 (Peanut).) and do (Actions)
        • Loop - Actions
          • Set VariableSet Point_FloatingTexts = (Center of East King Upgrades <gen>)
          • Floating Text - Create floating text that reads ((|cffff0000King Attack Damage:|r + ((String((Current research level of King Attack for (Picked player)))) + |n)) + ((|cff8080ffKing Hit Point:|r + ((String((Current research level of King Hit Point for (Picked player)))) + |n)) + (|cffffcc00King Regenera at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set VariableSet FloatingTexts_KingUpgrades[2] = (Last created floating text)
          • Floating Text - Show FloatingTexts_KingUpgrades[2] for (All allies of Player 24 (Peanut).)
          • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set VariableSet UnitGroup_Temp = (Units of type Town Hall)
          • Unit Group - Pick every unit in UnitGroup_Temp and do (Actions)
            • Loop - Actions
              • Set VariableSet Point_FloatingTexts = (Position of (Picked unit))
              • Floating Text - Create floating text that reads ((|cffffcc00Gold:|r + ((String(((Owner of (Picked unit)) Current gold))) + |n)) + ((|cff008000Lumber:|r + ((String(((Owner of (Picked unit)) Current lumber))) + |n)) + (|cff8080ffFood:|r + ((String(((Owner of (Picked unit)) Food used))) + ( / + (String((( at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Set VariableSet FloatingTexts_Resources[1] = (Last created floating text)
              • Floating Text - Change the position of FloatingTexts_Resources[1] to (Point_FloatingTexts offset by -80.00 towards 20.00 degrees.) with Z offset 0.00
              • Floating Text - Show FloatingTexts_Resources[1] for (All allies of Player 23 (Emerald).)
              • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
          • Custom script: call DestroyGroup(udg_UnitGroup_Temp)
      • -------- --------
      • For each (Integer A) from 7 to 12, do (Actions)
        • Loop - Actions
          • Set VariableSet UnitGroup_Temp = (Units of type Town Hall)
          • Unit Group - Pick every unit in UnitGroup_Temp and do (Actions)
            • Loop - Actions
              • Set VariableSet Point_FloatingTexts = (Position of (Picked unit))
              • Floating Text - Create floating text that reads ((|cffffcc00Gold:|r + ((String(((Owner of (Picked unit)) Current gold))) + |n)) + ((|cff008000Lumber:|r + ((String(((Owner of (Picked unit)) Current lumber))) + |n)) + (|cff8080ffFood:|r + ((String(((Owner of (Picked unit)) Food used))) + ( / + (String((( at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Set VariableSet FloatingTexts_Resources[2] = (Last created floating text)
              • Floating Text - Change the position of FloatingTexts_Resources[2] to (Point_FloatingTexts offset by -80.00 towards 20.00 degrees.) with Z offset 0.00
              • Floating Text - Show FloatingTexts_Resources[2] for (All allies of Player 24 (Peanut).)
              • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
          • Custom script: call DestroyGroup(udg_UnitGroup_Temp)
 
Level 10
Joined
Jun 20, 2017
Messages
329
Why the floating text works opposite?
As you can see in the pictures, east king is an enemy, so the number of upgrades should not increase (I mean it just work for floating text, it does not add anything to the king).
West king

East king
  • Floating Texts
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- West King --------
      • Player Group - Pick every player in (All allies of Player 23 (Emerald).) and do (Actions)
        • Loop - Actions
          • Set VariableSet Point_FloatingTexts = (Center of West King Upgrades <gen>)
          • Floating Text - Create floating text that reads ((|cffff0000Damage:|r + ((String((Current research level of King Attack for (Picked player)))) + |n)) + ((|cff8080ffHit Point:|r + ((String((Current research level of King Hit Point for (Picked player)))) + |n)) + (|cffffcc00Regeneration:|r + (String((Cu at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set VariableSet FloatingTexts_KingUpgrades[1] = (Last created floating text)
          • Floating Text - Hide FloatingTexts_KingUpgrades[1] for (All allies of Player 24 (Peanut).)
          • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • -------- East King --------
      • Player Group - Pick every player in (All allies of Player 24 (Peanut).) and do (Actions)
        • Loop - Actions
          • Set VariableSet Point_FloatingTexts = (Center of East King Upgrades <gen>)
          • Floating Text - Create floating text that reads ((|cffff0000Damage:|r + ((String((Current research level of King Attack for (Picked player)))) + |n)) + ((|cff8080ffHit Point:|r + ((String((Current research level of King Hit Point for (Picked player)))) + |n)) + (|cffffcc00Regeneration:|r + (String((Cu at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set VariableSet FloatingTexts_KingUpgrades[2] = (Last created floating text)
          • Floating Text - Hide FloatingTexts_KingUpgrades[2] for (All allies of Player 23 (Emerald).)
          • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set VariableSet UnitGroup_Temp = (Units of type Town Hall)
          • Unit Group - Pick every unit in UnitGroup_Temp and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an ally of Player 23 (Emerald).) Equal to True
                • Then - Actions
                  • Set VariableSet Point_FloatingTexts = (Position of (Picked unit))
                  • Floating Text - Create floating text that reads ((|cffffcc00Gold:|r + ((String(((Owner of (Picked unit)) Current gold))) + |n)) + ((|cff008000Lumber:|r + ((String(((Owner of (Picked unit)) Current lumber))) + |n)) + (|cff8080ffFood:|r + ((String(((Owner of (Picked unit)) Food used))) + ( / + (String((( at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Set VariableSet FloatingTexts_Resources[1] = (Last created floating text)
                  • Floating Text - Change the position of FloatingTexts_Resources[1] to (Point_FloatingTexts offset by -80.00 towards 20.00 degrees.) with Z offset 0.00
                  • Floating Text - Hide FloatingTexts_Resources[1] for (All allies of Player 24 (Peanut).)
                  • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
                • Else - Actions
          • Custom script: call DestroyGroup(udg_UnitGroup_Temp)
      • -------- --------
      • For each (Integer A) from 7 to 12, do (Actions)
        • Loop - Actions
          • Set VariableSet UnitGroup_Temp = (Units of type Town Hall)
          • Unit Group - Pick every unit in UnitGroup_Temp and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an ally of Player 24 (Peanut).) Equal to True
                • Then - Actions
                  • Set VariableSet Point_FloatingTexts = (Position of (Picked unit))
                  • Floating Text - Create floating text that reads ((|cffffcc00Gold:|r + ((String(((Owner of (Picked unit)) Current gold))) + |n)) + ((|cff008000Lumber:|r + ((String(((Owner of (Picked unit)) Current lumber))) + |n)) + (|cff8080ffFood:|r + ((String(((Owner of (Picked unit)) Food used))) + ( / + (String((( at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Set VariableSet FloatingTexts_Resources[2] = (Last created floating text)
                  • Floating Text - Change the position of FloatingTexts_Resources[2] to (Point_FloatingTexts offset by -80.00 towards 20.00 degrees.) with Z offset 0.00
                  • Floating Text - Hide FloatingTexts_Resources[2] for (All allies of Player 23 (Emerald).)
                  • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
                • Else - Actions
          • Custom script: call DestroyGroup(udg_UnitGroup_Temp)
      • -------- --------
      • Trigger - Turn off (This trigger)
  • King Upgrades
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Attack
          • (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
          • (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Selling unit)) is an ally of Player 23 (Emerald).) Equal to True
        • Then - Actions
          • Set VariableSet Player_King = Player 23 (Emerald)
          • Set VariableSet Unit_King = West King 0448 <gen>
        • Else - Actions
          • Set VariableSet Player_King = Player 24 (Peanut)
          • Set VariableSet Unit_King = East King 0447 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Attack
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Attack for Player_King) Less than (Max research level of King Attack for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Attack to ((Current research level of King Attack for (Picked player)) + 1) for (Picked player)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Upgrade] King Damage for Unit_King) Equal to 0
                • Then - Actions
                  • Unit - Add [Upgrade] King Damage to Unit_King
                • Else - Actions
                  • Unit - Set level of [Upgrade] King Damage for Unit_King to ((Level of [Upgrade] King Damage for Unit_King) + 1)
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's attack to level |cffffcc00) + ((String((Current research level of King Attack for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Attack Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Hit Point for Player_King) Less than (Max research level of King Hit Point for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Hit Point to ((Current research level of King Hit Point for (Picked player)) + 1) for (Picked player)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Upgrade] King Hit Points for Unit_King) Equal to 0
                • Then - Actions
                  • Unit - Add King Life (Pseudoupgrade) to Unit_King
                  • Unit - Set level of King Life (Pseudoupgrade) for Unit_King to ((Current research level of King Hit Point for (Owner of Unit_King)) + 1)
                  • Unit - Remove King Life (Pseudoupgrade) from Unit_King
                • Else - Actions
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's hit points to level |cffffcc00) + ((String((Current research level of King Hit Point for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Hit Points Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Regeneration for Player_King) Less than (Max research level of King Regeneration for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Regeneration to ((Current research level of King Regeneration for (Picked player)) + 1) for (Picked player)
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's regeneration to level |cffffcc00) + ((String((Current research level of King Regeneration for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Regeneration Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • -------- --------
      • Floating Text - Change text of FloatingTexts_KingUpgrades[1] to ((|cffff0000Damage:|r + ((String((Current research level of King Attack for Player_King))) + |n)) + ((|cff8080ffHit Point:|r + ((String((Current research level of King Hit Point for Player_King))) + |n)) + (|cffffcc00Regeneration:|r + (String((Current re using font size 10.00
      • Floating Text - Change text of FloatingTexts_KingUpgrades[2] to ((|cffff0000Damage:|r + ((String((Current research level of King Attack for Player_King))) + |n)) + ((|cff8080ffHit Point:|r + ((String((Current research level of King Hit Point for Player_King))) + |n)) + (|cffffcc00Regeneration:|r + (String((Current re using font size 10.00
      • -------- --------
      • Trigger - Run Update Income <gen> (ignoring conditions)
      • Unit - Remove (Sold unit) from the game
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_King Equal to Player 23 (Emerald)
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of West King 0448 <gen> using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Special Effect - Create a special effect attached to the origin of East King 0447 <gen> using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
 
Level 10
Joined
Jun 20, 2017
Messages
329
I guess it works now, I did not test it on multiplayer.
  • Floating Texts
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • -------- West King --------
          • Set VariableSet Point_FloatingTexts = (Center of East King Upgrades <gen>)
          • Floating Text - Create floating text that reads ((|cffff0000Damage:|r + ((String((Current research level of King Attack Damage for (Player((Integer A)))))) + |n)) + ((|cff8080ffHit Point:|r + ((String((Current research level of King Hit Point for (Player((Integer A)))))) + |n)) + (|cffffcc00Regeneratio at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set VariableSet FloatingTexts_KingUpgrades[(Integer A)] = (Last created floating text)
          • Floating Text - Hide FloatingTexts_KingUpgrades[(Integer A)] for (All allies of Player 23 (Emerald).)
          • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
          • -------- --------
          • -------- East King --------
          • Set VariableSet Point_FloatingTexts = (Center of West King Upgrades <gen>)
          • Floating Text - Create floating text that reads ((|cffff0000Damage:|r + ((String((Current research level of King Attack Damage for (Player((Integer A)))))) + |n)) + ((|cff8080ffHit Point:|r + ((String((Current research level of King Hit Point for (Player((Integer A)))))) + |n)) + (|cffffcc00Regeneratio at Point_FloatingTexts with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set VariableSet FloatingTexts_KingUpgrades[(Integer A)] = (Last created floating text)
          • Floating Text - Hide FloatingTexts_KingUpgrades[(Integer A)] for (All allies of Player 24 (Peanut).)
          • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
      • -------- --------
      • Set VariableSet UnitGroup_Temp = (Units of type Town Hall)
      • Unit Group - Pick every unit in UnitGroup_Temp and do (Actions)
        • Loop - Actions
          • Set VariableSet Temp_Player = (Owner of (Picked unit))
          • Set VariableSet String_Temp = ((|cffffcc00Gold:|r + ((String((Temp_Player Current gold))) + |n)) + ((|cff008000Lumber:|r + ((String((Temp_Player Current lumber))) + |n)) + ((|cff8080ffFood:|r + (String((Temp_Player Food used)))) + ( / + (String((Temp_Player Food cap)))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Player controller) Equal to User
              • (Temp_Player slot status) Equal to Is playing
            • Then - Actions
              • Set VariableSet Point_FloatingTexts = (Position of (Picked unit))
              • Floating Text - Create floating text that reads String_Temp at (Point_FloatingTexts offset by -80.00 towards 20.00 degrees.) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Set VariableSet FloatingTexts_Resources[1] = (Last created floating text)
              • Floating Text - Hide FloatingTexts_Resources[1] for (All allies of Player 24 (Peanut).)
              • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
              • -------- --------
              • Set VariableSet Point_FloatingTexts = (Position of (Picked unit))
              • Floating Text - Create floating text that reads String_Temp at (Point_FloatingTexts offset by -80.00 towards 20.00 degrees.) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Set VariableSet FloatingTexts_Resources[2] = (Last created floating text)
              • Floating Text - Hide FloatingTexts_Resources[2] for (All allies of Player 23 (Emerald).)
              • Custom script: call RemoveLocation(udg_Point_FloatingTexts)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_UnitGroup_Temp)
      • -------- --------
      • Trigger - Turn off (This trigger)
  • Update Floating Texts
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet UnitGroup_Temp = (Units of type Town Hall)
      • Unit Group - Pick every unit in UnitGroup_Temp and do (Actions)
        • Loop - Actions
          • Set VariableSet Temp_Player = (Owner of (Picked unit))
          • Set VariableSet String_Temp = ((|cffffcc00Gold:|r + ((String((Temp_Player Current gold))) + |n)) + ((|cff008000Lumber:|r + ((String((Temp_Player Current lumber))) + |n)) + ((|cff8080ffFood:|r + (String((Temp_Player Food used)))) + ( / + (String((Temp_Player Food cap)))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Player controller) Equal to User
              • (Temp_Player slot status) Equal to Is playing
            • Then - Actions
              • Floating Text - Change text of FloatingTexts_Resources[1] to String_Temp using font size 10.00
              • Floating Text - Change text of FloatingTexts_Resources[2] to String_Temp using font size 10.00
            • Else - Actions
      • Custom script: call DestroyGroup(udg_UnitGroup_Temp)
  • King Upgrades
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Attack
          • (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
          • (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Selling unit)) is an ally of Player 23 (Emerald).) Equal to True
        • Then - Actions
          • Set VariableSet Player_King = Player 23 (Emerald)
          • Set VariableSet Unit_King = West King 0448 <gen>
        • Else - Actions
          • Set VariableSet Player_King = Player 24 (Peanut)
          • Set VariableSet Unit_King = East King 0447 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Attack
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Attack Damage for Player_King) Less than (Max research level of King Attack Damage for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Attack Damage to ((Current research level of King Attack Damage for (Picked player)) + 1) for (Picked player)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Upgrade] King Attack Damage for Unit_King) Equal to 0
                • Then - Actions
                  • Unit - Add [Upgrade] King Attack Damage to Unit_King
                • Else - Actions
                  • Unit - Set level of [Upgrade] King Attack Damage for Unit_King to ((Level of [Upgrade] King Attack Damage for Unit_King) + 1)
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's attack to level |cffffcc00) + ((String((Current research level of King Attack Damage for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Attack Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Hit Points
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Hit Point for Player_King) Less than (Max research level of King Hit Point for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Hit Point to ((Current research level of King Hit Point for (Picked player)) + 1) for (Picked player)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of King Hit Points [Upgrade] for Unit_King) Equal to 0
                • Then - Actions
                  • Unit - Add [Upgrade] King Hit Points to Unit_King
                  • Unit - Set level of [Upgrade] King Hit Points for Unit_King to ((Current research level of King Hit Point for (Owner of Unit_King)) + 1)
                  • Unit - Remove [Upgrade] King Hit Points from Unit_King
                • Else - Actions
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's hit points to level |cffffcc00) + ((String((Current research level of King Hit Point for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Hit Points Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Upgrade King Regeneration
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of King Regeneration for Player_King) Less than (Max research level of King Regeneration for Player_King)
            • Then - Actions
              • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of King Regeneration to ((Current research level of King Regeneration for (Picked player)) + 1) for (Picked player)
              • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Strings_PlayersColor[(Player number of (Owner of (Selling unit)))] + (Name of (Owner of (Selling unit)))) + |r upgraded your team King's regeneration to level |cffffcc00) + ((String((Current research level of King Regeneration for Player_King))) + |r))
              • Set VariableSet Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] = (Integers_KingUpgradesBought[(Player number of (Owner of (Selling unit)))] + 1)
              • -------- --------
              • -------- Income --------
              • Set VariableSet Integers_Income[(Player number of (Owner of (Selling unit)))] = (Integers_Income[(Player number of (Owner of (Selling unit)))] + 3)
            • Else - Actions
              • Player - Make Upgrade King Regeneration Unavailable for training/construction by (Owner of (Selling unit))
              • Player - Add 80 to (Owner of (Selling unit)).Current lumber
              • Player - Add -80 to (Owner of (Selling unit)).Total lumber gathered
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This upgrade is alr...
        • Else - Actions
      • -------- --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Floating Text - Change text of FloatingTexts_KingUpgrades[(Integer A)] to ((|cffff0000Damage:|r + ((String((Current research level of King Attack Damage for (Owner of (Selling unit))))) + |n)) + ((|cff8080ffHit Point:|r + ((String((Current research level of King Hit Point for (Owner of (Selling unit))))) + |n)) + (|cffffcc00Reg using font size 10.00
      • -------- --------
      • Trigger - Run Update Income <gen> (ignoring conditions)
      • Unit - Remove (Sold unit) from the game
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_King Equal to Player 23 (Emerald)
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of West King 0448 <gen> using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Special Effect - Create a special effect attached to the origin of East King 0447 <gen> using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
 
Status
Not open for further replies.
Top