pX_selectgroup ( unsigned int bitmask );

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.

Parameters:

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.

Returns:

1 if successful, 0 otherwise.

Remarks:

Speed:

Medium

Example:

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);
}

See also:

pXent_setgroup