• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[General] How to count spent gold?

Status
Not open for further replies.
I want to count spent gold in the multiboard. I tried with this trigger, but it's not working. Do you have any idea how to do it?

  • gold in multiboards
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Sold Item)) Equal to RING_AGI[1]
              • (Item-type of (Sold Item)) Equal to RING_ATTACK[1]
              • (Item-type of (Sold Item)) Equal to RING_ATTACK[1]
              • (Item-type of (Sold Item)) Equal to RING_HASTE[1]
              • (Item-type of (Sold Item)) Equal to RING_INT[1]
              • (Item-type of (Sold Item)) Equal to RING_MANA_RG[1]
              • (Item-type of (Sold Item)) Equal to RING_MOB[1]
              • (Item-type of (Sold Item)) Equal to RING_PROT[1]
              • (Item-type of (Sold Item)) Equal to RING_REGEN[1]
              • (Item-type of (Sold Item)) Equal to RING_STAMINA[1]
              • (Item-type of (Sold Item)) Equal to RING_STR[(Integer A)]
              • (Item-type of (Sold Item)) Equal to RING_WISDOM[(Integer A)]
              • (Item-type of (Sold Item)) Equal to Upgrade
        • Then - Actions
          • Set ML_Gold_Spent[(Player number of (Owner of (Buying unit)))] = (ML_Gold_Spent[(Player number of (Owner of (Buying unit)))] + 200)
        • Else - Actions
      • Multiboard - Set the text for Multiboard item in column 5, row (Player number of (Owner of (Buying unit))) to (String(ML_Gold_Spent[(Player number of (Owner of (Buying unit)))]))
 
I would suggest you to use a slightly more advanced option and simply take the difference between the current gold and total gathered gold of the player.
Take a look at this:
  • Show Gold GUI
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set TempPlayer[0] = Player 1 (Red)
      • Set TempForce[0] = (Player group(TempPlayer[0]))
      • Set TempInteger[0] = ((TempPlayer[0] Total gold gathered) - ((TempPlayer[0] Current gold) - 500))
      • Cinematic - Clear the screen of text messages for TempForce[0]
      • Game - Display to TempForce[0] the text: (Spend gold = + (String(TempInteger[0])))
      • Custom script: call DestroyForce(udg_TempForce[0])
 
^I wanted to post that first, too, but it will add all gold spend to the display, not only the one spent for items
 
Hm...

But his trigger obviously refers to only items, I think it depends on interpretation
 
Make an PlayerSpendsGold[Array] as INT.

Then fill it with pre-added values during events like "Finishes training a Unit / Upgrade" and "Acquires an Item".

Its a lot of triggers, but you can make it.
 
Status
Not open for further replies.
Back
Top