Locality in Multiplayer: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fixed rules)
m (Replaced URLs with Wiki links.)
Line 2: Line 2:
A unit is said "local" when it is handled by the local computer.
A unit is said "local" when it is handled by the local computer.


To know if a unit is local, use the [http://community.bistudio.com/wiki/local local] script command.
To know if a unit is local, use the [[local]] script command.


The basic rules to determine locality are as follows:
The basic rules to determine locality are as follows:
Line 14: Line 14:
- Vehicle is always local where the driver is local
- Vehicle is always local where the driver is local


Knowing locality of a unit is very important as certain command only affect local units (see [http://community.bistudio.com/wiki/moveInDriver moveInDriver] for example).
Knowing locality of a unit is very important as certain command only affect local units (see [[moveInDriver]] for example).
Other commands have only local effect, nothing will be done outside of computer where the command was issued (see [http://community.bistudio.com/wiki/setFog setFog] for example).
Other commands have only local effect, nothing will be done outside of computer where the command was issued (see [[setFog]] for example).


A unit can change locality during its lifetime. Typical cases are a player dying (his squad AI units are passed to server), use of a [http://community.bistudio.com/wiki/join join] command, or units or players entering or exiting vehicles.
A unit can change locality during its lifetime. Typical cases are a player dying (his squad AI units are passed to server), use of a [[join]] command, or units or players entering or exiting vehicles.




[[Category: Scripting_Topics ]]
[[Category: Scripting_Topics ]]

Revision as of 18:58, 21 July 2006

Entities in OFP are handled, in multiplayer, by one computer alone, which sends updates about this entity to other computers connected to the MP game. A unit is said "local" when it is handled by the local computer.

To know if a unit is local, use the local script command.

The basic rules to determine locality are as follows:

- Player's character is of course local to player's PC

- AI units in a group whose leader is player are local to player's PC.

- All other AI units are local to server (may be player's PC, of course).

- Vehicle is always local where the driver is local

Knowing locality of a unit is very important as certain command only affect local units (see moveInDriver for example). Other commands have only local effect, nothing will be done outside of computer where the command was issued (see setFog for example).

A unit can change locality during its lifetime. Typical cases are a player dying (his squad AI units are passed to server), use of a join command, or units or players entering or exiting vehicles.