The getGroupTemplateWithFlags native AI script function returns the name of a randomly chosen group template that matches a set of specified flags.
(GroupTemplate: s)getGroupTemplateWithFlags(OneOf: s, Mandatory: s) // getGroupTemplateWithFlags_ss_s
(GroupTemplate: s)getGroupTemplateWithFlags(OneOf: s, Mandatory: s, ExceptFlags: s) // getGroupTemplateWithFlags_sss_s
($group)getGroupTemplateWithFlags("food|rest", "invasion|outpost"); // Returns a group template that matches 'invasion', 'outpost' and either 'food' or 'rest' flags.
($group)getGroupTemplateWithFlags("food|rest", "invasion|outpost", "dungeon"); // Returns a group template that matches 'invasion', 'outpost' and either 'food' or 'rest' flags, but does not match the 'dungeon' flag.