Editors Depot - Mission Editing and Scripting > OFP - Editing/Scripting Multiplayer

Scripting Commands in MP

<< < (2/2)

Garcia:
The radio communication is only the chat with some sounds, basically. If you write "enableradio false" in the init.sqs in a SP mission, and then place a unit and makes him use sidechat (i.e unit1 sidechat "Look at my arse"), then you don't se it. However in multiplayer this just "blocks" the local messages.

I.e player A and player B plays a multiplayer mission with enableradio set to false in the init.sqs. Player A write in the sidechat "Player B, you fart". Player A won't see this, because it's locally and therefor blocked, but Player B will see it. Same goes the other way, if player B writes something, A sees it while B doesn't. Don't know how it is with AI (haven't played with AI and enableradio false in MP), if you will see the messages from them or not.

Igor Drukov:

--- Quote ---createVehicle - Global
createVehicle will create the desired vehicle on all machines, even if it's run locally on only one computer. Hence the command works best if it is run only on the server. Otherwise one vehicle will be created for each computer that participates in a MP mission. With a dedicated server and four players that would create 4+1=5 vehicles in game if the script is run on all machines.

--- End quote ---


Such a formulation is slightly misleading.

As often in MP, the way the command is issued is crucial to understanding the command's behaviour.

If you createVehicle something through a radio trigger, then the command will be executed on the server and on all clients, resulting in the creation of as many vehicles as computers in the game. Now if you check the locality of these vehicles, you'll see that each is local to the machine that's created it.


That's why I wouldn't say the command is global. On the contrary, it is local. Execute it locally (for instance through a script called by an action), one , and only one, object/vehicle, local to that particular client,  will be created. As to the related moveInXXXX commands, these will work if the issuer of the command, and the unit to be moved in driver/commander/gunner/cargo, are local to the same computer.

Chris Death:
I want add here that createVehicle can also be used in an addAction script.
Since the script behind addAction will be executed local only.

There's only one thing you need to check, since when comming close enough
to other units you can also execute addActions added to them:

A simple check if the script executioner is player, if not: exit, should do the trick.

If you assign the unit a variable name, you can publicVariable it to broadcast in
network.

:edit - uhm - i must have overseen the last part of Igor's post.  :whistle: :-[

~S~ CD

NoMore:

--- Quote ---hintC
I've never tested hintC (the one that requires clicking to unpause the game again) in MP.
--- End quote ---
It works just like you think. It comes up but the game does not pause. ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version