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

[Trigger] Count Stats every X seconds

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

I got 10 Players. Every Player can choose one hero.

Now I want count every second the Str, Agi and Int of the (max) 10 Heroes.
I want try it with 1 variable. But how?

====
Why I want use this?: I got some other Heros on the map. And I want set the stats of this heros to the counted Stat of the (max) 10 Heroes.

Maybe someone got an idea for this .. and if I count it every seconds will the game lag?
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
You don't have to count this every second as there is a function that does it.

JASS:
GetHeroAgi(whichHero, includeBonuses)
GetHeroInt(whichHero, includeBonuses)
GetHeroStr(whichHero, includeBonuses)
// There are functions which return hero stats
// Make second argument (includeBonuses) true or false
// You can call it from GUI simply making a integer variable eg. TempInt to handle the transfer

// Here is an example of custom script
CustomScript: set udg_TempInt = GetHeroAgi(GetTriggerUnit(), true)
 
Status
Not open for further replies.
Top