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

"Damage Done" using a Multiboard

Status
Not open for further replies.
Level 2
Joined
Aug 21, 2010
Messages
7
Heyo, I'm somewhat new to the trigger-madness although I've been making maps for quite a long while. I'd really appreciate it if someone can show me a way to display the damage each player has caused during the game using a multiboard. I've noticed that if I use the event response - damage taken, 1. spells do not count and 2. after the initial hit, the trigger continues to count all damage other units cause to the attacked unit.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1) Spells do count.
2) You can filter the information.

If you use Weep's Damage Detection, this becomes quite easy.

1) Import the system linked above.
2) Create a real array variable (the array will represent the player number).
3) Use this trigger:
  • Add Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Set tempInt = (Player number of (Owner of GDD_DamageSource))
      • Set damageDone[tempInt] = (damageDone[tempInt] + GDD_Damage)
      • Multiboard - Set the text for multiboard item in column 3, row (1 + tempInt) to (String(damageDone[tempInt]))
In this case, the players' rows range from 2 to (player count+1). So red (Player 1 in GUI) will be in the second row.
The third column is where all the damage is displayed.

You could also convert damageDone to an integer before showing it (that looks a bit better in my opinion).
 
Level 2
Joined
Aug 21, 2010
Messages
7
Many thanks! I was looking for some solid information on how to do it for rather long...I'll check it out. :)
 
Level 2
Joined
Aug 21, 2010
Messages
7
I may be doing something wrong, but from what I see, the trigger does not separate damage caused by the player from the damage caused by hostile attackers...I've fiddled a bit with it, but I found no solution.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I may be doing something wrong, but from what I see, the trigger does not separate damage caused by the player from the damage caused by hostile attackers...I've fiddled a bit with it, but I found no solution.
It should separate them.

tempInt = player number of damaging player.
Since you change damageDealt[tempInt], this means that only the variable for the damaging player will change - nothing else.

If the damaging player is neutral hostile, then tempInt = 16. This means that the player values remain untouched.
If you want, you can put in a condition like "if tempInt less than or equal to (amount of human players in your map) then do" - put all the other actions in the Then-section.

Maybe you could show me the map, in case you still can't get it working.
 
Level 2
Joined
Aug 21, 2010
Messages
7
It's working now, I started the trigger one more time from scratch instead of trying to figure out what was wrong and it separates the damage correctly. So annoying when you've worked yourself to a headache and it's something super-simple you just didn't notice :p Thanks a lot for the help!
 
Status
Not open for further replies.
Top