rEXECVM is very powerful tool, but don't be "naive" -- it can give you headache too!
Required readings :
On the other hand, rEXECVM seems like a good tool, but it can create a mess as I demonstrated on this image.
Double trigger method is excellent method for bypassing locality and signaling that something should be executed globally, rather than locally. Often a signal is generated locally, rather than globally, so that's making communication between Dedicated server and clients sometimes really painful.
One way to do it is to combine double trigger method and rEXECVM.
- One trigger would send a by creating a new variable and sending it over network
- and the other trigger will catch that with !isNil "variable_name" and isServer condition and then executing some script via rEXECVM
If you use only rEXECVM...... well look at the bottom of the image... Every client could/will activate script on every other client + himself + server... by activating some trigger locally and sending request for global execution.
Now, this method is useful, but I didn't want to create so many triggers, so I made a new script.
You will see this file mentioned sandbox_exe.sqf.
Example: [nil,nil,rEXECVM,"WICT\sandbox\sandbox_exe.sqf","my\path\","someScript",0] call RE;
this will execute SQF script someScript.sqf from my\path\ folder => my\path\someScript.sqf and execution will be unique = Dedi friendly.
- this is Multiplayer framework variant of :
[nil,nil,rEXECVM ... is confirmed to work on Dedi
The first time the script is called it creates a variable and LOCKS any other execution!
Plus, the advantage is that you will execute that particular script on all clients, but you can also put blocks of code that will execute only on the server. What you write in that script will determine what happens next (and where - server, all clients, one client etc).
I did testings with diag log and showed in arma2.RPT that it is impossible to start the same script twice -- I repeated the call for the same script from init.sqf and it showed detection of double call, but script was executed only once.
I also made possible to restart ID and run some script again after some period of time. You just have to change number after script's name :
Example: [nil,nil,rEXECVM,"WICT\sandbox\sandbox_exe.sqf","my\path\","someScript",10] call RE;
so someScript.sqf will be available for execution after 10 seconds.