View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 11th, 2016, 10:56 AM
The xCount and xIndex fields are generated with a foreach that uses a sort order to search through the abilities in order by the level they're added at.

The script that assigns them runs after FirstCopy is assigned, and is only run by the firstcopy. As it finds each copy, it increments a variable by +1 and then assigns the current value of that variable to that copy's xIndex.

Then at the end, that variable's value becomes xCount, and then in a script soon after that, all the other copies find the firstcopy of themselves, and set their own xCount equal to the firstcopy's xCount.
Mathias is offline   #2 Reply With Quote