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

[Solved] Loop Location Custom Script Error

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
Hey guys I'm trying to make a trigger where I loop some point variables so I don't have to make 4 triggers, simplifying it down to one trigger. However I get an error every time saying "Expected Name". I have tried to fix the text in the custom script but I still get the error. I even used my own integer variable for it.

  • Spawn 1
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Arena1Loc[(Integer A)] = (Center of Arena1[(Integer A)])
          • Unit - Create 1 Swordsman for Neutral Hostile at Arena1Loc[(Integer A)] facing Arena1Loc[0]
          • Unit - Order (Last created unit) to Attack-Move To Arena1Loc[0]
          • Custom script: call RemoveLocation(udg_Arena1Loc[Integer A])
I don't see the problem.

Also I tried adding the brackets on the inside of the [] but it still gives me an error.
 
Last edited by a moderator:
Level 10
Joined
Jan 20, 2011
Messages
492
No problem. Still, it is advised that you use your own unique integer variable for each looping because looping with integer A/B can cause issues sometimes due to them being global variables.

Yeah I was aware about that issue, and I was planning on it, cause I will be using this for several things (dungeons), and don't want units of a stronger type spawning in the wrong dungeon :p

Anyway thank you for expanding and clarifying.
 
Status
Not open for further replies.
Top