Ice_Rhino 3 Posted August 20, 2013 I see in a lot of script the value of _x. Could someone tell me what this means? Share this post Link to post Share on other sites
kylania 567 Posted August 20, 2013 _x is the "current" value of an array that's being processed through a count or forEach command. It will be replaced by the actual value in each iteration. _people = [bob, ned, sally]; { _x setDamage 1; } forEach _people; In that example you take an array with three elements, bob, ned and sally. We're assuming those are objects. We loop through the list, one at a time, using the forEach command. Each time through we execute this command: _x setDamage 1; First time through _x will be replaced with the first element of _people, in this case bob. So the three commands that structure will execute are, in turn: bob setDamage 1; ned setDamage 1; sally setDamage 1; So it's a placeholder for the current value of the array being worked through. 1 1 Share this post Link to post Share on other sites
bangabob 41 Posted August 20, 2013 _x is a placeholder used mainly for the foreach and count command. For example the following will replace _x with the name with each unit in AlphaGroup { _x; hint format ["%1",_x] }foreach units AlphaGroup; So if i am in AlphaGroup a hint will show saying "BangaBob". Not "_x" 1 Share this post Link to post Share on other sites