get_group_template_with_flags - ryzom/ryzomcore GitHub Wiki


title: Get Group Template With Flags description: published: true date: 2023-03-12T20:58:54.092Z tags: editor: markdown dateCreated: 2023-03-12T20:58:51.044Z

getGroupTemplateWithFlags

The getGroupTemplateWithFlags native AI script function returns the name of a randomly chosen group template that matches a set of specified flags.

Syntax

(GroupTemplate: s)getGroupTemplateWithFlags(OneOf: s, Mandatory: s) // getGroupTemplateWithFlags_ss_s
(GroupTemplate: s)getGroupTemplateWithFlags(OneOf: s, Mandatory: s, ExceptFlags: s) // getGroupTemplateWithFlags_sss_s

Arguments

  • OneOf (string): A pipe-separated list of flags. At least one of these flags must match the group template.
  • Mandatory (string): A pipe-separated list of flags. All of these flags must match the group template.
  • ExceptFlags (string, optional): A pipe-separated list of flags. None of these flags can match the group template. This argument is optional.

Return Value

  • GroupTemplate (string): The name of a randomly chosen group template that matches the specified flags.

Examples

($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.

Notes

  • The function randomly selects a group template from the list of all available group templates that match the specified flags.
  • The flags are defined in the group template files.
  • The function can be used to dynamically spawn groups that match specific criteria.
⚠️ **GitHub.com Fallback** ⚠️