-
Notifications
You must be signed in to change notification settings - Fork 94
new_npc_child_group_pos
Ryzom Core Wiki edited this page Jul 8, 2024
·
4 revisions
title: New NPC Child Group Pos description: published: true date: 2023-03-16T23:08:54.867Z tags: editor: markdown dateCreated: 2023-03-16T22:26:02.710Z
The newNpcChildGroupPos native AI script function is used to create a dynamic NPC group with a parent/children relation based on the provided position.
(Group: c)newNpcChildGroupPos(GroupTemplate: s, StateMachine: s, x: f, y: f) // newNpcChildGroupPos_ssff_c
()newNpcChildGroupPos(GroupTemplate: s, StateMachine: s, x: f, y: f) // newNpcChildGroupPos_ssff_
(Group: c)newNpcChildGroupPos(GroupTemplate: s, StateMachine: s, x: f, y: f, Dispersion: f) // newNpcChildGroupPos_ssfff_c
()newNpcChildGroupPos(GroupTemplate: s, StateMachine: s, x: f, y: f, Dispersion: f) // newNpcChildGroupPos_ssfff_
- 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.
- Dispersion (float, optional): The dispersion radius in meters when spawning a group (default value is 0).
The return values of the newNpcChildGroupPos function depend on which version of the function is used:
- Group (context): The newly created group.
These functions does not return a value.
()newNpcChildGroupPos("class_forager", "state_machine_1", x, y);
This example code calls the newNpcChildGroupPos function with a GroupTemplate of "class_forager", a StateMachine of "state_machine_1", and an x and y position to spawn the group at.
(@grp)newNpcChildGroupPos("class_forager", "state_machine_1", x, y, 30);
This example code calls the newNpcChildGroupPos 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 dispersion radius of 30 meters. It then returns the newly created group as a value.