• 🏆 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!

[Solved] Multiboard issue

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello, i'm having an issue with themultiboard update, which makes it looks like this:
Damage dealt.png


This trigger works correctly.
  • Damage Dealt Update
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Owner of GDD_DamageSource) Not equal to Player 12 (Brown)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 0 of 0 from Hashtable.) Not equal to 0
        • Then - Actions
          • Player Group - Pick every player in (All players matching ((Owner of GDD_DamageSource) Equal to (Matching player)).) and do (Actions)
            • Loop - Actions
              • Multiboard - Set the text for MultiBoard item in column 4, row Multiboard_Spots[(Player number of (Owner of GDD_DamageSource))] to (String(DamageDone[(Player number of (Owner of GDD_DamageSource))]))
              • Set VariableSet DamageDone[(Player number of (Picked player))] = (DamageDone[(Player number of (Picked player))] + (Integer(GDD_Damage)))
        • Else - Actions
          • Player Group - Pick every player in (All players matching ((Owner of GDD_DamageSource) Equal to (Matching player)).) and do (Actions)
            • Loop - Actions
              • Multiboard - Set the text for MultiBoard item in column 4, row Multiboard_Spots[(Player number of (Owner of GDD_DamageSource))] to (String(DamageDone[(Player number of (Owner of GDD_DamageSource))]))
              • Set VariableSet DamageDone[(Player number of (Picked player))] = (DamageDone[(Player number of (Picked player))] + (Integer(GDD_Damage)))

This is the trigger for [Damage taken], which does not work. (See picture)
  • Damage Taken Update
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Owner of GDD_DamageSource) Equal to Player 12 (Brown)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 0 of 0 from Hashtable.) Not equal to 0
        • Then - Actions
          • Player Group - Pick every player in (All players matching ((Owner of GDD_DamageSource) Equal to (Matching player)).) and do (Actions)
            • Loop - Actions
              • Multiboard - Set the text for MultiBoard item in column 5, row Multiboard_Spots[(Player number of (Owner of GDD_DamageSource))] to (String(DamageTaken[(Player number of (Owner of GDD_DamageSource))]))
              • Set VariableSet DamageTaken[(Player number of (Owner of GDD_DamageSource))] = (DamageTaken[(Player number of (Owner of GDD_DamageSource))] + (Integer(GDD_Damage)))
        • Else - Actions
          • Player Group - Pick every player in (All players matching ((Owner of GDD_DamageSource) Equal to (Matching player)).) and do (Actions)
            • Loop - Actions
              • Multiboard - Set the text for MultiBoard item in column 5, row Multiboard_Spots[(Player number of (Owner of GDD_DamageSource))] to (String(DamageTaken[(Player number of (Owner of GDD_DamageSource))]))
              • Set VariableSet DamageTaken[(Player number of (Owner of GDD_DamageSource))] = (DamageTaken[(Player number of (Owner of GDD_DamageSource))] + (Integer(GDD_Damage)))
Now, my question is, how do i make this Damage Taken trigger function properly?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,536
Not sure how that Damage Engine works but you're using the same exact event for both triggers. Edit: I see what you're doing now with the condition. You could combine these 2 triggers into 1.

Also, can you explain what the Hashtable stuff is for? Load 0 of 0 not equal to 0?

Some issues:

1) You don't need to "Pick every player in all players" when updating the Multiboard.

2) You're updating the Multiboard before adjusting the variable.

3) It looks like you reference owner of DamageSource in both triggers. Shouldn't you reference the unit that was damaged in the 2nd trigger that's used Player 12?

I think it should look something like this unless I'm misunderstanding your goal. Note that I'm using Bribe's Damage Engine so the variables used are slightly different:

You probably want this. So Players (besides player 12) have their Damage Dealt / Damage Taken tracked on the Multiboard:
  • Example
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of DamageEventSource) Not equal to Player 12 (Brown)
        • Then - Actions
          • -------- DAMAGE DEALT --------
          • Set VariableSet PlayerNumber = (Player number of (Owner of DamageEventSource))
          • -------- --------
          • Set VariableSet DamageDone[PlayerNumber] = (DamageDone[PlayerNumber] + DamageEventAmount)
          • -------- --------
          • Multiboard - Set the text for Multiboard item in column 4, row MBSpots[PlayerNumber] to (String(DamageDone[PlayerNumber]))
        • Else - Actions
          • -------- DAMAGE TAKEN --------
          • Set VariableSet PlayerNumber = (Player number of (Owner of DamageEventTarget))
          • -------- --------
          • Set VariableSet DamageTaken[PlayerNumber] = (DamageTaken[PlayerNumber] + DamageEventAmount)
          • -------- --------
          • Multiboard - Set the text for Multiboard item in column 5, row MBSpots[PlayerNumber] to (String(DamageTaken[PlayerNumber]))
 
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
Not sure how that Damage Engine works but you're using the same exact event for both triggers. Edit: I see what you're doing now with the condition. You could combine these 2 triggers into 1.

Also, can you explain what the Hashtable stuff is for? Load 0 of 0 not equal to 0?

Some issues:

1) You don't need to "Pick every player in all players" when updating the Multiboard.

2) You're updating the Multiboard before adjusting the variable.

3) It looks like you reference owner of DamageSource in both triggers. Shouldn't you reference the unit that was damaged in the 2nd trigger that's used Player 12?

I think it should look something like this unless I'm misunderstanding your goal. Note that I'm using Bribe's Damage Engine so the variables used are slightly different:

You probably want this. So Players (besides player 12) have their Damage Dealt / Damage Taken tracked on the Multiboard:
  • Example
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of DamageEventSource) Not equal to Player 12 (Brown)
        • Then - Actions
          • -------- DAMAGE DEALT --------
          • Set VariableSet PlayerNumber = (Player number of (Owner of DamageEventSource))
          • -------- --------
          • Set VariableSet DamageDone[PlayerNumber] = (DamageDone[PlayerNumber] + DamageEventAmount)
          • -------- --------
          • Multiboard - Set the text for Multiboard item in column 4, row MBSpots[PlayerNumber] to (String(DamageDone[PlayerNumber]))
        • Else - Actions
          • -------- DAMAGE TAKEN --------
          • Set VariableSet PlayerNumber = (Player number of (Owner of DamageEventTarget))
          • -------- --------
          • Set VariableSet DamageTaken[PlayerNumber] = (DamageTaken[PlayerNumber] + DamageEventAmount)
          • -------- --------
          • Multiboard - Set the text for Multiboard item in column 5, row MBSpots[PlayerNumber] to (String(DamageTaken[PlayerNumber]))
You are absolutely correct, i looked into my triggers and found out i used the same of everything pretty much, if i use "GDD_DamagedUnit", it works as intended. And i will probably make my trigger look more similar to yours. Also i cant remember what i used that for really, just an unused condition i guess. Thank you for your help!
 
Status
Not open for further replies.
Top