new_npc_child_group_pos_ml - ryzom/ryzomcore GitHub Wiki


title: New NPC Child Group Pos Multilevel description: published: true date: 2023-03-12T18:24:07.690Z tags: editor: markdown dateCreated: 2023-03-12T18:21:59.225Z

newNpcChildGroupPosMl

The newNpcChildGroupPosMl native AI script function is used to create a multilevel dynamic NPC group with a parent/children relation based on the provided position. This function allows setting a base level for the spawned group.

Syntax

(Group: c)newNpcChildGroupPosMl(GroupTemplate: s, StateMachine: s, x: f, y: f, BaseLevel: f) // newNpcChildGroupPosMl_ssfff_c
()newNpcChildGroupPosMl(GroupTemplate: s, StateMachine: s, x: f, y: f, BaseLevel: f) // newNpcChildGroupPosMl_ssfff_
(Group: c)newNpcChildGroupPosMl(GroupTemplate: s, StateMachine: s, x: f, y: f, BaseLevel: f, Dispersion: f) // newNpcChildGroupPosMl_ssffff_c
()newNpcChildGroupPosMl(GroupTemplate: s, StateMachine: s, x: f, y: f, BaseLevel: f, Dispersion: f) // newNpcChildGroupPosMl_ssffff_

Arguments

  • GroupTemplate (string): The name of the template NPC group defined in the same AIInstance.
  • StateMachine (string): The name of the state machine defined in the same AIInstance.
  • x (float): The x position of the spawned group.
  • y (float): The y position of the spawned group.
  • BaseLevel (float): The base level of the spawned group.
  • Dispersion (float, optional): The dispersion radius in meters when spawning a group (default value is 0).

Return values

The return values of the newNpcChildGroupPosMl function depend on which version of the function is used:

(c)newNpcChildGroupPosMl(s, s, f, f, f) and (c)newNpcChildGroupPosMl(s, s, f, f, f, f)

  • Group (context): The newly created group.

()newNpcChildGroupPosMl(s, s, f, f, f) and ()newNpcChildGroupPosMl(s, s, f, f, f, f)

These functions does not return a value.

Examples

()newNpcChildGroupPosMl("class_forager", "state_machine_1", x, y, 13);

This example code calls the newNpcChildGroupPosMl function with a GroupTemplate of "class_forager", a StateMachine of "state_machine_1", an x and y position to spawn the group at, and a base level of 13.

(@grp)newNpcChildGroupPosMl("class_forager", "state_machine_1", x, y, 13, 7.5);

This example code calls the newNpcChildGroupPosMl function with a GroupTemplate of "class_forager", a StateMachine of "state_machine_1", an x and y position to spawn the group at, a base level of 13, and a dispersion radius of 7.5 meters. It then returns the newly created group as a value.

⚠️ **GitHub.com Fallback** ⚠️