Skip to content
Kex edited this page Jan 4, 2017 · 24 revisions

###Content:

  1. Note
  2. Restricting the module
  3. Build-in script arguments
  4. Global Variables
  5. Locality

###Note: This page is dedicated to the "Execute Code" module. This module allows you executing scripts and thus, also implementing Custom Modules.

###Restricting the module: The "Execute Code" module is very powerful for a Zeus with knowledge of scripting. With great power there also comes responsibility.
If you do not want to enable the module for anyone, you can block the module with the code below (local execution):

missionNamespace setVariable ['Ares_Allow_Zeus_To_Execute_Code', false, true];

You can either execute that line with the “Execute Code” module yourself or by adding the line below in your init.sqf in the mission folder:

If (local player) then
{
    missionNamespace setVariable ['Ares_Allow_Zeus_To_Execute_Code', false];
};

Note that the module will be still available for admins.

###Build-in script arguments: There are two arguments available for your script:

  • _this select 0    ARRAY     Returns position AGLS where the module was placed.
  • _this select 1    OBJECT    Returns ObjNull or the object on which the module was placed.

###Global Variables: You can assign a global variable to an object with the "Bind Variable to Object" module.
These variables are then available in the "Execute Code" module.

###Locality: The "mode" combo box allows specifying for which machines your script shall be executed:

  • local: only executes the code on your machine.
  • server: only executes the code on the server.
  • global: Executes the code on all machines (clients & server).
  • global & JIP: Executes the code on all machines (clients & server) and in addition for JIPs (since V.0.0.5).

Note that the module logic (icon on map) does not disappear if you include JIP. In the case you delete the module logic, your script will be removed from the JIP queue and thus it will no longer be executed for future JIPs.