• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Weep Damage Detect Multiboard

Status
Not open for further replies.
Level 5
Joined
Jul 17, 2010
Messages
140
What am i doing wrong here?

I want to show damage done for each player in the multiboard.
Code:
Display Damage Copy
    Events
        Game - GDD_Event becomes Equal to 0.00
    Conditions
    Actions
        Set TempNr = (Player number of (Owner of GDD_DamageSource))
        Set Damage_Done[TempNr] = (Damage_Done[TempNr] + GDD__Integers[TempNr])
        Multiboard - Set the text for (Last created multiboard) item in column 2, row Multiboard_Spots[(Player number of (Owner of GDD_DamageSource))] to (|cff00FF00 + ((String(Damage_Done[(Player number of (Owner of GDD_DamageSource))])) + |r))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
When im in the virable i cant find it
Since damage done is a real, I am guessing its a real type variable. I am also guessing Damage_Done is an integer. As such it will not show up in the variable list for arguments to set Damage_Done to because a real is not an integer. You could use a conversion function from real to integer and then select it however this will discard fractional damage.

For accuracy I recommend making Damage_Done a real so that fractional damage is correctly counted. When displaying the amount on the multiboard either an additional conversion from real to integer is needed, or a conversion from real to string depending on what is desired.

Do be aware that unique strings leak permanently (until end of session). After generating enough such strings then some interactions involving strings will become very slow, to the point creating a single string causes frame drops. For this reason you might want to update the multiboard periodically (eg every 5 seconds) rather than every time damage is dealt. Another way to avoid string leaks is to use a proportional damage system where the string show is an integer percentage of the total damage done by everyone, this would limit the system to using only 100 unique strings.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
The reason the entire column was being flooded was because you were setting row 0. The GUI actions for multiboard flood in either rows or columns when set to 0.

There was no Force[1]. As such no players were mapped to the multiboard.

The list started at row 3 which is the final row of the board. Surely row 2 is more appropriate?

Attached is the map with the problems fixed. Damage is correctly counted. Still be aware of string leaks.
 

Attachments

  • Dominic74 fixed mb1.w3x
    25.8 KB · Views: 42
Status
Not open for further replies.
Top