### Server Manager Initialization and Deinitialization Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Discord.md Manages the setup and teardown of the server manager. The `dsm_initialize` function is responsible for starting the manager, while `dsm_deinitialize` handles its shutdown. ```sqf dsm_initialize = compile preprocessFileLineNumbers "host\Discord\ServerManager.sqf"; dsm_deinitialize = compile preprocessFileLineNumbers "host\Discord\ServerManager.sqf"; ``` -------------------------------- ### Player Setup Function Definitions (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Singleplayer.md Defines core functions for player setup, including getting current mobile unit, synchronizing camera and UI, setting header text, and validating player names. ```sqf // Function definition for begin_playerSetup_getCurMob ``` ```sqf // Function definition for begin_playerSetup_syncCamPos ``` ```sqf // Function definition for begin_playerSetup_syncUIRender ``` ```sqf // Function definition for begin_playerSetup_setHeaderText // Param: _txt ``` ```sqf // Function definition for begin_playerSetup_checkName // Param: _txtFirstNameInput // Param: _txtLastNameInput // Param: _startplay ``` -------------------------------- ### Start Interpolation Function Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/NOEngineClient.md This function initiates an interpolation process. It requires an owner identifier and a set of parameters. ```sqf /* File: client\NOEngineClient\NOEngineClient_Interpolation.sqf Line: 144 */ // noe_client_interp_start _owner, _paramsT ``` -------------------------------- ### Initialize Player Setup State Variables (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Singleplayer.md Initializes various state variables for the player setup process. These include flags for loading, rotation, and UI elements, as well as counters and data structures. ```sqf 0 ``` ```sqf false ``` ```sqf 0 ``` ```sqf [] ``` ```sqf true ``` ```sqf [widgetNull,widgetNull] ``` ```sqf [] ``` -------------------------------- ### Start Sound System Update Handler Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/SoundSystem.md Initializes the sound system's update mechanism by starting a recurring update function. This is crucial for managing real-time audio events and states. ```sqf startUpdate(music_internal_onUpdate,0) ``` -------------------------------- ### Start Variable Initialization (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/RVEngine/src.md Initializes a string variable `s` by formatting it with a given argument. This is a common pattern for building strings incrementally or setting initial values. ```sqf s = format(s, arg) ``` -------------------------------- ### Calculate Screen Start X Position Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/WidgetSystem.md A constant `STARTX` that calculates the starting X-coordinate on the screen, based on safe zone parameters. It's intended to represent a position on the screen. ```sqf (0 * safezoneW + safezoneX) ``` -------------------------------- ### Interact Grab Start Function Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/Interactions.md Function to initiate the grabbing process. It takes parameters: '_src', '_sidePos', '_vDir', and '_sideIdx'. ```sqf interact_grab_start = { params ["_src", "_sidePos", "_vDir", "_sideIdx"]; }; ``` -------------------------------- ### Initialize Player Setup Camera Positions (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Singleplayer.md Sets the initial camera positions for player setup in VR mode. Includes parameters for camera type, coordinates, zoom, field of view, and other rendering properties. ```sqf ["VR",[3606.11,3990.66,17.6511],300.021,0.42,[-31.6697,10.5583],0,0,8.47788e-05,0,1,1,0,1] ``` ```sqf ["VR",[3606.11,3990.66,17.6511],285.767,0.11,[-35.3376,10.5583],0,0,8.47788e-05,0,1,1,0,1] ``` -------------------------------- ### Calculate Projectile Start Point (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/ServerInteraction.md Internal implementation for calculating the starting point of a projectile. This function does not take explicit parameters from the provided snippet but is part of the ServerInteraction module. ```sqf interact_th_calculateStartPoint = { // ... implementation ... }; ``` -------------------------------- ### Initialize Last Started Scene Variable - SQF Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Singleplayer.md Initializes a string variable to store the name of the last started scene. This helps in tracking the current scene context. ```sqf sp_lastStartedScene = ""; ``` -------------------------------- ### Initialize BlastFX System (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/BlastFx.md Function to perform the initial setup of the BlastFX system. This likely involves loading configurations and preparing necessary resources. ```sqf ``` -------------------------------- ### ASP_BEGIN_SCOPE Macro for Profiling Start (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/host.md Marks the beginning of a profiling scope. This macro is used in conjunction with ASP_END_SCOPE when ASP_USE_PROFILING is defined. ```sqf private _asR__ = createProfileScope (name); ``` -------------------------------- ### Declare Fixture Setup with FIXTURE_SETUP Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/UnitTests.md The FIXTURE_SETUP macro declares a fixture setup routine. It takes the fixture name as a parameter and adds it to the list of setup routines to be executed before a test fixture starts. ```sqf ;_fRef = [ #fixtname ]; _fixtureStatesBegin pushback _fRef; _fRef pushback ``` -------------------------------- ### SDK Initialization and System Flag Checks Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Tools.md Functions and variables related to the initialization and configuration of the SDK. `sdk_isFirstLoad` is a variable to check if the SDK is loading for the first time. `sdk_init` is the main initialization function, while `sdk_internal_loadSDKConfig` handles loading configuration files. `sdk_getSystemFlags` and `sdk_hasSystemFlag` are used for managing system flags. ```sqf sdk_isFirstLoad // Initial value: isNull(sdk_firstLoadFlag) sdk_init sdk_internal_loadSDKConfig sdk_getSystemFlags sdk_hasSystemFlag ``` -------------------------------- ### Initialization Module Variables and Functions - SQF Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/OneSync.md Contains variables and functions for initializing the OneSync system. os_list_services defines the services to be initialized, such as 'falling', 'light', and 'steps'. os_isActive tracks the overall active state of the system. os_start and os_stop are functions to initiate and terminate the OneSync system, respectively. ```sqf os_list_services = ["falling","light","steps" /*,"mobcollision" Коллизия сломана*/]; os_isActive = false; os_start = {}; os_stop = {}; ``` -------------------------------- ### Function to Get Look At Coordinates Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Singleplayer.md The `cpt5_getLookAt` function calculates or retrieves look-at coordinates. It accepts optional start and end points, with default values provided if not specified. ```sqf /* Function definition for cpt5_getLookAt */ // Param: _start (optional, default ['0.0', '0.0', '0.0']) // Param: _end (optional, default ['0.0', '0.0', '0.0']) // Param: _default (optional, default [['0.0', '0.0', '0.0'], ['0.0', '0.0', '0.0']]) ``` -------------------------------- ### Get Side/Faction (Side Return) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Src/RVEngine/tools/unary_definitions.txt These nular functions return the side or faction of an entity or context. They are crucial for determining allegiance and controlling interactions between different groups in the game. Examples include Blufor, Civilian, and East. ```Nular static nular_function nular__blufor__ret__side; static nular_function nular__civilian__ret__side; static nular_function nular__east__ret__side; ``` -------------------------------- ### DiscordRPC Constants and Initialization Functions Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/DiscordRPC.md Defines constants like extname for the Discord RPC extension and provides functions for initializing, updating, and managing Discord Rich Presence. It includes methods for setting various game statuses and encoding strings. ```sqf extname callExtension ["UpdatePresence",[]] ``` ```sqf extname callExtension [_v,[_vl]] ``` ```sqf extname callExtension ["init",[getAppToken()]] ``` ```sqf (val call discrpc_encodeRu) ``` ```sqf createHashMap //в кодировке 1251 ``` ```sqf [...] ``` ```sqf // DiscordRPC_init.sqf // ... function definitions ... ``` ```sqf // DiscordRPC.h extname = "DiscordRichPresence"; ``` ```sqf // DiscordRPC.h getAppToken = {"817839824006414337"}; ``` -------------------------------- ### Get Sound Parameters (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/VoiceSystem.md Retrieves the current parameters of a sound effect by its ID. Requires the sound ID as input. ```sqf vs_audio_getSoundParams = { params ["_id"]; getSoundEffect _id; }; ``` -------------------------------- ### Start Transmission Function Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/VoiceSystem.md Initiates a voice transmission. It accepts frequency and code, with optional parameters for distance and current transmission type. ```sqf // Param: _freqAndCode // Param: _dist (optional, default vs_transmithDistance) // Param: _curT (optional, default "digital") ``` -------------------------------- ### Get All Entities (Array Return) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Src/RVEngine/tools/unary_definitions.txt These nular functions retrieve collections of various entities within the VR environment. They are useful for iterating over or querying specific types of game objects. Examples include all dead units, all players, and all display elements. ```Nular static nular_function nular__allDead__ret__array; static nular_function nular__allDeadMen__ret__array; static nular_function nular__allDisplays__ret__array; static nular_function nular__allGroups__ret__array; static nular_function nular__allMapMarkers__ret__array; static nular_function nular__allMines__ret__array; static nular_function nular__allPlayers__ret__array; static nular_function nular__allSites__ret__array; static nular_function nular__allUnits__ret__array; static nular_function nular__allUnitsUAV__ret__array; static nular_function nular__diag_activeMissionFSMs__ret__array; static nular_function nular__diag_activeSQFScripts__ret__array; static nular_function nular__diag_activeSQSScripts__ret__array; static nular_function nular__date__ret__array; static nular_function nular__fogParams__ret__array; static nular_function nular__get3DENMouseOver__ret__array; static nular_function nular__getArtilleryComputerSettings__ret__array; static nular_function nular__getDLCAssetsUsage__ret__array; static nular_function nular__getMousePosition__ret__array; static nular_function nular__getObjectViewDistance__ret__array; static nular_function nular__getResolution__ret__array; ``` -------------------------------- ### Function to Debug and Set Ready Settings (debug_setReadySettings) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/ServerSceneTest.md The 'debug_setReadySettings' function is designed for debugging purposes and involves starting an update process with a specific parameter. It utilizes the 'startUpdate' function. ```sqf startUpdate(_upd,1); ``` -------------------------------- ### Start Dialogue Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Singleplayer.md Initiates a dialogue sequence. It takes a dialogue data structure as input. This function is the entry point for managing in-game conversations. ```sqf sp_audio_startDialog = { params ["_dlg"] // This function would likely process _dlg and start the dialogue playback. // It might involve queuing dialogue lines, setting up voice actors, etc. // Placeholder for actual implementation: _dlg call compile preprocessFileLineNumbers "host\Singleplayer\singleplayer_audio.sqf" }; ``` -------------------------------- ### Core Initialization Utilities Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/OOP_engine.md Defines constants for core initialization processes, including a null class identifier and an error handling macro. It also includes a utility for setting object variables during initialization. ```sqf "" ``` ```sqf if (_iserror || server_isLocked) exitWith {error(mes); [mes] call logCritical} ``` ```sqf format["_thisobj setvariable ['%1',%2]; ",__name__system,__value__system] ``` -------------------------------- ### Get Config Objects (Config Return) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Src/RVEngine/tools/unary_definitions.txt These nular functions return configuration objects, providing access to game settings and parameters. They are used for reading and potentially modifying mission or system configurations. Examples include campaign config file and general config file. ```Nular static nular_function nular__campaignConfigFile__ret__config; static nular_function nular__configFile__ret__config; static nular_function nular__configNull__ret__config; ``` -------------------------------- ### Get Object References (Object Return) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Src/RVEngine/tools/unary_definitions.txt These nular functions return object references, allowing interaction with specific game objects or entities. They are fundamental for manipulating game elements, accessing their properties, and triggering actions. Examples include camera control and cursor targets. ```Nular static nular_function nular__cameraOn__ret__object; static nular_function nular__curatorCamera__ret__object; static nular_function nular__curatorMouseOver__ret__object; static nular_function nular__cursorTarget__ret__object; static nular_function nular__get3DENCamera__ret__object; ``` -------------------------------- ### BuildTools Client Build Function (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/Tools.md Declares the 'bt_buildClient' function within the BuildTools_init.sqf script, likely responsible for initiating the client build process. ```sqf /* Function definition for bt_buildClient */ ``` -------------------------------- ### Get String Values (String Return) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Src/RVEngine/tools/unary_definitions.txt These nular functions return string values, typically representing names, descriptions, or identifiers. They are used for displaying information, setting text-based properties, or referencing specific game elements by name. Examples include briefing name and camera view. ```Nular static nular_function nular__briefingName__ret__string; static nular_function nular__cameraView__ret__string; static nular_function nular__commandingMenu__ret__string; static nular_function nular__copyFromClipboard__ret__string; static nular_function nular__current3DENOperation__ret__string; ``` -------------------------------- ### Define and Use OOP Classes in SQF Source: https://context7.com/relicta-team/resdk_a3.vr/llms.txt Demonstrates defining a new class 'Mob' extending 'BasicMob' with variables, getters, methods, constructors, and destructors. It also shows how to instantiate, call methods on, access properties of, and delete objects. ```sqf // Define a new class extending BasicMob class(Mob) extends(BasicMob) // Class metadata for node editor "" name:Игровой персонаж desc:Игровая сущность, которым могут управлять клиенты. path:Игровые объекты.Сущности "" node_class // Variable declaration with default value var(activeHand, INV_HAND_L); var(mainHand, INV_HAND_L); var(connectedTo, nullPtr); var_str(face); // Getter function with automatic parameter handling getter_func(isConnected, not_equals(getSelf(connectedTo), nullPtr)); // Method definition func(getClassName) { objParams(); this getVariable PROTOTYPE_VAR_NAME getVariable "classname" }; // Constructor - called when object is created func(constructor) { INC(oop_cao); INC(oop_cco); }; // Destructor - called when object is deleted func(destructor) { DEC(oop_cao); }; endclass // Create new object instance private _mob = new(Mob); // Call method on object private _className = callFunc(_mob, getClassName); // Get/Set object properties private _hand = getSelf(activeHand); setSelf(activeHand, INV_HAND_R); // Delete object delete(_mob); ``` -------------------------------- ### Get Boolean Values (Bool Return) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Src/RVEngine/tools/unary_definitions.txt These nular functions return boolean values (true or false), indicating the state of various game features or conditions. They are essential for conditional logic, enabling or disabling features, and checking game states. Examples include bulldozer road diagnostics and cadet mode. ```Nular static nular_function nular__buldozer_IsEnabledRoadDiag__ret__bool; static nular_function nular__cadetMode__ret__bool; static nular_function nular__cheatsEnabled__ret__bool; static nular_function nular__dialog__ret__bool; static nular_function nular__didJip__ret__bool; static nular_function nular__difficultyEnabledRTD__ret__bool; static nular_function nular__freeLook__ret__bool; static nular_function nular__get3DENIconsVisible__ret__bool; static nular_function nular__get3DENLinesVisible__ret__bool; static nular_function nular__getRemoteSensorsDisabled__ret__bool; static nular_function nular__groupIconSelectable__ret__bool; ``` -------------------------------- ### Get Scalar Values (Scalar Return) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Src/RVEngine/tools/unary_definitions.txt These nular functions return single scalar values, such as numbers or booleans, representing various game states or configurations. They are used for checking conditions, retrieving numerical data, or accessing simple settings. Examples include armory points, benchmark results, and day time. ```Nular static nular_function nular__armoryPoints__ret__scalar; static nular_function nular__benchmark__ret__scalar; static nular_function nular__clientOwner__ret__scalar; static nular_function nular__currentChannel__ret__scalar; static nular_function nular__dayTime__ret__scalar; static nular_function nular__diag_fps__ret__scalar; static nular_function nular__diag_fpsmin__ret__scalar; static nular_function nular__diag_frameno__ret__scalar; static nular_function nular__diag_tickTime__ret__scalar; static nular_function nular__difficulty__ret__scalar; static nular_function nular__distributionRegion__ret__scalar; static nular_function nular__estimatedEndServerTime__ret__scalar; static nular_function nular__fog__ret__scalar; static nular_function nular__fogForecast__ret__scalar; static nular_function nular__getElevationOffset__ret__scalar; static nular_function nular__getShadowDistance__ret__scalar; static nular_function nular__getTotalDLCUsageTime__ret__scalar; ``` -------------------------------- ### Define start of event handler function EH_START Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/RVEngine/src.md The EH_START(x) macro defines the beginning of an event handler function. It takes a parameter 'x' and iterates through registered modules to execute the event handler if it exists. ```sqf void eventhandlers::x(game_value_parameter args_) { for (auto& module : extensions::get().modules()) { if (module.second.eventhandlers.x) module.second.eventhandlers.x ``` -------------------------------- ### Get Property Get Function Name (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/host.md Constructs the name of the function used to get a property. It appends '_get' to the provided variable name. ```sqf varname##_get ``` -------------------------------- ### Play 2D Sound with Options (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/VoiceSystem.md Plays a 2D sound effect with adjustable pitch, offset, volume, effects, and looping. Requires the sound path as input. ```sqf vs_audio_playSound2d = { params ["_soundPath", "_pitch", "_offset", "_vol", "_useEffects", "_loop"]; _pitch = _pitch default 1; _offset = _offset default 0; _vol = _vol default 1; _useEffects = _useEffects default true; _loop = _loop default false; playSE [_soundPath, _pitch, _offset, _vol, _useEffects, _loop]; }; ``` -------------------------------- ### Spawn Object (NOEngineClient) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/NOEngineClient.md Spawns an object on the client. It takes parameters for the object's reference, simplicity, model, position, direction, vector, and optional light, animation, and radio settings. ```sqf if (isNil "_radio") then {_radio = nil}; if (isNil "_anim") then {_anim = nil}; if (isNil "_light") then {_light = 0}; _obj = _model createVehicle _pos; _obj setDir _dir; _obj setVectorDirAndUp _vec; _obj setVariable ["_ref",_ref,true]; _obj setVariable ["_isSimple",_isSimple,true]; _obj setVariable ["_light",_light,true]; _obj setVariable ["_anim",_anim,true]; _obj setVariable ["_radio",_radio,true]; _obj ``` -------------------------------- ### Get Pointer Address in SQF Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/host.md Retrieves the address of a pointer. This function calls an internal routine to get the pointer's address. ```sqf ((p)call ptr_cts) ``` -------------------------------- ### Get Global Variable Macro Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/Rendering.md A macro to get a global variable from the mission namespace. It takes the variable name as input. ```sqf getGV = { params ["_var"]; (missionNamespace getVariable (_var)); }; ``` -------------------------------- ### Define Class Begin (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/host.md Initializes the definition of a new class. It sets up internal variables for class registration, fields, methods, and attributes. This macro is fundamental for defining new classes in the OOP system. ```sqf _decl_info___ = [__FILE__,__LINE__ + 1]; __testSyntaxClass private ["_class","_mother","_mem_name","_lastIndex","_lastIndexF","_fields","_methods"]; _class = name; _mother = "object"; [_class] call pc_oop_regClassTable; _fields = []; _methods = []; _attributes = []; _autoref = []; _editor_attrs_cls = []; call pc_oop_declareClassAttr; _editor_next_attr = []; _editor_attrs_f = []; _editor_attrs_m = []; _classmet_declinfo = createHashMap; _last_node_info_ = null; __interface_header_flag__ = null; private _pt_obj = [_class] call pc_oop_newTypeObj; ``` -------------------------------- ### Start Self Update (SQF) Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/host/host.md Initiates an update loop for the current object's method. It uses the 'startUpdateParams' function, providing the object's method, the standard update delay, and the object itself. This is used for self-updating objects. ```sqf startUpdateParams(getSelfFunc(method),STD_UPDATE_DELAY,this) ``` -------------------------------- ### Get Current Token Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/NOEngineClient.md Returns the token at the current 'tokenIndex' by calling the 'getToken' function. This is a convenience function to get the token at the active position. ```sqf getToken(tokenIndex) ``` -------------------------------- ### Get Widget Mode - SQF Source: https://github.com/relicta-team/resdk_a3.vr/blob/main/Documentation/API/client/Interactions.md Retrieves the 'mode' variable from a given widget. This is a constant used to get the mode of a UI element. ```sqf wid getVariable "mode" ```