Fandom

武装突袭 Wiki

Multiplayer framework

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 Share

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。


Note: this page is a work-in-progress! More info to follow as soon as possible.

Introduction编辑

  • library of scripts that are performing non-global script commands globally on network
  • using publicVariable + addPublicVariableEventHandler (EH that fires for each publicVariabled variable on all clients - excluding calling client) + direct call on calling client
  • easy use: R-commands match function of single non-global scripting commands (eg. MPF 'rHINT' call is doing 'hint' on clients)
  • allows execution only on client where target object is local ("loc" switch)
  • allows persistent calls - are performed on JIP client even if server processed given MPF call before client connected to game ("per" switch)
 ! Do not use RE variable in your missions when using MPF. Do not use rHINT, rSIDECHAT etc. (see library below)

Remote script execution (RE)编辑

On all clients is public variable eventhandler that executes scripts that corresponds to less-than-100-percent-multiplayer-working script commands. One script for one commands, no string sending that will be compiled and executed for the sake of clarity and easiness of creating MP-friendly commands from the engine MP-unfriendly ones.

Function编辑

  1. Script remExWrite.sqf is called with parameters that says: who executes, upon who, [only where local and/or persistent], which scripted command and parameters for scripted command on target client follow
  2. remExWrite.sqf writes in public variable remExField
  3. Change in remExField triggers execution of eventhandlers on all clients in the network game (initialized in init.sqf), script remExServer.sqf interpretes remExField (remExFP resp.)
  4. (if wanted) remExServer.sqf calls script (given as argument) on client that runs even handler

Note: remote execution executes script also on calling client (if "loc" flag set, or "loc" not set and object is local on caller client)

Usage编辑

How-to编辑

  • Include functions module in your mission
  • Wait for global variable "BIS_MPF_InitDone" to be defined (and true):
waitUntil{!(isNil "BIS_MPF_InitDone")};
  • In scripts or fsms call: _handler = [...] call RE; (syntax - see below; RE stands for remote execution)

Format编辑

[nil_or_caller, nil_or_target_object,"loc", script_to_execute, par0, par1...] call RE;
[nil_or_caller, nil_or_target_object,"per", script_to_execute, par0, par1...] call RE;
[nil_or_caller, nil_or_target_object,"loc" + "per", script_to_execute, par0, par1...] call RE;
  • RE...remote execution (short for remExWrite.sqf)
  • "loc"...arbitrary parameter - executes remote script only on machine where nil_or_target_object is local
  • "per"...arbitrary parameter - executes remote script even on JIP client connectiong *after* this RE call was executed in MP game

Examples编辑

Hint on all clients currently connected to the MP game:

[nil,nil,rHINT,"Enjoy the game."] call RE;

Hint on all clients currently connected to the MP game + executed also on JIP client just after connection

[nil,nil,"per",rHINT,"Enjoy the game."] call RE;

Hint on client where object miles is local:

 [nil,miles,"loc",rHINT,"Miles is local here."] call RE;

Hint on client where number 0 from players group is local. If JIP client connects to this slot, he got also his msg displayed:

 [nil,(units group player) select 0,"loc" + "per",rHINT,"Hint."] call RE;

Multiple parameters

[objNull, BIS_Rodriguez , "per", rKBADDTOPIC, "armstrongs_speech",  "kb\armstrongs_speech.bikb",  ""] call RE;

- "kb\armstrongs_speech.bikb" becomes (_this select 1) in kbAddTopic.sqf library script

Implementation编辑

  • remExServer
  • remExWrite
  • library
  • custom library (division to library and custom library introduced in 1.03)

Library + custom Library编辑

  • library - functionality of single non-global scripting commands
  • custom library - enhanced functionality (eg. new parameters to scripting commands or more scripting commands triggered by one MPF call)
"move", 
"moveIn", 
"land", 
"addWPCur", //takes object and for his group on his local sets current WP
"animate", 
"setDate", 
"playmusic", 
"playsound", 
"switchmove", 
"playmove", 
"playmovenow", 
"playAction", 
"playActionnow", 
"switchAction", 
"hint", 
"hintC", 
"showCommandingMenu", 
"globalChat", 
"globalRadio", 
"sideChat", 
"sideRadio", 
"groupChat", 
"groupRadio", 
"kbAddTopic", 
"kbRemoveTopic", 
"kbtell", 
"kbreact", 
"deleteWP", 
"setWPdesc", 
"setWPtype", 
"createSimpleTask", 
"taskHint",
"createDiaryRecord", 
"removeAllWeapons", 
"addWeapon", 
"addWeaponCargo", 
"addMagazine", 
"addMagazineCargo", 
"clearMagazineCargo",
"clearWeaponCargo",
"endMission",
"failMission",
"titleCut", 
"titleText", 
"say", 
"playMusic", 
"switchCamera", 
"fadeMusic", 
"fadeSound", 
"addAction", 
"removeAction", 
"setCaptive", 
"setDir", //caution: works weird (often overwritten by server, tied to setpos)
"setObjectTexture",
"execfsm", 
"execfsm", 
"execVM", 
"spawn", 
"JIPrequest", //requesting JIP (RE persistent commands) from server by executing this via RE (on server) - parameter: logic local on client
"JIPexec", // custom scripting functions
"addAction", 
"skiptime", //bad
"setSimpleTaskDescription", 
"setSimpleTaskDestination", 
"setCurrentTask", 
"setCurrentTaskArrays", 
"createTaskSet",
"setTaskState",
"debugLog",
"enablesimulation"
"callVar" (1.03) - calls code that is stored in variable on client

更多维基

随机维基