OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Rubble_Maker on 24 Jan 2003, 14:05:58

Title: Commands in MP
Post by: Rubble_Maker on 24 Jan 2003, 14:05:58
Hi

Need to know if the following commands take effect on ALL machine or on the client which executes the command only:

   setdir
   setVelocity
   setpos
   drop
   RemoveWeapon
   RemoveMagazine
   SetFuel
   showCompass/Map/Radio&GPS...
   DeleteVehicle
   say
   inflame

thx
Title: Re:Commands in MP
Post by: Ranger on 24 Jan 2003, 18:15:11
All of those will affect all machines--host and clients--except maybe drop and say.  For those two, I'm not sure if they affect all machines--someone else will have to clarify.
Title: Re:Commands in MP
Post by: Rubble_Maker on 25 Jan 2003, 10:12:51
thx!

yes, someone else confirmed me on that; only drop and say is local.
Title: Re:Commands in MP
Post by: Rubble_Maker on 25 Jan 2003, 16:12:07
one more question tho: the "init" eventHandler currently runs on the client only (BIS might change that in a patch tho). How about the other eventhandlers, like "Fired" or "Damaged", are they local also?
Title: Re:Commands in MP
Post by: Ranger on 26 Jan 2003, 00:13:56
I don't know, but I would guess that those would have to be global.  Hopefully, someone else knows for sure.
Title: Re:Commands in MP
Post by: Stix on 27 Jan 2003, 01:38:04
one more question tho: the "init" eventHandler currently runs on the client only (BIS might change that in a patch tho). How about the other eventhandlers, like "Fired" or "Damaged", are they local also?

look in the com ref there are 2 more that are local rest are global
Title: Re:Commands in MP
Post by: Chris Death on 27 Jan 2003, 17:41:00
Well, about the mp-commands, and wether they are global
or local;

You can't lay a general rule on that, because it depends also
on the way of how you execute those commands. Also it
depends on the objects involved and on variables and how
the values of these variables were created.

e.g: setpos may look like a global command, but if you run
a script on each client to create random numbers, to specify
the coordinates, you may run into different results.

Let's say you want to setpos a marker (setmarkerpos), and
you predefined 3 locations where to setpos it. Now you run
a script, which creates a random number 1 2 or 3.
If this script runs on each client, there will be different result
which will cause different marker positions for each client.

So setpos/setmarkerpos can be global, if the coordinates are
equal, but the command is still executed local for each client.
If the coordinates don't match, the result doesn't either.

Say: might be also a local executed command, because if
you create a trigger with a radius, activated by anybody
present - onActivation: xxx say "xxx", only clients inside
the trigger area (where the trigger condition does match)
will be able to hear the SAYings.

deleteVehicle should be executed server side, or this even
could lead into a game crash.

Inflame: is also a local command - just try to light or clear
a fire and ask another player, if this did take effect on
his fire.

RemoveWeapon/RemoveMagazine should be global since
BIS fixed this in one of the patches.


I suggest you to test all this stuff by executing all these
commands server side only and then ask other players, if
they can see any effect of the commands.
If server side only execution still works for the clients, then
the command was executed global, if not  ;D

:edit - ah yeah and here's what BIS says about event handlers
in multiplayer:

Code: [Select]
MP notes: "Killed" and "Hit" event handlers are executed where given unit is local. All other event handlers are executed on all computers. Events added by addEventHandler may be different on each computer.

~S~ CD