1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Multiboard issue

Discussion in 'World Editor Help Zone' started by Xzere, Apr 19, 2020.

  1. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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?
     
  2. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,471
    Resources:
    0
    Resources:
    0
    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: Apr 19, 2020
  3. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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!