• 🏆 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] Remove Location in Loop with Index

Status
Not open for further replies.
Level 4
Joined
Dec 24, 2005
Messages
54
Hi,

this is my problem:

  • For each (Integer ScreenMove2) from 1 to 9, do (Actions)
    • Schleifen - Aktionen
      • Einheit - Order ScreenMoveUnit to Patrouillieren nach ScreenMovePoint[ScreenMove2]
      • Custom script: call RemoveLocation (udg_ScreenMovePoint[.....])
ScreenMovePoint is a Location i have set for ScreenMovePoint[1]...[2] etc.
I now want to destroy this locations in my loop action. How does this work? What to set for "....."?

Thanks for you help!

Greetings
Kill3rbeast
 
Level 15
Joined
Jan 31, 2007
Messages
502
  • For each (Integer ScreenMove2) from 1 to 9, do (Actions)
    • Loop - Actions
      • Unit - Order ScreenMoveUnit to Patrol to ScreenMovePoint[ScreenMove2]
      • Custom script: call RemoveLocation (udg_ScreenMovePoint[udg_ScreenMove2])
Shouldnt this work ?

JASS:
    set udg_ScreenMove2 = 1
    loop
        exitwhen udg_ScreenMove2 > 9
        call IssuePointOrderLoc( GetLastCreatedUnit(), "patrol", udg_ScreenMovePoint[udg_ScreenMove2] )
        call RemoveLocation (udg_ScreenMovePoint[udg_ScreenMove2])
        set udg_ScreenMove2 = udg_ScreenMove2 + 1
    endloop
 
Status
Not open for further replies.
Top