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

is this a bad Trigger

Status
Not open for further replies.
Level 11
Joined
Nov 13, 2010
Messages
210
i need to know if this is a bad trigger
  • Regrow Trees Setup
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Entire map) and do (Actions)
        • Loop - Actions
          • Trigger - Add to RegrowTrees <gen> the event (Destructible - (Picked destructible) dies)
  • RegrowTrees
    • Events
    • Conditions
    • Actions
      • Custom script: local destructable BADTREE = GetDyingDestructable()
      • Wait 20.00 seconds
      • Custom script: call DestructableRestoreLife( BADTREE, GetDestructableMaxLife(BADTREE), true )
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
It is a very naughty trigger! The bits used to store it were cursed by Satan himself! You will need to re-create it from scratch surrounded by incense while reciting verses from the Bible to make sure Satan does not curse it again and it becomes a good trigger. Ok enough messing around with grammar, time to get serious and technical.

Regrow Trees Setup does not work if there are more than 32 or 64 (some low number) of destructible on the map. The enumeration has a very low limit, certainly not the thousands which are normally the case with trees. You will need to break the map into very small units and then enumerate each such unit separately. You may need to use multiple threads for this to avoid hitting the op-limit.

Not all destructibles are trees. You may want to add some checks before adding them to the trigger.
 
Level 11
Joined
Nov 13, 2010
Messages
210
  • Regrow Trees Setup
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to (==) Felwood Tree Wall
            • Then - Actions
              • Trigger - Add to RegrowTrees <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
it seams to work
 
Status
Not open for further replies.
Top