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

[General] For Loop Integer A?

Status
Not open for further replies.
Level 6
Joined
Nov 3, 2005
Messages
103
Hey, I've been trying to create a point capture system for nine points in total and I've been running into problems. I could actually do the entire thing without help, but I don't feel like copying and editing each piece of code for each point being captured nine times over.

I have a couple of variables set up to indicate the arrays of each Capture Point unit, the heroes within the distance of the points, and other important variables which I've assigned at the map's initialization event.

I'm also running periodic events to show whether or not the hero is in one of the groups I've created.

As an example of what my issue is:
I'm running a code which creates the special effect at the picked unit's origin during a periodic event.

Unit Group - Pick every unit in Point_Heroes_TeamA[(Integer A)] and do (Actions) - create the effect for picked unit

I want the game to loop the argument for all the arrays from 0 through 9 without having to copy the script 9 times and change the array for each time.

I've heard Integer A as something to do with this, not sure if that's true or not.

Edit: Never mind, I found it out. Have a different question though, of course. How would you check how many units are in a unit group?
 
Last edited:
Status
Not open for further replies.
Top