-- I decided that RosterToList was not robust enough for all of my purposes, so I've created an additional script action that lets you drill down and create a List of units who meet a variety of specific criteria: UnitsToList! UnitsToList has 4 parameters: (1) the name of the list to populate with the results; (2) the army number (if in battle) or roster number (if not in battle) to draw from; (3) a list of stat conditionals all of the units have to meet to get on the list, delimited with bars (|); and (4) a list of attribute or tag conditions all of the units have to meet to get on the list, delimited with bars (|).
-- each stat conditional in UnitsToList functions like the first 3 parameters in IfStatRun; each contains three parts (though in this case, delimited with colons): the name of the stat to check:the comparison method:the value to check it against. (To get units with Level greater than 5, for instance, you'd use Level:g:5). You can use string stats here as well, though the comparison method becomes true or false. (To get units whose Class is not Axefighter, for instance, you'd use Class:false:Axefighter).
-- the attribute/tag conditionals in UnitsToList function similarly to the string stats in the stat conditionals; but instead of specifying a stat name, you'll use Personality, Physical, Life Skill, or Tag. (To get characters with a Serious personality trait, for instance, you'd use Personality:true:Serious.) Tags can take an additional part, for matching tags with a particular value assigned to them. (To get characters with a TargetValue,2 tag, for instance, you'd use Tag:true:TargetValue:2.)
So! Let's say that you've got a battle, and you want to run a custom event on turn 12 where a bunch of units are hit with a status effect due to some sort of crazy psy-related event. Suppose you need a List of every character in army 0 who has Mental Resistance less than or equal to 25, is not a Golem, and lacks the custom tag EventImmune. That's one army number, two stat conditionals, and one attribute conditional. Here's how you'd use UnitsToList to create that List of units to affect:
UnitsToList/AffectedUnits,0,Mental Res.:l=:25|Race:false:Golem,Tag:false:EventImmune
Given how complex UnitsToList can be to use, I've left RosterToList in the game as a quick-and-easy alternative for times we just need to quickly get a list of the player's characters outside of battle without being too picky about it.