• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

MultiBoard Help

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2019
Messages
186
Hey, how do i set up a MultiBoard, with icons, with 5 options, and each board show up only for sepcific player

so what Icon : Type: Number

and want it to change the number each time the Type Interger changes

So example gold

GoldIcon: Gold: 1

and when GoldInterger Changed to +1 it will show

GoldIcon: Gold: 2

but per person, as there have there own Intergers?

Basically, i wanna set up a Mineral system, where if u have a mining Drill for example, it has chance to increase your mineral Interger

Coal: 50%
Iron: 40%
Gold: 30%
Sapphire: 20%
Ruby: 10%

and with upgrade system, it increases the % chance to find mineras of type

Coal: 55%
Iron: 45%
Gold: 35%
Sapphire: 25%
Ruby: 15%

So on so forth, i know how to set up one single one, per person, but not all in one per person

this is my trigger, and it works perfectly, however i onyl want player one to see this multiboard

  • MineralBoard
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[1] = (Last created multiboard)
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 1 to (Coal: + (String(CoalMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • Multiboard - Show MineralBoard[1]
 
Last edited:
Level 29
Joined
Feb 18, 2014
Messages
3,581
this is my trigger, and it works perfectly, however i onyl want player one to see this multiboard
Use the GetLocalPlayer() trick.
  • Show Multiboard for One Player
    • Events
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == Player (0) then // Player(0) refer to Player (Red)
      • Multiboard - Show MineralBoard[1]
      • Custom script: endif
 
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
186
Use the GetLocalPlayer() trick.
  • Show Multiboard for One Player
    • Events
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == Player (0) then // Player(0) refer to Player (Red)
      • Multiboard - Show MineralBoard[1]
      • Custom script: endif

ah nice ty, so this is what my code should look like?

  • MineralBoard
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[1] = (Last created multiboard)
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[2] = (Last created multiboard)
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[3] = (Last created multiboard)
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[4] = (Last created multiboard)
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[5] = (Last created multiboard)
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[6] = (Last created multiboard)
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[7] = (Last created multiboard)
      • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
      • Set VariableSet MineralBoard[8] = (Last created multiboard)
      • -------- Coal Mineral --------
      • -------- Player1 --------
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 1 to (Coal: + (String(CoalMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Player2 --------
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 1 to (Coal: + (String(CoalMineral[2])))
      • Multiboard - Set the width for MineralBoard[2] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[2] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Player3 --------
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 1 to (Coal: + (String(CoalMineral[3])))
      • Multiboard - Set the width for MineralBoard[3] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[3] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Player4 --------
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 1 to (Coal: + (String(CoalMineral[4])))
      • Multiboard - Set the width for MineralBoard[4] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[4] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Player5 --------
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 1 to (Coal: + (String(CoalMineral[5])))
      • Multiboard - Set the width for MineralBoard[5] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[5] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Player6 --------
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 1 to (Coal: + (String(CoalMineral[6])))
      • Multiboard - Set the width for MineralBoard[6] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[6] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Player7 --------
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 1 to (Coal: + (String(CoalMineral[7])))
      • Multiboard - Set the width for MineralBoard[7] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[7] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Player8 --------
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 1 to (Coal: + (String(CoalMineral[8])))
      • Multiboard - Set the width for MineralBoard[8] item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[8] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
      • -------- Iron Mineral --------
      • -------- Player1 --------
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Player2 --------
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[2])))
      • Multiboard - Set the width for MineralBoard[2] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[2] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Player3 --------
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[3])))
      • Multiboard - Set the width for MineralBoard[3] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[3] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Player4 --------
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[4])))
      • Multiboard - Set the width for MineralBoard[4] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[4] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Player5 --------
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[5])))
      • Multiboard - Set the width for MineralBoard[5] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[5] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Player6 --------
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[6])))
      • Multiboard - Set the width for MineralBoard[6] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[6] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Player7 --------
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[7])))
      • Multiboard - Set the width for MineralBoard[7] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[7] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Player8 --------
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[8])))
      • Multiboard - Set the width for MineralBoard[8] item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[8] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
      • -------- Gold Mineral --------
      • -------- Player1 --------
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Player2 --------
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[2])))
      • Multiboard - Set the width for MineralBoard[2] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[2] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Player3 --------
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[3])))
      • Multiboard - Set the width for MineralBoard[3] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[3] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Player4 --------
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[4])))
      • Multiboard - Set the width for MineralBoard[4] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[4] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Player5 --------
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[5])))
      • Multiboard - Set the width for MineralBoard[5] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[5] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Player6 --------
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[6])))
      • Multiboard - Set the width for MineralBoard[6] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[6] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Player7 --------
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[7])))
      • Multiboard - Set the width for MineralBoard[7] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[7] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Player8 --------
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[8])))
      • Multiboard - Set the width for MineralBoard[8] item in column 1, row 3 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[8] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
      • -------- Sapphire Mineral --------
      • -------- Player1 --------
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Player2 --------
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[2])))
      • Multiboard - Set the width for MineralBoard[2] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[2] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Player3 --------
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[3])))
      • Multiboard - Set the width for MineralBoard[3] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[3] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Player4 --------
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[4])))
      • Multiboard - Set the width for MineralBoard[4] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[4] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Player5 --------
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[5])))
      • Multiboard - Set the width for MineralBoard[5] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[5] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Player6 --------
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[6])))
      • Multiboard - Set the width for MineralBoard[6] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[6] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Player7 --------
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[5])))
      • Multiboard - Set the width for MineralBoard[7] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[7] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Player8 --------
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[8])))
      • Multiboard - Set the width for MineralBoard[8] item in column 1, row 4 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[8] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
      • -------- Ruby Mineral --------
      • -------- Player1 --------
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[1])))
      • Multiboard - Set the width for MineralBoard[1] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[1] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Player2 --------
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[2])))
      • Multiboard - Set the width for MineralBoard[2] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[2] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Player3 --------
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[3])))
      • Multiboard - Set the width for MineralBoard[3] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[3] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Player4 --------
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[4])))
      • Multiboard - Set the width for MineralBoard[4] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[4] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Player5 --------
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[5])))
      • Multiboard - Set the width for MineralBoard[5] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[5] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Player6 --------
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[6])))
      • Multiboard - Set the width for MineralBoard[6] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[6] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Player7 --------
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[7])))
      • Multiboard - Set the width for MineralBoard[7] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[7] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Player8 --------
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[8])))
      • Multiboard - Set the width for MineralBoard[8] item in column 1, row 5 to 10.00% of the total screen width
      • Multiboard - Set the icon for MineralBoard[8] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
      • -------- Show MultiBoard --------
      • -------- Player1 --------
      • Custom script: if GetLocalPlayer() == Player (0) then
      • Multiboard - Show MineralBoard[1]
      • Custom script: endif
      • -------- Player2 --------
      • Custom script: if GetLocalPlayer() == Player (1) then
      • Multiboard - Show MineralBoard[2]
      • Custom script: endif
      • -------- Player3 --------
      • Custom script: if GetLocalPlayer() == Player (2) then
      • Multiboard - Show MineralBoard[3]
      • Custom script: endif
      • -------- Player4 --------
      • Custom script: if GetLocalPlayer() == Player (3) then
      • Multiboard - Show MineralBoard[4]
      • Custom script: endif
      • -------- Player5 --------
      • Custom script: if GetLocalPlayer() == Player (4) then
      • Multiboard - Show MineralBoard[5]
      • Custom script: endif
      • -------- Player6 --------
      • Custom script: if GetLocalPlayer() == Player (5) then
      • Multiboard - Show MineralBoard[6]
      • Custom script: endif
      • -------- Player7 --------
      • Custom script: if GetLocalPlayer() == Player (6) then
      • Multiboard - Show MineralBoard[7]
      • Custom script: endif
      • -------- Player8 --------
      • Custom script: if GetLocalPlayer() == Player (7) then
      • Multiboard - Show MineralBoard[8]
      • Custom script: endif
