The newNpcChildGroupMl native AI script function is used to create a multilevel dynamic NPC group with a parent/children relation. This function allows setting a base level for the spawned group.
(Group: c)newNpcChildGroupMl(GroupTemplate: s, StateMachine: s, Zone: s, BaseLevel: f) // newNpcChildGroupMl_sssf_c
()newNpcChildGroupMl(GroupTemplate: s, StateMachine: s, Zone: s, BaseLevel: f) // newNpcChildGroupMl_sssf_
(Group: c)newNpcChildGroupMl(GroupTemplate: s, StateMachine: s, Zone: s, BaseLevel: f, Dispersion: f) // newNpcChildGroupMl_sssff_c
()newNpcChildGroupMl(GroupTemplate: s, StateMachine: s, Zone: s, BaseLevel: f, Dispersion: f) // newNpcChildGroupMl_sssff_
The return values of the newNpcChildGroupMl function depend on which version of the function is used:
These functions do not return a value.
()newNpcChildGroupMl("class_forager", "state_machine_1", $zone, 12);
This example code calls the newNpcChildGroupMl function with a GroupTemplate of "class_forager", a StateMachine of "state_machine_1", a Zone, and a BaseLevel to spawn the group at.
(@grp)newNpcChildGroupMl("class_forager", "state_machine_1", $zone, 2, 50);
This example code calls the newNpcChildGroupMl function with a GroupTemplate of "class_forager", a StateMachine of "state_machine_1", a Zone, a BaseLevel to spawn the group at, and a dispersion radius of 50 meters. It then returns the newly created group as a value.