1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Welcome to the new Hive! Be advised that we're still working on the site. There are still many rough edges, so please bear with us.
    Dismiss Notice
  3. The 14th Icon Contest is still in progress (and may be extended). You can still make it in time.
    Dismiss Notice
  4. The 25th Texturing Contest has started! Contestants are to create a skin representing a dark elf person/being or any construct related to it using the vanilla models or the custom ones found on the site.
    Dismiss Notice
  5. Buy it, use it, break it, fix it, trash it, change it, mail - upgrade it. Join (Optionally) Paired Techtree Contest #11 - Techno Magic now!
    Dismiss Notice
  6. Voting squad, line up! Cast your vote on the poll for Modeling Contest #29 - Squads!
    Dismiss Notice
  7. Hero Contest #8 is up and running! This time it's a joint contest between artists and coders. Go here for team matchmaking.
    Dismiss Notice
  8. The poll for the theme of our StarCraft II Terraining Contest is up. Cast your note now!
    Dismiss Notice
  9. The ninth Concept Art Contest has launched. Enter now!
    Dismiss Notice
  10. The member Kam is making HIVE coasters. Take a look. For every coaster you buy, Hive gets $1.
    Dismiss Notice

[Solved] Multiboard data not properly updating

Discussion in 'World Editor Help Zone' started by Spartipilo, Apr 13, 2012.

  1. Spartipilo

    Spartipilo
    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Hi! I made this long trigger to keep track of towers Experience, Kills and Damage dealt. Also for the player with most gold.

    The thing is. If a tower has 20 kills, and I destroy/sell/update it, the Multiboard data doesn't update untill some other tower kills another unit. Same happens with gold, and damage, and exp.

    • Multiboard Display
      • Events
        • Time - Every 0.50 seconds of game time
      • Conditions
      • Actions
        • Set MostExp = 0
        • Set MostKills = 0
        • Set MostGold = 0
        • Set ivar2 = 0
        • Set MostDamage = 0.00
        • Set rvar = 0.00
        • Set rvar2 = 0.00
        • Unit Group - Pick every unit in Towers and do (Actions)
          • Loop - Actions
            • Set TUnit = (Picked unit)
            • Set Player = (Owner of TUnit)
            • Custom script: set udg_ivar = GetHandleId(udg_TUnit)
            • -------- Experience 1 --------
            • Set ivar2 = (Load 3 of ivar from Hash)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ivar2 Greater than MostExp
              • Then - Actions
                • Set MostExp = ivar2
                • Multiboard - Set the text for MultiBoard item in column 1, row 2 to (PlayerColors[(Player number of Player)] + ((Name of TUnit) + |r))
                • Multiboard - Set the text for MultiBoard item in column 2, row 2 to (String(MostExp))
              • Else - Actions
            • -------- Kills 2 --------
            • Set ivar2 = (Load 0 of ivar from Hash)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ivar2 Greater than MostKills
              • Then - Actions
                • Set MostKills = ivar2
                • Multiboard - Set the text for MultiBoard item in column 1, row 4 to (PlayerColors[(Player number of Player)] + ((Name of TUnit) + |r))
                • Multiboard - Set the text for MultiBoard item in column 2, row 4 to (String(MostKills))
              • Else - Actions
            • -------- Damage 3 --------
            • Set rvar = (Load 1 of ivar from Hash)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • rvar Greater than MostDamage
              • Then - Actions
                • Set MostDamage = rvar
                • Multiboard - Set the text for MultiBoard item in column 1, row 6 to (PlayerColors[(Player number of Player)] + ((Name of TUnit) + |r))
                • Multiboard - Set the text for MultiBoard item in column 2, row 6 to (String((Integer(MostDamage))))
              • Else - Actions
        • -------- Gold 4 --------
        • Player Group - Pick every player in (All players) and do (Actions)
          • Loop - Actions
            • Set Player = (Picked player)
            • Set ivar = (Player Current gold)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ivar Greater than MostGold
              • Then - Actions
                • Set MostGold = ivar
                • Multiboard - Set the text for MultiBoard item in column 1, row 8 to (PlayerColors[(Player number of Player)] + ((Name of Player) + |r))
                • Multiboard - Set the text for MultiBoard item in column 2, row 8 to (String(MostGold))
              • Else - Actions
     
  2. Maker

    Maker

    Code Moderator

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    How does selling/updating/destroying towers work? Is the old one killed/replaced/removed? Are towers removed from Towers?
     
  3. Spartipilo

    Spartipilo
    Joined:
    Jul 14, 2011
    Messages:
    3,190
    So wise maker... hehehe... I don't know why, I thought they were removed automatically or something.

    Tower Update saves the data from old tower to new one.
    The old one is replaced
    Towers weren't being removed from "Towers" <- Here was the problem

    ¬°Thanks again!