And will this break the game in some way?

AS if not be very good, so i dont have to set up Each Mineral Per Player, Per Source thats Generating it.

  • MineralReShow
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 1 to (Coal: + (String(CoalMineral[1])))
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 1 to (Coal: + (String(CoalMineral[2])))
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 1 to (Coal: + (String(CoalMineral[3])))
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 1 to (Coal: + (String(CoalMineral[4])))
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 1 to (Coal: + (String(CoalMineral[5])))
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 1 to (Coal: + (String(CoalMineral[6])))
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 1 to (Coal: + (String(CoalMineral[7])))
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 1 to (Coal: + (String(CoalMineral[8])))
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[1])))
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[2])))
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[3])))
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[4])))
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[5])))
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[6])))
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[7])))
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[8])))
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[1])))
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[2])))
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[3])))
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[4])))
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[5])))
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[6])))
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[7])))
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[8])))
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[1])))
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[2])))
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[3])))
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[4])))
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[5])))
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[6])))
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[5])))
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[8])))
      • Multiboard - Set the text for MineralBoard[1] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[1])))
      • Multiboard - Set the text for MineralBoard[2] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[2])))
      • Multiboard - Set the text for MineralBoard[3] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[3])))
      • Multiboard - Set the text for MineralBoard[4] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[4])))
      • Multiboard - Set the text for MineralBoard[5] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[5])))
      • Multiboard - Set the text for MineralBoard[6] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[6])))
      • Multiboard - Set the text for MineralBoard[7] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[7])))
      • Multiboard - Set the text for MineralBoard[8] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[8])))
 
Level 7
Joined
Nov 6, 2019
Messages
186
I would suggest you think about how to accomplish most of this with loops. Looping is your friend here and will save you from much copy-pasting.

So to loop, set up 2 triggers and at end of it tel it to run other trigger? so it loops? other than that i never messed with looping
 
Level 39
Joined
Feb 27, 2007
Messages
5,050
  • MineralBoard
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8 do (Actions)
        • Loop - Actions
          • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
          • Set VariableSet MineralBoard[(Integer A)] = (Last created multiboard)
          • -------- Coal Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 1 to (Coal: + (String(CoalMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 1 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
          • -------- Iron Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 2 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
          • -------- Gold Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 3 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
          • -------- Sapphire Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 4 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
          • -------- Ruby Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 5 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
          • -------- Show MultiBoard --------
          • Set ShowPlayer = Player((Integer A))
          • Custom script: if GetLocalPlayer() == udg_ShowPlayer then
          • Multiboard - Show MineralBoard[(Integer A)]
          • Custom script: endif
  • MineralReShow
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8 do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 1 to (Coal: + (String(CoalMineral[(Integer A)])))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[(Integer A)])))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[(Integer A)])))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[(Integer A)]))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[(Integer A)])))
 
