Difference between revisions of "Arma 3: Curator"

From Bohemia Interactive Community
Jump to navigation Jump to search
m
m
Line 92: Line 92:
  
 
See [[Arma_3_CfgPatches_CfgVehicles|Arma 3 assets]] to check which objects belongs to which addon, or use [[unitAddons]] to get addons of specific object class.
 
See [[Arma_3_CfgPatches_CfgVehicles|Arma 3 assets]] to check which objects belongs to which addon, or use [[unitAddons]] to get addons of specific object class.
 +
 +
{{note|Only activated addons can be added (i.e., addons preloaded by the mission). All official addons are activated by default, but unofficial ones are activated only when an object contained in such addon is present in the mission. If that's not the case, you can use [[activateAddons]] or [[BIS_fnc_activateAddons]] to activate them. This is however possible only at the mission start - on the fly activation is not possible.}}
  
 
Initial addons can be adjusted in ''Game Master'' module attributes, with available values being:
 
Initial addons can be adjusted in ''Game Master'' module attributes, with available values being:
* '''All official addons''' - default state, includes all active addons (all official addons + unofficial addons used in the mission)
+
* '''All official addons''' - default state, includes all activeted addons
 
* '''Addons present in the mission''' - only addons of objects present in the mission upon mission start. E.g., if you inserted only BLUFOR soldiers and MRAPs in the mission, addons will be <nowiki>[</nowiki>[[Arma_3_CfgPatches_CfgVehicles#A3_Characters_F_BLUFOR|"A3_Characters_F_BLUFOR"]],[[Arma_3_CfgPatches_CfgVehicles#A3_Soft_F_MRAP_01|"A3_Soft_F_MRAP_01"]]]
 
* '''Addons present in the mission''' - only addons of objects present in the mission upon mission start. E.g., if you inserted only BLUFOR soldiers and MRAPs in the mission, addons will be <nowiki>[</nowiki>[[Arma_3_CfgPatches_CfgVehicles#A3_Characters_F_BLUFOR|"A3_Characters_F_BLUFOR"]],[[Arma_3_CfgPatches_CfgVehicles#A3_Soft_F_MRAP_01|"A3_Soft_F_MRAP_01"]]]
 
* '''None''' - no addons are enabled by the module, mission designer has to add them manually.
 
* '''None''' - no addons are enabled by the module, mission designer has to add them manually.
Line 107: Line 109:
 
  myCurator addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"];
 
  myCurator addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"];
 
  myCurator removeCuratorAddons ["A3_Soft_F_MRAP_01"];
 
  myCurator removeCuratorAddons ["A3_Soft_F_MRAP_01"];
 +
 +
Unofficial addons which are not present in the mission has to be activated
  
  

Revision as of 13:09, 18 February 2014

arma3 curator eye.png

Curator is a technical name for Arma 3 Zeus game master system. Every involved scripting command, event handler or class name contains the name. The reason for it is to have a generic name which can be passed from project to project without any associations.

Setup

The central piece of every curator is Game Master module, otherwise referred to as Curator Logic. It stores every setting, like editing areas, available objects or their costs.

You can find the module in Modules (F7) > Zeus > Game Master

In module arguments, can set the curator unit (either specific unit, player with given UID or server admin) and that's all you need to add game master to your mission. Without any further settings, all objects will be available for free and whole map will be editable.

In every examples on this page, we'll call the module myCurator.

Costs

Mission designer can assign cost to every object curator can interact with. The cost is applied when performing actions like placing, editing or deleting. It affects curator's resources - points - which are in range from 0 (no points) to 1 (full points; can't be larger than this value). The cost can be both negative and positive, so some actions can actually add points (e.g., deleting). Points can be adjusted by addCuratorPoints and returned using curatorPoints, or you can use Manage Resources module.

Points visualized in the curator interface


Assigning

Manual

You can assign individual cost for every object in the game using CuratorObjectRegistered event handler. It's executed when player enters curator interface, so individual values cannot be changed on the fly. However, you can still tweak costs using action coefficients and available objects by unlocking addons.


myCurator addEventHandler ["CuratorObjectRegistered",{...code here, see below...}];

Arguments passed into the handler are:

Expected returned value is an Array of Arrays of the same size as the input array, with each item belonging to a class with the same array index. Missing or incorrect values will be replaced by default [true,0,0].

  • Input: [string1, string2, string3, ... classN]
  • Output: [array1, array2, array3, ... arrayN]

Example:

  • Input (3 classes): ["B_Soldier_F", "B_MRAP_01_F", "ModuleLightning_F"]
  • Output (3 arrays with settings): [[true,0.1], [true,0.5,0.6], [false,0,0]]


Every item in the array is in the following format:

[show, cost, (costWithCrew)]
  • show: Boolean - true to let the object appear in the CREATE list, false to hide it (costs will still be accepted if an object of the type is already present in the mission and made editable)
  • cost: Number - cost of the object
  • costWithCrew (Optional): Number - cost of the object with crew in it (affects only vehicles). When undefined, normal cost is used.

Example of the whole event handler:

myCurator addEventHandler [
	"CuratorObjectRegistered",
	{
		_classes = _this select 1;
		_costs = [];
		{
			_cost = if (_x isKindOf "Man") then {[true,0.1]} else {[false,0]}; // Show only objects of type "Man", hide everything else
			_costs = _costs + [_cost];
		} forEach _classes; // Go through all classes and assign cost for each of them
		_costs
	}
];

Using Cost Tables

Alternatively, you can use scripting functions which will simplify cost settings:

Using Modules

Action Coefficients

Once you assigned cost to every object, you can now use it for every action curator can perform.

myCurator setCuratorCoef ["place",-0.2];

If some object, for example BLUFOR soldier "B_Soldier_F" from the previous example, will have assigned cost 0.1, cost for placing will be:

0.1 * -0.2 = -0.02

If curator have full points (value is 1), it means he can build 50 BLUFOR soldiers (-1 * -0.02 = 50). While individual object costs cannot be changed on the fly, coefficient can be easily used to tweak all costs.

Available actions are:

  • "place"
  • "edit"
  • "delete"
  • "destroy"
  • "group"
  • "synchronize"

Additionally, while action can be disabled by assigning large negative coefficient, e.g., -10000. Trying to perform the action will then result in onscreen warning for curator.

Coefficients can be also assigned in Set Editing Costs module.


Unlocking Addons

You can set which objects will be available curator by toggling specific addons. This can be done on the fly, and it's primary way how to unlock content for curator during a mission.

See Arma 3 assets to check which objects belongs to which addon, or use unitAddons to get addons of specific object class.

note

Initial addons can be adjusted in Game Master module attributes, with available values being:

  • All official addons - default state, includes all activeted addons
  • Addons present in the mission - only addons of objects present in the mission upon mission start. E.g., if you inserted only BLUFOR soldiers and MRAPs in the mission, addons will be ["A3_Characters_F_BLUFOR","A3_Soft_F_MRAP_01"]
  • None - no addons are enabled by the module, mission designer has to add them manually.

During the missions, use Manage Addons module or scripting commands to toggle addons:

Example:

myCurator addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"];
myCurator removeCuratorAddons ["A3_Soft_F_MRAP_01"];

Unofficial addons which are not present in the mission has to be activated


Editable Objects

Editing Areas

Camera Areas