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

Total gold acquired

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,986
Quick and simple, guys.

I wanna track the total gold acquired by a player. What's the math?

That's what I managed to come up with, but sadly it appears to track Current gold:

[trigger="Gold Acquired"]Gold Acquired
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Set Gold_Acquired = (Gold_Acquired + ((Player 1 (Red) Current gold) - Gold_Acquired))
Game - Display to (All players) the text: (String(Gold_Acquired))
[/trigger]
 
Level 13
Joined
Sep 13, 2010
Messages
550
Here use this:
JASS:
function GetTotalGoldForPlayer takes player p returns integer
    return GetPlayerState(p, PLAYER_STATE_GOLD_GATHERED)
endfunction

  • Example
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: set udg_TotalGold = GetTotalGoldForPlayer( GetTriggerPlayer() )
      • Game - Display to (All players) the text: (String(TotalGold))

Kobass, there is function in GUI for that as well :D Somewhat Player xy Total gold grathered

EDIT: yes delete your post noob :D
 
Status
Not open for further replies.
Top