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] What is the purpose of this action? +rep

Discussion in 'World Editor Help Zone' started by SunTzu7387, Feb 6, 2012.

  1. SunTzu7387

    SunTzu7387

    Joined:
    Mar 28, 2009
    Messages:
    66
    Resources:
    0
    Resources:
    0
    • Custom script: call DestroyTrigger( GetTriggeringTrigger() )



    I have seen this used with preloading things with the map initialization event. What is its purpose and why do it for map initialization? +rep for helpers :thumbs_up:
     
  2. Alain.Mark

    Alain.Mark

    Joined:
    Apr 27, 2011
    Messages:
    185
    Resources:
    1
    JASS:
    1
    Resources:
    1
    reduce handle counts in the map. :) but that thing is not that necessary.
     
  3. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    How much this reduce lag?
     
  4. SunTzu7387

    SunTzu7387

    Joined:
    Mar 28, 2009
    Messages:
    66
    Resources:
    0
    Resources:
    0
    ya like does it reduce lag and save memory?
     
  5. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    Do you recommended to use this?

    How much does this reduce lag compared to memory leaks for example?
     
  6. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Leaks should be taken seriously because it will be generated infinitely (well, until the system stops looping or stop its usage (for example leaking points that not been cleared))

    While this trigger is a handle, which just not necessary to be destroyed but it can be destroyed

    You can choose to destroy it or not, but leaks are a-must destroy
     
  7. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    I agree leaks should be destroyed, but what about whole triggers? Should they be destroyed too? Or is it not that necessary?
     
  8. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    It is not that necessary, unless you dynamically create triggers as the game progresses.
     
  9. SunTzu7387

    SunTzu7387

    Joined:
    Mar 28, 2009
    Messages:
    66
    Resources:
    0
    Resources:
    0
    is it necessary for map initilization events like once the trigger is done it wont happen again type events to save memory?
     
  10. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    What do you mean by this?
     
  11. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,035
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    You can create new triggers during runtime, makes sense with the UnitWithinRange-event for example. So you would allocate a trigger for each unit but all the units might appear through other means. So you always store more stuff in memory. In contrast to a static leak, the max consumption is not limited and can therefore become a problem.
     
  12. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    I never create new triggers ingame. Does this mean it's not necessary for me to destroy triggers?
     
  13. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Yep. Since you only have a few hundred triggers maximum, they won't require that many handles.
     
  14. Aeroblyctos

    Aeroblyctos

    Joined:
    Aug 14, 2006
    Messages:
    6,597
    Resources:
    24
    Models:
    1
    Packs:
    1
    Maps:
    22
    Resources:
    24
    Aah, I'm relieved. I think I have about 200 to 1000 triggers(not sure I'm not home).

    What about events? I have one system that creates more events for a trigger. I believe the event count goes really high for one trigger, like 10,000. Is that a bad thing? Does that make lag?
     
  15. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    It would be a good idea to recreate the trigger if the events pile up, and some of them are for units that do not exist anymore for example.

    But if it does not seem to cause lag then just let it be :)
     
    Last edited: Feb 7, 2012
  16. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,035
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    Of course, I believe DestroyTrigger trashes the attached events. But rather, do you really need 1000 triggers?
     
  17. SunTzu7387

    SunTzu7387

    Joined:
    Mar 28, 2009
    Messages:
    66
    Resources:
    0
    Resources:
    0
    Aeroblyctos.... Stop hijacking my thread!!! They keep on answering your questions and not mine... My question would be is it good to do this action after a map initialization event since you don't need the trigger anymore?
     
  18. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    You can do it but, it doesn't make much difference destroying a few triggers.
     
  19. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,035
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    It's also another source of trouble if you do not do it right.
     
  20. shinji

    shinji

    Joined:
    Jul 25, 2011
    Messages:
    894
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You should use that in the end of a trigger that you will use only once.