• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Issue with Multiboard - Towers Built

Status
Not open for further replies.
Level 8
Joined
Jun 26, 2019
Messages
318
Hello. Thanks for coming in and read. I created a multiboard with units killed and structures destroyed, and works beautiful fine. I wanted to add new stats to be "Towers Built." How many you have built scout towers only. I created one and it's not working... I tried everything to copy out of units killed or structures destroyed changing to this, but still not working. Hmmm. Anybody know how to fix this?

This units killed working fine:
upload_2019-12-15_19-35-43.png


This structures destroyed working fine:
upload_2019-12-15_19-36-4.png


But, this towers built for (scout tower unit) only don't work...
upload_2019-12-15_19-36-46.png
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
Look at your conditions. They don't make any sense.
  • Is a ground unit = false. So... no buildings will pass this check since they are ground units.
  • Is a structure. Uh, yeah, the event only fires when structures are built
  • Is Scout Tower. This is the only one you need; if a unit is specifically a Scout Tower then it's definitely a building and it's definitely a ground unit. Delete the rest.
Also you don't have to update all the MB text. You know which player it is that needs to be updated:
  • -------- for kills --------
  • Multiboard - Set the text for Multiboard item in column 4, row i to (String(Kills[i]))
  • -------- for destroys --------
  • Multiboard - Set the text for Multiboard item in column 5, row s to (String(Destroys[s]))
  • -------- for towers --------
  • Multiboard - Set the text for Multiboard item in column 3, row t to (String(Towers[t]))
 
Last edited:
Level 8
Joined
Jun 26, 2019
Messages
318
Okay. So. I just delete the rest of conditions? But, what about only Scout Tower? It will count all strutures... I only want scout tower to be counted into multiboard. Are you saying that I keep Equal to Scout Tower condition, and delete other conditions?
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,031
Use this instead of screenshotting triggers: How To Post Your Trigger
I just delete the rest of conditions? But, what about only Scout Tower? It will count all strutures... I only want scout tower to be counted into multiboard. Are you saying that I keep Equal to Scout Tower condition, and delete other conditions?
Is Scout Tower. This is the only one you need ... Delete the rest.
The problem is you're using "construting structure" when you should use "constructed structure". The one you used is for in-progress construction not finished construction. Ideally you never actually use either of those and always just use Triggering Unit in pretty much every scenario because it will always work. Use Triggering Unit if at all possible, and don't use the specific unit event responses unless TU doesn't give you the unit you want from the event (like attacking unit in attacked events).
 
Level 8
Joined
Jun 26, 2019
Messages
318
@Pyrogasm

I got Towers Built trigger fixed and works beautiful! Thank you! One more thing about this, for repairing, I am working on number of repairs. I am still figuring out how to do this. I want this trigger to be only working when the unit is less than 90% of life at every time repairing a structure, and when this trigger is being enabled and casting on structure at less than 90% of life, I want the trigger to plus 1 point added to multiboard when this unit's life is at 100%, you know? I couldn't find a "ability finished casting." I am asking you because you already knows what kind of Multiboard I am working on.

  • Update Repairs
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
      • (Percentage life of (Triggering unit)) Less than 90.00
      • (Ability being cast) Equal to Repair (Human)
    • Actions
      • Set t = (Player number of (Owner of (Casting unit)))
      • Set Towers[t] = (Towers[t] + 1)
      • Multiboard - Set the text for Multiboard item in column 3, row 2 to (String(Towers[2]))
      • Multiboard - Set the text for Multiboard item in column 3, row 3 to (String(Towers[3]))
      • Multiboard - Set the text for Multiboard item in column 3, row 4 to (String(Towers[4]))
      • Multiboard - Set the text for Multiboard item in column 3, row 5 to (String(Towers[5]))
      • Multiboard - Set the text for Multiboard item in column 3, row 6 to (String(Towers[6]))
      • Multiboard - Set the text for Multiboard item in column 3, row 7 to (String(Towers[7]))
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,031
The event you used is likely correct but again your conditions are messing you up.
  • Triggering unit is the unit casting the spell, so it would not be a structure (it's a builder). Use "Target unit of ability being cast" instead.
  • Life < 90% is problematic for two reasons.
    • It's not doing what you think it's doing. This check occurs when the ability finishes (when the unit is fully repaired) so it will have 100%
    • There's not an easy way to know if the tower was repaired from < 90% or not when the repair finishes, aside from storing it in a hashtable or array
I would recommend using a Unit Indexer in your map, then storing info into an array with the tower's custom value as an index. You are still going to get problems though. If the builder stops repairing at 95% and then later finishes the last 5% should it count as a repair or not? If it should you will have to build this functionality in somehow. If players have multiple workers that can do this repair then that's a whole other can of worms to deal with. Finally, it could be that since repair is autocastable it will trigger repeatedly while the unit is repairing or it might not even run a finishes casting event since it's a different kind of ability. You will have to experiment and find out.
 
Level 8
Joined
Jun 26, 2019
Messages
318
I have an idea. What about the tower is being complete repaired at 100% and count as 1? Not the builder's ability? Because if 2 builders repairing on same tower, it would count as 2. Mess up. I am thinking about tower being repaired complete at 100% and counts as 1, you know what I am saying? I think this is hard one... I couldn't find anything like this idea anywhere on this WC3 Hive. But, why not to make one. Maybe, hit points being healed up on only structures and counts as hit points of how much healed? :D
 
Last edited:
Status
Not open for further replies.
Top