Arma 3 Scripting

Arma 3: Old Man Systems

  • Also known as Arma 3 Old Man Systems

Topic · Markdown · JSON · original wiki page

Arma 3 v1.98

Minimal Setup

Each scenario using any Old Man systems needs to contain this minimal setup:

#include "\a3\Missions_F_Oldman\Systems\commonDescription.inc"

Warning

The Old Man systems were created for singleplayer and are not likely to function in multiplayer.

Old Man Sector

This module was designed to optimize the performance of the scenario. It handles spawning and despawning of characters, vehicles and objects. It also handles several other functionalities in combination with other Old Man systems.

Technical Details

General Notes

Script Control

In some specific cases, you may want to control sector functionality by script. A few of the possible examples follow:

Manual Control

Turns on/off manual control of a sector (true - on, false - off)

[nameOfSector, true] call BIS_fnc_sectorSetManualControl;
Manual Sector Spawn

Forces a sector to spawn. Manual control of a sector needs to be set first.

[nameOfSector] spawn BIS_fnc_OM_sectorActivate;
Sector Status Control

Returns true / false based upon a sector having turned on/off manual control.

[nameOfSector] call BIS_fnc_sectorManualControl;
Sector Reset

Resets a sector back to its original state.

[nameOfSector, resetUnits, resetVehicles] call BIS_fnc_OM_sectorReset;

Old Man Restricted Area

Sometimes you may want to make a whole sector a restricted area. Or it may be just a part of it like a small military outpost or a house. In such cases restricted areas are handy.

Technical Details

Old Man Night

The Old Man Night module handles Day / Night changes in sectors.

Note

  • Keep in mind the sector needs to be despawned and spawned again to apply changes.
  • The Old Man Night module affects the closest Sector to the Old Man Night module position.

Technical Details

Old Man Init. Script

Do not use Init fields of characters to execute any code. This code will not be executed on character spawn. Use the Old Man Init. Script instead. This module can be synchronized with any character, object or module and the code placed in the Sector: Init script is executed every time when this character or object is spawned. Variable _this refers to the synchronized object. Multiple objects can be synchronized to one Old Man Init. Script module.

Old Man Relationship

This module handles the relationship between the player (as a civilian) and other factions in the game. The player character needs to be grouped to a soldier with 0% probability of presence on the BLUFOR side (if the potential enemy side is OPFOR) or OPFOR (if it is BLUFOR).

Technical Details

General Notes

Relationships are a quite complex system which is affected by player behavior, equipment and location. The distances, type of weapon and uniform are evaluated too. Some combinations – like complete CSAT Viper uniforms – are less suspicious than just a part of the uniform and enemies react to them slower, because they are not sure who the player is.

Script Control

Manually adding or lowering a threat:

[side, number] call BIS_fnc_OM_lowerThreat;
[side, number] call BIS_fnc_OM_lowerThreat;

Old Man Quest <Type>

The following descriptions are valid for all quest types introduced in Old Man:

Technical Details

CfgQuest

class SpecificQuestClass : QuestType // SpecificQuestClass is filled in the quest module
// Possible QuestTypes are: FetchQuest, GetQuest, SupportQuest, QuestHoldAction, QuestDefend, SyndikatTeamQuest, DestroyQuest, TransportQuest, TransportPersonQuest, HostageRescueQuest, LocationQuest
{
    // Quest description
    title = "Quest title";
      description[] = { "Quest description", _markerName }; // _markerName refers to a Smart Marker created on the quest position
    markerDescription = "Custom marker description";
    markerPicture = "\a3\Missions_F_Oldman\Data\img\Tooltip\T_SQ_T_TransportPlane_tooltip.paa"; // Path to a custom quest picture

    questNPC = "BIS_Miller";                 // NPC variable to which items can be delivered (FetchQuest) / NPC to transport (TransportPersonQuest) / NPC to untie (HostageRescueQuest)
       itemTypes[] = { "itemType1", "itemType2" }; // itemType, e.g. "O_NVGoggles_ghex_F"
    itemCount = 1;                             // How many items need to be delivered?

    // Only quest type QuestDefend
    delayToFailSec = 5;                        // Delay for how long can the enemy be present in the defended area before the quest fails
    timeoutFromStartInMinutes = 3;            // Time in minutes for how long the area needs to be defended

    parentTemplate = QuestParentName;         // Quest can be a child of a parent quest
    objectVariableName = "ObjectVariable";    // Variable for an object which needs to be delivered (TransportQuest only)
    iconType = "Default";                     // Type of marker created in the quest position (can be: Default, Fetch, Distraction, Defend, Support, Transport)
    className = "Plane";                     // Class name of a vehicle which needs to be transported (TransportQuest only)
    isMandatory = true;                        // If true, this marks the quest as mandatory. The parent quest can be finished only when all its mandatory children are finished. Other open children are canceled.

    // Quest smart marker
    class QuestSmartMarker : QuestSmartMarker
    {
          markerTitle = "";                    // Marker title text is shown on the map next to the Smart Marker
           markerTooltipTitle = "";            // Text in the header of the Smart Marker tooltip
           markerTooltipText = "";                // Smart Marker tooltip text
    };

    class StateModifiers : StateModifiers
    {
        // Possible State modifiers are: Created, Assigned, Progressing, Completed, Elapsed, Failed, Canceled
        class Created : Created
        {
            customCondition = "true";         // Code which needs to return true to allow execution of the state
            code = "";                         // Any code which is to be executed
            conversations[] = {};             // A conversation to play
        };
    };
};

CfgQuestParents

class ParentQuestName : ParentQuest    // ParentQuestName is the name of the Parent quest, filled in parentTemplate of each quest
{
    title =  "Parent Quest title";
    description[] = { "Parent Quest description" };
    iconType  = "default";                    // Icon of the Parent Quest
    cancelCondition = "MyCondition";        // Code which returns true / false. When true is returned, the parent quest with all its children is canceled.
};

Module Placement