SharedEntityRange entity,range#

Parameters

entity - a shared entity

range# - how far from a player's entity this entity still reaches that player, in world units; 0 for everywhere

Description

Sets how far from each player's entity a shared entity still reaches that player.

In a big server room, a player has no need of a crate on the far side of the map. Out of its range, the player gets none of the entity's movement, and their copy hides it until it comes back within range, where it reappears in its new place. Ranges are measured from the entity each player plays as (SetSharedPlayerEntity), so a player with no entity yet gets everything.

A range of 0 means everywhere: give it to what every player must always see, such as the ball in a football game or the flag in capture the flag. An entity without a range of its own takes the room's, which SharedRoomRange sets and which is 0 until you set it.

Something at the edge doesn't flicker: it goes out of range past range#, and comes back only within nine tenths of it. Players whose Blitz3D+ is older than this command get every entity, whatever its range.

Only a server room's server sets ranges, and only on an entity it has shared; otherwise nothing changes and SharedWorldError() says why.

For the full story - server rooms, hosting, sharing and host migration - see the Shared World guide and its complete Shared_World_Playground.bb sample.


See also: SharedRoomRange, SetSharedPlayerEntity, ShareWorldEntity, SpawnSharedEntity.

Index