How do I write integer A in script?

Status
Not open for further replies.
Integer A for custom script is bj_forLoopAIndex.
However, I recommend using a variable integer for the loops. Create a variable called LoopIndex and use it instead of Integer A.
Why? Because Integer A is slower and takes up more space, causing you to hit the op-limit faster.
The op-limit is the number of actions Warcraft can do at a time (afaik).
 
Here is an explanation of why you should generally use your own looping integer for each trigger:
https://www.hiveworkshop.com/forums/2444460-post6.html

It is pretty simple. Instead of using Integer A, just choose the function that allows you to use your own looping variable.

  • British Columbia
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
    • Actions
    • For each BC_LoopIndex from 1 to 10, do (Actions)
      • Loop - Actions
        • Unit - Order (Triggering unit) to Stop
And if you need to refer to it in custom script, simply use udg_BC_LoopIndex. You can use whatever prefix you want. I named it BC_LoopIndex, because BC is an acronym for the trigger name "British Columbia" (this is just an example, it isn't meant to do anything special).
 
So would I make a new LoopIndex variable for each loop across different triggers?

I think you can use the same unless it's a nestled loop.

Nvm if you take a look at the link provided by PurgeandFire then you will see an example of what could happen if loops share variable.
 
Status
Not open for further replies.
Back
Top