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

[Trigger] tempPoint Destruction

Status
Not open for further replies.
Level 5
Joined
May 21, 2006
Messages
174
Just a quick question,

If I have a tempPoint within a For Each (Integer A) loop, do I need to destroy the tempPoint in the end of the loop or is it sufficient to destroy it at the end of the trigger?

  • Actions
    • For each (Integer A) from 1 to 3, do (Actions)
      • Loop - Actions
        • Set tempPoint = (Center of REGION <gen>)
        • Unit - Create 1 UNIT for (Player((Integer A))) at tempPoint facing Default building facing (270.0) degrees
    • Custom script: call RemoveLocation( udg_tempPoint )
Thanks.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
If the temppoint is assigned inside the loop - as you have done - you need to destroy it at the end of each loop. Thus, do:

  • Actions
    • For each (Integer A) from 1 to 3, do (Actions)
      • Loop - Actions
        • Set tempPoint = (Center of REGION <gen>)
        • Unit - Create 1 UNIT for (Player((Integer A))) at tempPoint facing Default building facing (270.0) degrees
        • Custom script: call RemoveLocation( udg_tempPoint )
However, if your location is the center of a preset region, it'll remain the same each cycle of the loop, thus in your specific example, this would be better:

  • Actions
    • Set tempPoint = (Center of REGION <gen>)
    • For each (Integer A) from 1 to 3, do (Actions)
      • Loop - Actions
        • Unit - Create 1 UNIT for (Player((Integer A))) at tempPoint facing Default building facing (270.0) degrees
    • Custom script: call RemoveLocation( udg_tempPoint )
 
Level 16
Joined
Feb 22, 2006
Messages
960
do it like this

  • Actions
  • Set tempPoint = (Center of REGION <gen>)
  • For each (Integer A) from 1 to 3, do (Actions)
    • Loop - Actions
      • Unit - Create 1 UNIT for (Player((Integer A))) at tempPoint facing Default building facing (270.0) degrees
    • Custom script: call RemoveLocation( udg_tempPoint )
edit:eek:h elea was faster :<
 
Status
Not open for further replies.
Top