Level 7
Joined
Nov 6, 2019
Messages
186
  • MineralBoard
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8 do (Actions)
        • Loop - Actions
          • Multiboard - Create a multiboard with 1 columns and 5 rows, titled - Minerals -.
          • Set VariableSet MineralBoard[(Integer A)] = (Last created multiboard)
          • -------- Coal Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 1 to (Coal: + (String(CoalMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 1 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNOnyxOrb.blp
          • -------- Iron Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 2 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNINV_Ore_Iron_01.blp
          • -------- Gold Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 3 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNMetal-GoldV1.2.blp
          • -------- Sapphire Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 4 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNSapphire.blp
          • -------- Ruby Mineral --------
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[(Integer A)])))
          • Multiboard - Set the width for MineralBoard[(Integer A)] item in column 1, row 5 to 10.00% of the total screen width
          • Multiboard - Set the icon for MineralBoard[(Integer A)] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNRuby.blp
          • -------- Show MultiBoard --------
          • Set ShowPlayer = Player((Integer A))
          • Custom script: if GetLocalPlayer() == udg_ShowPlayer then
          • Multiboard - Show MineralBoard[(Integer A)]
          • Custom script: endif
  • MineralReShow
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8 do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 1 to (Coal: + (String(CoalMineral[(Integer A)])))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 2 to (|cff808080Iron|r: + (String(IronMineral[(Integer A)])))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 3 to (|cffffff00Gold|r: + (String(GoldMineral[(Integer A)])))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 4 to (|cff0000ffSapphire|r: + (String(SapphireMineral[(Integer A)]))
          • Multiboard - Set the text for MineralBoard[(Integer A)] item in column 1, row 5 to (|cffff0000Ruby|r: + (String(RubyMineral[(Integer A)])))

ok so do i have to do this per player, or will it work each player with a seperate MB?
 
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
186
Use your brain, read the trigger. Try to figure out what it does. What are the loops for? Why are they better? Where is Integer A being used?

o would say fair enough, but as i never used Interger A, in a trigger ever, i dont know what the sheep it means

By your Reactiong, i assume yes, but now i to figure out this system.

  • Drill
    • Events
      • Time - Every (Random real number between 20.00 and 30.00) seconds of game time
    • Conditions
    • Actions
      • -------- Player 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 1 (Red)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[1] = (CoalMineral[1] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[1] = (IronMineral[1] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[1] = (GoldMineral[1] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[1] = (SapphireMineral[1] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[1] = (RubyMineral[1] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 1 (Red)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[1] = (CoalMineral[1] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[1] = (IronMineral[1] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[1] = (GoldMineral[1] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[1] = (SapphireMineral[1] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[1] = (RubyMineral[1] + (Random integer number between 1 and 2))
            • Else - Actions
      • -------- Player 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 2 (Blue)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[2] = (CoalMineral[2] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[2] = (IronMineral[2] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[2] = (GoldMineral[2] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[2] = (SapphireMineral[2] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[2] = (RubyMineral[2] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 2 (Blue)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[2] = (CoalMineral[2] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[2] = (IronMineral[2] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[2] = (GoldMineral[2] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[2] = (SapphireMineral[2] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[2] = (RubyMineral[2] + (Random integer number between 0 and 2))
            • Else - Actions
      • -------- Player 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 3 (Teal)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[3] = (CoalMineral[3] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[3] = (IronMineral[3] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[3] = (GoldMineral[3] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[3] = (SapphireMineral[3] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[3] = (RubyMineral[3] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 3 (Teal)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[3] = (CoalMineral[3] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[3] = (IronMineral[3] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[3] = (GoldMineral[3] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[3] = (SapphireMineral[3] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[3] = (RubyMineral[3] + (Random integer number between 0 and 2))
            • Else - Actions
      • -------- Player 4 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 4 (Purple)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[4] = (CoalMineral[4] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[4] = (IronMineral[4] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[4] = (GoldMineral[4] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[4] = (SapphireMineral[4] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[4] = (RubyMineral[4] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 4 (Purple)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[4] = (CoalMineral[4] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[4] = (IronMineral[4] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[4] = (GoldMineral[4] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[4] = (SapphireMineral[4] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[4] = (RubyMineral[4] + (Random integer number between 0 and 2))
            • Else - Actions
      • -------- Player 5 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 5 (Yellow)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[5] = (CoalMineral[5] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[5] = (IronMineral[5] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[5] = (GoldMineral[5] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[5] = (SapphireMineral[5] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[5] = (RubyMineral[5] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 5 (Yellow)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[5] = (CoalMineral[5] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[5] = (IronMineral[5] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[5] = (GoldMineral[5] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[5] = (SapphireMineral[5] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[5] = (RubyMineral[5] + (Random integer number between 0 and 2))
            • Else - Actions
      • -------- Player 6 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 6 (Orange)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[6] = (CoalMineral[6] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[6] = (IronMineral[6] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[6] = (GoldMineral[6] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[6] = (SapphireMineral[6] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[6] = (RubyMineral[6] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 6 (Orange)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[6] = (CoalMineral[6] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[6] = (IronMineral[6] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[6] = (GoldMineral[6] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[6] = (SapphireMineral[6] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[6] = (RubyMineral[6] + (Random integer number between 0 and 2))
            • Else - Actions
      • -------- Player 7 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 7 (Green)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[7] = (CoalMineral[7] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[7] = (IronMineral[7] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[7] = (GoldMineral[7] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[7] = (SapphireMineral[7] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[7] = (RubyMineral[7] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 7 (Green)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[7] = (CoalMineral[7] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[7] = (IronMineral[7] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[7] = (GoldMineral[7] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[7] = (SapphireMineral[7] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[7] = (RubyMineral[7] + (Random integer number between 0 and 2))
            • Else - Actions
      • -------- Player 8 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by Player 8 (Pink)) Equal to 1
        • Then - Actions
          • Set VariableSet CoalMineral[8] = (CoalMineral[8] + (Random integer number between 1 and 5))
          • Set VariableSet IronMineral[8] = (IronMineral[8] + (Random integer number between 0 and 4))
          • Set VariableSet GoldMineral[8] = (GoldMineral[8] + (Random integer number between 0 and 3))
          • Set VariableSet SapphireMineral[8] = (SapphireMineral[8] + (Random integer number between 0 and 2))
          • Set VariableSet RubyMineral[8] = (RubyMineral[8] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by Player 8 (Pink)) Equal to 2
            • Then - Actions
              • Set VariableSet CoalMineral[8] = (CoalMineral[8] + (Random integer number between 2 and 10))
              • Set VariableSet IronMineral[8] = (IronMineral[8] + (Random integer number between 1 and 8))
              • Set VariableSet GoldMineral[8] = (GoldMineral[8] + (Random integer number between 1 and 6))
              • Set VariableSet SapphireMineral[8] = (SapphireMineral[8] + (Random integer number between 1 and 4))
              • Set VariableSet RubyMineral[8] = (RubyMineral[8] + (Random integer number between 0 and 2))
            • Else - Actions
i assume this should work, but aint sure

  • MiningSystem
    • Events
      • Time - Every (Random real number between 20.00 and 30.00) seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Mining Rig units owned by (Player((Integer A)))) Equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 8, do (Actions)
            • Loop - Actions
              • Set VariableSet CoalMineral[(Integer A)] = (CoalMineral[(Integer A)] + (Random integer number between 1 and 5))
              • Set VariableSet IronMineral[(Integer A)] = (IronMineral[(Integer A)] + (Random integer number between 0 and 4))
              • Set VariableSet GoldMineral[(Integer A)] = (GoldMineral[(Integer A)] + (Random integer number between 0 and 3))
              • Set VariableSet SapphireMineral[(Integer A)] = (SapphireMineral[(Integer A)] + (Random integer number between 0 and 2))
              • Set VariableSet RubyMineral[(Integer A)] = (RubyMineral[(Integer A)] + (Random integer number between 0 and 1))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Mining Rig units owned by (Player((Integer A)))) Equal to 2
            • Then - Actions
              • For each (Integer A) from 1 to 8, do (Actions)
                • Loop - Actions
                  • Set VariableSet CoalMineral[(Integer A)] = (CoalMineral[(Integer A)] + (Random integer number between 2 and 10))
                  • Set VariableSet IronMineral[(Integer A)] = (IronMineral[(Integer A)] + (Random integer number between 1 and 8))
                  • Set VariableSet GoldMineral[(Integer A)] = (GoldMineral[(Integer A)] + (Random integer number between 1 and 6))
                  • Set VariableSet SapphireMineral[(Integer A)] = (SapphireMineral[(Integer A)] + (Random integer number between 1 and 4))
                  • Set VariableSet RubyMineral[(Integer A)] = (RubyMineral[(Integer A)] + (Random integer number between 0 and 2))
            • Else - Actions
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,050
i assume this should work, but aint sure
Test and you'll find out. 80% of trigger development is figuring out why what you tried didn't work. Start learning to do it now. What you did is almost correct. Your loops need to be outside all of the stuff you're doing; what they are doing is simulating all the copy and pasting you did. More arrays will help you here for setting min/max bounds of your randomly generated resources:

  • Events
    • Time - Elapsed game-time is 0.10 seconds
  • Conditions
  • Actions
    • Set CoalGenMin[0] = 0 //min to get when having 0 rigs
    • Set CoalGenMax[0] = 0 //max to get when having 0 rigs
    • Set CoalGenMin[1] = 1 //min to get when having 1 rig
    • Set CoalGenMax[1] = 5 //max to get when having 1 rig
    • Set CoalGenMin[2] = 2 //min 2 rigs
    • Set CoalGenMax[2] = 10 //max 2 rigs
    • -------- and so on for numbers of rigs > 2 --------
    • Set IronGenMin[0] = 0
    • Set IronGenMax[0] = 0
    • Set IronGenMin[1] = 0
    • Set IronGenMax[1] = 4
    • Set IronGenMin[2] = 1
    • Set IronGenMax[2] = 8
    • -------- and so on for numbers of rigs > 2 --------
    • Set GoldGenMin[0] = 0
    • Set GoldGenMax[0] = 0
    • Set GoldGenMin[1] = 0
    • Set GoldGenMax[1] = 3
    • Set GoldGenMin[2] = 1
    • Set GoldGenMax[2] = 6
    • -------- and so on for numbers of rigs > 2 --------
    • Set SapphireGenMin[0] = 0
    • Set SapphireGenMax[0] = 0
    • Set SapphireGenMin[1] = 0
    • Set SapphireGenMax[1] = 2
    • Set SapphireGenMin[2] = 1
    • Set SapphireGenMax[2] = 4
    • -------- and so on for numbers of rigs > 2 --------
    • Set RubyGenMin[0] = 0
    • Set RubyGenMax[0] = 0
    • Set RubyGenMin[1] = 0
    • Set RubyGenMax[1] = 1
    • Set RubyGenMin[2] = 1
    • Set RubyGenMax[2] = 2
    • -------- and so on for numbers of rigs > 2 --------
  • MiningSystem
    • Events
      • Time - Elapsed game time is (Random real number between 20.00 and 30.00) seconds
      • Countdown Timer - MineralGenTimer expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8 do (Actions)
        • Loop - Actions
          • Set MCount = (Number of living Mining Rig units owned by (Player((Integer A))))
          • Set CoalMineral[(Integer A)] = (CoalMineral[(Integer A)] + (Random integer number between CoalGenMin[MCount] and CoalGenMax[MCount]))
          • Set IronMineral[(Integer A)] = (IronMineral[(Integer A)] + (Random integer number between IronGenMin[MCount] and IronGenMax[MCount]))
          • Set GoldMineral[(Integer A)] = (GoldMineral[(Integer A)] + (Random integer number between GoldGenMin[MCount] and GoldGenMax[MCount]))
          • Set SapphireMineral[(Integer A)] = (SapphireMineral[(Integer A)] + (Random integer number between SapphireGenMin[MCount] and SapphireGenMax[MCount]))
          • Set RubyMineral[(Integer A)] = (RubyMineral[(Integer A)] + (Random integer number between RubyGenMin[MCount] and RubyGenMax[MCount]))
      • Countdown Timer - Start MineralGenTimer as a one-shot timer that will expire in (Random real number between 20.00 and 30.00) seconds
I also fixed an error with the trigger timing. When you use "random number..." in a trigger event, it decides that random real at the game start only one time and then the trigger will fire on that same interval throughout the game. If that's what you intended then leave it as it was, but I suspect you intended the generation delay to be randomly chosen each time. To accomplish this, you need to use a timer that you repeatedly re-start with a new duration every time. The first time will happen randomly as desired and then kick off the timer doing its thing.
 
Level 7
Joined
Nov 6, 2019
Messages
186
@Pyrogasm

Ty for info i will try this tomorrow when i return

And yes my plan is, to have it Generate Minerals, if u own a Mining Rig, and if u own 2, the minerals double, throughout the game

i also plan to make it so if u start training a unit, it checks if u have enough resource, and if it does then it uses that resource, and trains the unit, but if it doesnt then it cancels the unit training.

EDIT: @Pyrogasm

was up early, so thought to try it before i go out, but i must of done something wrong, as it isnt working, and i didnt understand it to start with but as i was typing it into the game, i started to understand why it is how it is, but doesnt work

however still not 100% on Interger A, so i to figure out what i have done wrong, then figure out how to set it so u can buy units, for minerals, or buy minerals for gold, which will be cash when i get to that part. all the Set Variables are Interger Varibles right?

  • SetMinerals
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • -------- SetUpCoal --------
      • Set VariableSet CoalGenMin[0] = 0
      • Set VariableSet CoalGenMax[0] = 0
      • Set VariableSet CoalGenMin[1] = 1
      • Set VariableSet CoalGenMax[1] = 5
      • Set VariableSet CoalGenMin[2] = 2
      • Set VariableSet CoalGenMax[2] = 10
      • -------- SetUpIron --------
      • Set VariableSet IronGenMin[0] = 0
      • Set VariableSet IronGenMax[0] = 0
      • Set VariableSet IronGenMin[1] = 0
      • Set VariableSet IronGenMax[1] = 4
      • Set VariableSet IronGenMin[2] = 1
      • Set VariableSet IronGenMax[2] = 8
      • -------- SetUpGold --------
      • Set VariableSet GoldGenMin[0] = 0
      • Set VariableSet GoldGenMin[0] = 0
      • Set VariableSet GoldGenMin[1] = 0
      • Set VariableSet GoldGenMin[1] = 3
      • Set VariableSet GoldGenMin[2] = 1
      • Set VariableSet GoldGenMin[2] = 6
      • -------- SetUpSapphire --------
      • Set VariableSet SapphireGenMin[0] = 0
      • Set VariableSet SapphireGenMax[0] = 0
      • Set VariableSet SapphireGenMin[1] = 0
      • Set VariableSet SapphireGenMax[1] = 2
      • Set VariableSet SapphireGenMin[2] = 1
      • Set VariableSet SapphireGenMax[2] = 2
      • -------- SetUpRuby --------
      • Set VariableSet RubyGenMin[0] = 0
      • Set VariableSet RubyGenMax[0] = 0
      • Set VariableSet RubyGenMin[1] = 0
      • Set VariableSet RubyGenMax[1] = 1
      • Set VariableSet RubyGenMin[2] = 0
      • Set VariableSet RubyGenMax[2] = 2
  • MineralSystem
    • Events
      • Time - Elapsed game time is (Random real number between 20.00 and 30.00) seconds
      • Time - MineralGenTimer expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set VariableSet MiningRig = (Number of living Mining Rig units owned by (Player((Integer A))))
          • Set VariableSet CoalMineral[(Integer A)] = (CoalMineral[(Integer A)] + (Random integer number between CoalGenMin[MiningRig] and CoalGenMax[MiningRig]))
          • Set VariableSet IronMineral[(Integer A)] = (IronMineral[(Integer A)] + (Random integer number between IronGenMin[MiningRig] and IronGenMax[MiningRig]))
          • Set VariableSet GoldMineral[(Integer A)] = (GoldMineral[(Integer A)] + (Random integer number between GoldGenMin[MiningRig] and GoldGenMax[MiningRig]))
          • Set VariableSet SapphireMineral[(Integer A)] = (SapphireMineral[(Integer A)] + (Random integer number between SapphireGenMin[MiningRig] and SapphireGenMax[MiningRig]))
          • Set VariableSet RubyMineral[(Integer A)] = (RubyMineral[(Integer A)] + (Random integer number between RubyGenMin[MiningRig] and RubyGenMax[MiningRig]))
      • Countdown Timer - Start MineralGenTimer as a One-shot timer that will expire in (Random real number between 20.00 and 30.00) seconds
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,050
What "doesn't work" about it? Try putting some debug display messages in to see what is running and what isn't. I don't see any error. Do you have "Fixed random seed" checked in your WE preferences? Yes all the variables are integers.
 
Level 7
Joined
Nov 6, 2019
Messages
186
What "doesn't work" about it? Try putting some debug display messages in to see what is running and what isn't. I don't see any error. Do you have "Fixed random seed" checked in your WE preferences? Yes all the variables are integers.

didnt expect a reply so soon, due to christmas holiday, anywho

i put debug text on it all, and every single text shows up

however it doesnt generate the minerals, so the MineralSystem trigger is one that isnt working, before i changed it to how u said to, it did generate.


So it says Minerals Generated, then Minerals Updated, but it doesnt update. or it doesnt generate so it shows as no update on board

Minerals.png
 
Level 39
Joined
Feb 27, 2007
Messages
5,050
You actually have a mining rig unit, right? It will generate 0 minerals for everything if you don't have one. Change the run frequency to be much higher for testing purposes, otherwise you have to wait 20-30s between generations to see if anything actually happened; with 1 mining rig the only mineral that you are guaranteed to get is Coal (the others have 0 as a low bound for 1 rig) so that's the only one you should definitely see go up. Others staying at 0 can be chalked up to RNG. There's also an error here:
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[0] = 0
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[0] = 0
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[1] = 0
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[1] = 3
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[2] = 1
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[2] = 6
Every other line should be max. If you still can't figure it out, you can even print the values of the mineral arrays or manually change those values to see if they get updated in the multiboard. Failing that, post the map here.
 
Level 7
Joined
Nov 6, 2019
Messages
186
You actually have a mining rig unit, right? It will generate 0 minerals for everything if you don't have one. Change the run frequency to be much higher for testing purposes, otherwise you have to wait 20-30s between generations to see if anything actually happened; with 1 mining rig the only mineral that you are guaranteed to get is Coal (the others have 0 as a low bound for 1 rig) so that's the only one you should definitely see go up. Others staying at 0 can be chalked up to RNG. There's also an error here:
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[0] = 0
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[0] = 0
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[1] = 0
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[1] = 3
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[2] = 1
  • empty.gif
    join.gif
    set.gif
    Set VariableSet GoldGenMin[2] = 6
Every other line should be max. If you still can't figure it out, you can even print the values of the mineral arrays or manually change those values to see if they get updated in the multiboard. Failing that, post the map here.

I looked at code so many times, and never noticed the GoldGen Issue, however i have set to 5 seconds for testing, and i have treid a command to give, and the board updates perfectly with command, and yes i have mining rig on the map.

MR.png

NOTE: my map is made in Reforge, maybe it a reforge bug, or i have something wrong, but here it is
 

Attachments

  • [UDA] Undead Survival v1.0a.w3m
    1.9 MB · Views: 26
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
186
So any idea what the issue is? If not anyone know how to make it work in reforge


Also question, how do I make it check players minerals, so variable before they train a unit or buy a item or build something?

so it will cancel training, building, upgrading and constructing if they don’t got the right amount?

and if they do, get it to remove that amount of minerals used from there minerals?

I thought I had it as I done something similar before, but can’t get it working with, integer A
 
Level 39
Joined
Feb 27, 2007
Messages
5,050
So any idea what the issue is? If not anyone know how to make it work in reforge
If you still can't figure it out, you can even print the values of the mineral arrays or manually change those values to see if they get updated in the multiboard. Failing that, post the map here.
Reforged shouldn't be any different to make this work. It's mostly just a visual upgrade but under the hood it's all the same between classic and reforged (barring bugs right now before a stable release).
how do I make it check players minerals, so variable before they train a unit or buy a item or build something?
so it will cancel training, building, upgrading and constructing if they don’t got the right amount?
and if they do, get it to remove that amount of minerals used from there minerals?
I thought I had it as I done something similar before, but can’t get it working with, integer A
Just... compare the amount of minerals the player has to the cost it should be. You have integer arrays of the minerals. The index of these arrays corresponds to the player number of the player with those resources. There is no reason to involve any Integer As at all here. I don't understand how the function of an Int A loop is so confusing to you... it literally just counts up from MIN to MAX repeating the actions with a different value of Int A.

Now the real issue is how do you store the info about the buildings' cost? I would use a hashtable with the parent index being the rawcode of the unit and the child index being the type of mineral:

  • Hashtable - Create a new hashtable
  • Set MineralHash = (Last created hashtable)
  • Set UType = Special Forge //some unit-type
  • Custom script: set udg_UType_Int = udg_UType //assign an integer variable = the unit rawcode in JASS because GUI won't let you do this or use unit types as hashtable keys
  • Hashtable - Save 12 as Key(Coal) of UType_Int in MineralHash //save int for cost in coal in hash
  • Hashtable - Save 3 as Key(Ruby) of UType_Int in MineralHash
  • -------- you don't have to store values for minerals a building/unit doesn't require --------
  • -------- the above "Special Forge" building costs 12 coal and 3 ruby to build --------
  • -------- another example: --------
  • Set MineralHash = (Last created hashtable)
  • Set UType = Gem Shoppe
  • Custom script: set udg_UType_Int = udg_UType
  • Hashtable - Save 1 as Key(Coal) of UType_Int in MineralHash //save int for cost in coal in hash
  • Hashtable - Save 1 as Key(Iron) of UType_Int in MineralHash
  • Hashtable - Save 1 as Key(Gold) of UType_Int in MineralHash
  • Hashtable - Save 1 as Key(Sapphire) of UType_Int in MineralHash
  • Hashtable - Save 1 as Key(Ruby) of UType_Int in MineralHash
  • -------- above costs 1 of each mineral --------
  • -------- repeat for all such unit/building types that require any of these extra resources --------
When a unit is ordered to build something it's given an order with the orderid being the rawcode of the unit it's been ordered to build. You can access the OrderId with JASS and compare that to see if it requires any additional resources the player doesn't have:

  • Events
    • Unit - A unit is issued an order targeting a point //building buildings
    • Unit - A unit is issued an order with no target //training units
  • Conditions
    • Or - Any conditions are true
      • (Unit type of (Triggering Unit)) equal to BUILDER_UNIT
      • ((Triggering Unit) is a structure) equal to true
  • Actions
    • Custom script: set udg_UType_Int = GetIssuedOrderId()
    • Set CoalCost = (Load Key(Coal) for UType_Int in MineralHash)
    • Set IronCost = (Load Key(Iron) for UType_Int in MineralHash)
    • Set GoldCost = (Load Key(Gold) for UType_Int in MineralHash)
    • Set SapphireCost = (Load Key(Sapphire) for UType_Int in MineralHash)
    • Set RubyCost = (Load Key(Ruby) for UType_Int in MineralHash)
    • Set PlayerNum = (Player number of (Triggering Player))
    • If (All conditions are true) then do (Then actions) else do (Else actions)
      • If - Conditions
        • CoalMineral[PlayerNum] greater than or equal to CoalCost
        • IronMineral[PlayerNum] greater than or equal to IronCost
        • GoldMineral[PlayerNum] greater than or equal to GoldCost
        • SapphireMineral[PlayerNum] greater than or equal to SapphireCost
        • RubyMineral[PlayerNum] greater than or equal to RubyCost
      • Then - Actions
        • Set CoalMineral[PlayerNum] = CoalMineral[PlayerNum] - CoalCost
        • Set IronMineral[PlayerNum] = IronMineral[PlayerNum] - IronCost
        • Set GoldMineral[PlayerNum] = GoldMineral[PlayerNum] - GoldCost
        • Set SapphireMineral[PlayerNum] = SapphireMineral[PlayerNum] - SapphireCost
        • Set RubyMineral[PlayerNum] = RubyMineral[PlayerNum] - RubyCost
      • Else - Actions
        • -------- Here you have to order the unit to cancel --------
        • -------- but it requires a 0.00 timer to do so (can't do it in this trigger) --------
        • Set CancelUnit = (Triggering Unit)
        • Countdown Timer - Start CancelTimer as a one-shot timer that will expire in 0.00 seconds
  • Events
    • Time - CancelTimer expires
  • Conditions
  • Actions
    • Custom script: call IssueImmediateOrderById(udg_CancelUnit, 851976)
 
Level 7
Joined
Nov 6, 2019
Messages
186
Reforged shouldn't be any different to make this work. It's mostly just a visual upgrade but under the hood it's all the same between classic and reforged (barring bugs right now before a stable release).

Just... compare the amount of minerals the player has to the cost it should be. You have integer arrays of the minerals. The index of these arrays corresponds to the player number of the player with those resources. There is no reason to involve any Integer As at all here. I don't understand how the function of an Int A loop is so confusing to you... it literally just counts up from MIN to MAX repeating the actions with a different value of Int A.

Now the real issue is how do you store the info about the buildings' cost? I would use a hashtable with the parent index being the rawcode of the unit and the child index being the type of mineral:

  • Hashtable - Create a new hashtable
  • Set MineralHash = (Last created hashtable)
  • Set UType = Special Forge //some unit-type
  • Custom script: set udg_UType_Int = udg_UType //assign an integer variable = the unit rawcode in JASS because GUI won't let you do this or use unit types as hashtable keys
  • Hashtable - Save 12 as Key(Coal) of UType_Int in MineralHash //save int for cost in coal in hash
  • Hashtable - Save 3 as Key(Ruby) of UType_Int in MineralHash
  • -------- you don't have to store values for minerals a building/unit doesn't require --------
  • -------- the above "Special Forge" building costs 12 coal and 3 ruby to build --------
  • -------- another example: --------
  • Set MineralHash = (Last created hashtable)
  • Set UType = Gem Shoppe
  • Custom script: set udg_UType_Int = udg_UType
  • Hashtable - Save 1 as Key(Coal) of UType_Int in MineralHash //save int for cost in coal in hash
  • Hashtable - Save 1 as Key(Iron) of UType_Int in MineralHash
  • Hashtable - Save 1 as Key(Gold) of UType_Int in MineralHash
  • Hashtable - Save 1 as Key(Sapphire) of UType_Int in MineralHash
  • Hashtable - Save 1 as Key(Ruby) of UType_Int in MineralHash
  • -------- above costs 1 of each mineral --------
  • -------- repeat for all such unit/building types that require any of these extra resources --------
When a unit is ordered to build something it's given an order with the orderid being the rawcode of the unit it's been ordered to build. You can access the OrderId with JASS and compare that to see if it requires any additional resources the player doesn't have:

  • Events
    • Unit - A unit is issued an order targeting a point //building buildings
    • Unit - A unit is issued an order with no target //training units
  • Conditions
    • Or - Any conditions are true
      • (Unit type of (Triggering Unit)) equal to BUILDER_UNIT
      • ((Triggering Unit) is a structure) equal to true
  • Actions
    • Custom script: set udg_UType_Int = GetIssuedOrderId()
    • Set CoalCost = (Load Key(Coal) for UType_Int in MineralHash)
    • Set IronCost = (Load Key(Iron) for UType_Int in MineralHash)
    • Set GoldCost = (Load Key(Gold) for UType_Int in MineralHash)
    • Set SapphireCost = (Load Key(Sapphire) for UType_Int in MineralHash)
    • Set RubyCost = (Load Key(Ruby) for UType_Int in MineralHash)
    • Set PlayerNum = (Player number of (Triggering Player))
    • If (All conditions are true) then do (Then actions) else do (Else actions)
      • If - Conditions
        • CoalMineral[PlayerNum] greater than or equal to CoalCost
        • IronMineral[PlayerNum] greater than or equal to IronCost
        • GoldMineral[PlayerNum] greater than or equal to GoldCost
        • SapphireMineral[PlayerNum] greater than or equal to SapphireCost
        • RubyMineral[PlayerNum] greater than or equal to RubyCost
      • Then - Actions
        • Set CoalMineral[PlayerNum] = CoalMineral[PlayerNum] - CoalCost
        • Set IronMineral[PlayerNum] = IronMineral[PlayerNum] - IronCost
        • Set GoldMineral[PlayerNum] = GoldMineral[PlayerNum] - GoldCost
        • Set SapphireMineral[PlayerNum] = SapphireMineral[PlayerNum] - SapphireCost
        • Set RubyMineral[PlayerNum] = RubyMineral[PlayerNum] - RubyCost
      • Else - Actions
        • -------- Here you have to order the unit to cancel --------
        • -------- but it requires a 0.00 timer to do so (can't do it in this trigger) --------
        • Set CancelUnit = (Triggering Unit)
        • Countdown Timer - Start CancelTimer as a one-shot timer that will expire in 0.00 seconds
  • Events
    • Time - CancelTimer expires
  • Conditions
  • Actions
    • Custom script: call IssueImmediateOrderById(udg_CancelUnit, 851976)


Am Assuming from how it is, the UType, is per type of unit, so to make multiple Variables one per unit, as using same UType variable, for 3 units for example, would change the unit set to that variable.

and the Generation trigger, still doesnt work.

EDIT: i must of again, done something wrong, as it doesnt let u build unless u got Minerals makes sense, but if u have them, it doesnt remove them from ur minerals when used.

EDIT2: and with it how it is, even with the Minerals, u to click ti liek 10 times to get it to train unit

EDIT3: and if u press it enough times in a row without having resource, in end it still trains them

EDIT4: and apparently it crashes the game, too.

Set simple only one, for testing.

  • SetupShop
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set VariableSet MineralHash = (Last created hashtable)
      • Set VariableSet UType = Counterfeiter
      • Custom script: set udg_UType_Int = udg_UType
      • Hashtable - Save 50 as (Key Coal.) of UType_Int in MineralHash.
  • TheSale
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Hut
    • Actions
      • Custom script: set udg_UType_Int = GetIssuedOrderId()
      • Set VariableSet CoalCost = (Load (Key Coal.) of UType_Int from MineralHash.)
      • Set VariableSet IronCost = (Load (Key Iron.) of UType_Int from MineralHash.)
      • Set VariableSet GoldCost = (Load (Key Gold.) of UType_Int from MineralHash.)
      • Set VariableSet SapphireCost = (Load (Key Sapphire.) of UType_Int from MineralHash.)
      • Set VariableSet RubyCost = (Load (Key Ruby.) of UType_Int from MineralHash.)
      • Set VariableSet PlayerNum = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CoalMineral[PlayerNum] Greater than or equal to CoalCost
        • Then - Actions
          • Set VariableSet CoalMineral[PlayerNum] = (CoalMineral[PlayerNum] - CoalCost)
        • Else - Actions
          • Set VariableSet CancelUnit = (Triggering unit)
          • Countdown Timer - Start CancelTimer as a One-shot timer that will expire in 0.00 seconds
          • Game - Display to (All players) the text: Not Enough Coal.
  • Cancel
    • Events
      • Time - CancelTimer expires
    • Conditions
    • Actions
      • Custom script: call IssueImmediateOrderById(udg_CancelUnit, 851976)
Maybe i should give up on Mineral System.
 
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
186
@Pyrogasm - as I can’t get it working, if you don’t mind and can get it working possible in reforged editor, could you post a example mAp on here.
 
Level 39
Joined
Feb 27, 2007
Messages
5,050
Again: figure out what is work and what is not working. Are the values of coal cost being properly saved at map init? (Check by printing the value if you try to read it from the hashtable.) Is the unit being issued the order to train properly? (Print the value of Utype_Int when the trigger goes off.) Is it getting the right player for PlayerNum? (Print its value, try using Owner of Triggering Unit instead, maybe that's the issue.)

I don't have Reforged.
 
Level 7
Joined
Nov 6, 2019
Messages
186
Again: figure out what is work and what is not working. Are the values of coal cost being properly saved at map init? (Check by printing the value if you try to read it from the hashtable.) Is the unit being issued the order to train properly? (Print the value of Utype_Int when the trigger goes off.) Is it getting the right player for PlayerNum? (Print its value, try using Owner of Triggering Unit instead, maybe that's the issue.)

I don't have Reforged.

I did print values, the generation trigger is exact same as yours, but doesnt work, and the buying unit, is also same as yours but doesn’t work


Only parts that do work, is creating and showing multi board and the multi board update trigger, I used a command to give minerals to test the update trigger.

I do appreciate your help you have given so far.

Do note I only know 50% of the WE, I am still learning, so saying, Do This, Do That doesn’t help much
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,050
Again: what doesn't work? You printed some values, what did they show? Print values that should be saved in the generation trigger before the mineral counts are updated. Print the values after updating them to see what they are.
 
Status
Not open for further replies.
Top