Deletes all Actors that are not matching the provided bitmask. All physical entities ( Actors ) that were deleted by this function will be recreated in time, if their group ID matches to the bitmask. When your player moves out of viewing range of a physical entity (group) you can delete these objects so they don't need to be updated anymore, upon return you can then recreate the group. This function will only recreate / delete registered entities ( Actors ), non physical entities get ignored.
bitmask | all registered physical entities with a group_id matching the bitmask will become active, those not matching the bitmask are deleted. The bitmask is 21 bits; value 2097151 enables all objects. |
1 if successful, 0 otherwise.
Here's a sample bitmask for pX_selectgroup( 6 ), where 6 corresponds to the bits 0110:
when you delete Joints/Wheels with this function, you have to recreate them manual with pXcon_add or pXcon_add.
pX_selectgroup doesn't affect character controllers (PH_CHAR).
pX_selectgroup must be updated manual.
it is not recommended to run this function frequently.
Medium
pXent_settype(earth,1,PH_SPHERE);
pXent_setgroup( earth, 2 );
pX_selectgroup(1); // activates group1, all others are disabled/paused (earth entity) ... while(1){ if(key_f && earth.group!=1){
pXent_setgroup( earth, 1 ); // set entity to group1 -> entity gets enabled/activated
} wait(1);
}