• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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