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.
(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_
The return values of the newNpcChildGroupPosMl function depend on which version of the function is used:
These functions does not return a value.
()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.