Jump to content

Search the Community

Showing results for tags 'functions'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
    • ARGO
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL


Jabber (xmpp)








Steam url id







PlayStation PSN














Found 11 results

  1. So I have made "script" for myself that I put in the Player Init. This only executes once. But I want it to execute every time I spawn/respawn (so everytime the player starts existing). The script works great if I put it in the Init of the Player. But i wanted to make a .sqf file I could call/execute so I wont have to put everything in every Player. But the scipt is not working/compiling. The code I put in to the Init: varPlayer=this; spawnPos=getPos varPlayer; telePos=getPos varPlayer; [varPlayer, 3] call BIS_fnc_traceBullets; varPlayer addAction["<t color='#59b300'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal;}]; varPlayer addAction["<t color='#d9006c'>Go to Spawn</t>", {varPlayer setPos spawnPos;}]; varPlayer addAction["<t color='#bfff00'>Teleport</t>", {varPlayer setPos telePos;}]; varPlayer addAction["<t color='#4cffff'>set Teleport</t>", {telePos=getPos varPlayer;}]; varPlayer addAction["<t color='#0080ff'>Teleport with Map</t>", "teleport.sqf"]; The code I put in to the .sqf: _spawnPos=getPos _this; _telePos=getPos _this; [_this, 3] call BIS_fnc_traceBullets; _this addAction["<t color='#59b300'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal;}]; _this addAction["<t color='#d9006c'>Go to Spawn</t>", {_this setPos _spawnPos;}]; _this addAction["<t color='#bfff00'>Teleport</t>", {_this setPos _telePos;}]; _this addAction["<t color='#4cffff'>set Teleport</t>", {telePos=getPos _this;}]; _this addAction["<t color='#0080ff'>Teleport with Map</t>", "teleport.sqf"]; How I called it in the Init: _nul = []execVM "myFunction.sqf"; It wont run, but why? So for short. What i need help with is: finding the problem with the sqf executing the sqf every time the player starts existing Thx for reading my crap and I hope you can help me. :)
  2. Hi there, It's quite annoying when someone else has used the gunner seat of a Heli, offsetting its position, and you later decide to Manual Fire from the pilot's seat and have a misaligned gun. I've been putting a lot of effort into setting up a script that can deal with this via a User Action, however I'm getting a few errors. A few of them are about missing " ) ", " ] ", " ; " (though I have done my best to never leave these out, including using a bracket checker plugin), or invalid variables (which is probably because it's checking a variable before it's set). To summarise, when a player pilot is in an armed Heli, they shall get a user action to centre the turret. This will have either the current AI or a temporary, invisible AI in the gunner seat target a spawned marker in front of the vehicle (if a player is in the seat it won't affect them). I currently have five six files in relation to this. EDIT: Below has been updated to the latest working script - If you get errors make sure there's no invisible characters using Word It requires CBA mission.Malden\init.sqf mission.Malden\description.ext mission.Malden\functions\functions.hpp mission.Malden\functions\fn_centreTurret.hpp mission.Malden\functions\fn_allowCentreTurret.sqf mission.Malden\functions\fn_turretDir.sqf Currently, unit spawning, marker generation and AI watching are working as intended, however the user action does not appear and if i set off turretdir.sqf manually ( [] execVM "turretdir.sqf"; ) it errors. EDIT: All working as intended. I'm not as proficient at SQF scripting as I'd like to be, so I've probably made some very obvious mistakes. Any help setting this up correctly and optimising would be appreciated. I will keep trying in the meantime.
  3. Last content update: 6/13/2018 showing how to use the radius for addAction, using params instead of select, adding to arrays with various commands, altering arrays with various commands, get/setUnitLoadout Last content update: 6/10/2018 going through config files and getting details to sort what you want, using radius with addAction, params, and altering arrays with resize, pushBack, pushBackUnique, set, and append and going over to assist with resize count. Last content update: 5/27/2018 added GUI tutorial for how to make a weapon selector using cfgWeapon Last content update: 5/24/2018 added sector control tutorial Last content update: 5/21/2018 This is my arma 3 scripting tutorial series which is aimed to help both people getting into making their own scripts with fairly detailed simple tutorials as well as for the intermediate person looking to create their own features for their missions. The plans for this series is to almost fully cover everything behind the arma 3 missions that people play on a daily basis and have enough content provided in the videos where people can go off and make their own vision for their mission with the knowledge gained. Most of these videos are made on the fly at 1AM-4AM without any pretesting which should give someone the idea of what goes into finding syntax errors and narrowing down a bug that's causing your feature to not function properly. It is also an excuse for you to cut me some slack if you see mistakes :) . A lot of these tutorials are made with multiplayer in mind since I think most people want to play their missions online with their friends(which is why publicVariable has been utilized so much so new people can get a good grasp on the power those commands have). New videos are added to the playlist almost every day so if your stuck with something, maybe it has been covered in a video. If you have any requests on what you would like to see made then please suggest it here. topics covered so far Scripting tutorial playlist Database tutorials with INIDBI2 playlist GUI/Dialog tutorials playlist
  4. RED FRAMEWORK A collection of useful functions for mission maker. Website under construction: http://www.redframework.com Version: 1.0.9 Release date: 11-03-2018 WORKSHOP: https://steamcommunity.com/sharedfiles/filedetails/?id=1226877632 GITHUB: https://github.com/RedBelette/RED_FRAMEWORK LICENSE: https://github.com/RedBelette/RED_FRAMEWORK/blob/master/LICENSE MISSION TEMPLATE (take it for a quick start !) https://github.com/RedBelette/RedFramework-Simple-Template https://github.com/RedBelette/RedFramework-TGV-Template INITIALIZATION - Voice is disabled for players (just for ingame recorded speeches, not VOIP). - Saving is disabled. FUNCTIONS ace improvements // This feature allows you to use a huntir ammo as a satellite that you can later use via ACE's huntir monitor. _huntirAmmo = [satellitePos] call RF_fnc_huntirSatellite; Action mecanism Trigger (by script) in arma are very useful but contain a lot of code to do something. We need to create new paradigm to replace it and to enhanced the behavior. We need an action mechanism. An action is to execute something when the condition is true. In more we can specify if the action is a one shot or in a loop. Maybe you want that the action is timed also. By creating a registry of action we can start and stop an action. // This function acts as a trigger and executes code when a condition is true. _action = [_condition, _codeAsString, _params(*default=[])] call RF_fnc_action; // This function acts as a trigger and executes code when a condition is true with a delay time. _action = [_condition, _codeAsString, _delayAsSecond, _params(*default=[])] call RF_fnc_delayedAction; // This function acts as a trigger and executes code every x seconds. _action = [_condition, _codeAsString, _timeToTheNextExecutionAsSecond, _params(*default=[])] call RF_fnc_repeatedAction; // This function acts as a trigger and executes code when a condition is true on the targeted remote side. _action = [_condition, _codeAsString, _params(*default=[]), _target(*default=0)] call RF_fnc_remoteAction; // This function acts as a trigger and executes code when a condition is true with a delay time on the targeted remote side. _action = [_condition, _codeAsString, _delayAsSecond, _params(*default=[]), _target(*default=0)] call RF_fnc_remoteDelayedAction; // This function acts as a trigger and executes code every x seconds on the targeted remote side. _action = [_condition, _codeAsString, _timeToTheNextExecutionAsSecond, _params(*default=[]), _target(*default=0)] call RF_fnc_remoteRepeatedAction; // This function opens a register of actions, allowing you to start or stop an action. call RF_fnc_actionRegistry; // The RF_fnc_actionRegistry function needs to be called beforehand to open an action register. _action = [_actionIdAsString, _actionAsReturnedAction] call RF_fnc_addAction; // This function allows you to find an action in the action register. _action = [_actionIdAsString] call RF_fnc_getAction; // Activate the action from the action register. [_actionIdAsString] call RF_fnc_runAction; // Desactivate the action from the action register. [_actionIdAsString] call RF_fnc_stopAction; // Remove action from the action register. [_actionIdAsString] call RF_fnc_unregisterAction; Ai behavior // Surrender occurs when the remaining units of the desired faction are below the desired minimum number. _trueOrFalse = [_side, _minUnitsToSurrenderTheSide] call RF_fnc_makeSideSurrender; // Order the entire faction to defend an area around a radius. [_side, _position, _radius] call RF_fnc_sideDefendArea; Ambience // Flash on the desired area (like zeus). [_position, _delay(*default:0)] call RF_fnc_lightningBolt Animation // Play a looping animation with the playMove instruction [_unit, _animClassName] call RF_fnc_playMoveLoop; Condition // Check if the unit is inside a vehicle _trueOrFalse = [_unit] call RF_fnc_isInVehicle; // Checks if a player is close to an entity following a radius _trueOrFalse = [_entity, _radius] call RF_fnc_isPlayerNearEntity; Converter // Convert string on side ojbect _side = [_sideAsString] call RF_fnc_convertSideStr; Heli control // Initialize a helicopter so that it stays quietly on the ground. [_group] call RF_fnc_heliInit; // Order the helicopter to land in the desired area. [_group, _position] call RF_fnc_landHeli; // Send the helicopter to fight. [_group, _position, _radius] call RF_fnc_sendHeliToFight; // The helicopters unload the units present in an area and then disappear. [_vehicle, _landingPosition, _getOutPosition] call RF_fnc_unloadUnitsWithHeli; Init // This function allows you to wait for the end of the loading screen. call RF_fnc_loadingComplete; waitUntil {loadingFinished}; Layer // Enable 3den editor layer. [_layerIdAsString] call RF_fnc_enableLayer; // Disable 3den editor layer. [_layerIdAsString] call RF_fnc_disableLayer; Mission generator This engine offer to you a complete engine to manage tasks and missions. You have a completer CRUD fort the task to create, changing state, close or remove it. You can also generate a random mission with a little configuration from description.ext. // Creates a new mission in the framework and generates an Arma task. This task may not be visible to players. _missionIdUnique = [_missionIdAsString, _side, _parentMissionIdAsString, _title, _description, _taskType(*default="default"), _taskDestination(*default=objNull), _taskSetCurrent(*default=false), _taskPriority(*default=0), _taskNotification(*default=true), _taskSharing(*default=false)] call RF_fnc_createMission; // Closes the mission identified by the missionID passed in parameter. By default, the status of the mission will be successful and an alert will be displayed. [_missionIdAsString, _taskStatus(*default="SUCCEEDED"), _taskShowHint(*default=true)] call RF_fnc_closeMission; // Returns true when the mission is closed. _trueOrFalse = [_missionIdAsString] call RF_fnc_isMissionClosed; // Return the task state of the mission _taskStatus = [_missionIdAsString] call RF_fnc_missionState; // Returns all the cities of the map. _locations = call RF_fnc_locations; // Return a random location of the map. _randomLocation = call RF_fnc_locationGenerator; // Generate a random mission based on the description.ext. (see config on the bottom) _missionIdUnique = call RF_fnc_missionGenerator; // Generates an example mission based on the condig file or past parameters. _missionIdUnique = [_side(*default=config), _helicopterClassName(*default=config), _unitsClassNameArray(*default=config)] call RF_fnc_spawnMissionHelicopterCrashInTown; Spawn // Create units. _group = [_side, _unitsClassNameArray, _position] call RF_fnc_spawnUnits; // Create garrisons around an area based on the description.ext or parameters. _allGroups = [_position, _radius(*default=config), _side(*default=config), _unitsClassNameArray(*default=config), _randomDistance(*default=config)] call RF_fnc_spawnGarrison; // Create patrols around an area based on the description.ext or parameters. _allGroups = [_position, _radius(*default=config), _side(*default=config), _unitsClassNameArray(*default=config), _radiusPatrols(*default=config)] call RF_fnc_spawnCirclePatrols; // Create a helicopter and teleport the group inside to the desired position. After landing the helicopter drops off the group, returns to its starting position and disappears. [_groupWillTeleportedInsideHeli, _spawnPosition, _landingPos, _heliClassName(*default="B_Heli_Light_01_F"), _side(*default=west), _driverClassName(*default="B_Helipilot_F")] call RF_fnc_spawnByHeli; Spectator // This script will allow you to create the spectator's mode. (config acre and tfar inside) call RF_fnc_spectator; // Add an action into object to enter spectator mode [_object] call RF_fnc_addSpectatorAction; Ui // Displays an image in full screen for a given time. [_imagePath, _timeInSecond] call RF_fnc_imageFullScreen; // Displays an image in full screen in the sky during a given time. [_imagePath, _timeInSecond] call RF_fnc_imageInSky; // Simplify the code to create a progress bar. [_object, _progressBarId, _titleAction, _titleBar, _codeAsString, _cancelCodeAsString, _parametersToTheCode, _timeInSecond, _actionType(*default=0), _actionParent(*default="ACE_MainActions"), _actionIcon(*default="")] call RF_fnc_progressBar; // Displays the name of the scenario and its author at the bottom right. [_missionName, _byAuthor] call RF_fnc_scenarioTitle; Vehicle // Charge a group of players in the cargo of a vehicle. The basic moveInCargo instruction is defective in MP. [_group, _vehicle] call RF_fnc_moveInCargo; Zeus // Allows zeus to modify all new spawner units by script. call RF_fnc_makeAllUnitsEditableForAllCurators; // Allows to make editable all the objects passed in parameter. [_objectArray] call RF_fnc_makeObjectsEditableForAllCurators; Zombie /* * The mod zombie Ryan's spawner module seems to pose performance * concerns in MP so here is a spawner optimize. * * Parameters * side: west, east, ... * gameLogic: gameLogic module * numberByWave: number of Z max spawned by wave. * time: delay between wave * type: (default: mediumCivilian) * - fastCivilian * - fastSoldier * - fastCivilianAndSoldier * - mediumCivilian * - mediumSoldier * - mediumCivilianAndSoldier * - slowCivilian * - slowSoldier * - slowCivilianAndSoldier * - walkerCivilian * - walkerSoldier * - walkerCivilianAndSoldier * - demon * - spider * - brittleCrawler * - mixedZombie * - mixedZombieNoSpiderNoCrawler */ [_side, _gameLogic, _numberByWave, _time, _type(*default:'mediumCivilian')] call RF_fnc_zSpawner Configuration in description.ext (optional) // Example class RedFrameworkConfig { class missionCfg { addItemEarPlugs=true; putInEarPlugs=true; putSafeMode=true; }; class MissionGenerator { missionPaths[] = { // HERE THE PATH OF YOUR MISSION "pathofmission1.sqf", "pathofmission2.sqf" }; }; class combatPatrol_CfgEnemis { side = "east"; // HERE THE DEFAULT SIDE }; class combatPatrol_SpawnCirclePatrols { // HERE THE FUNCTION DEFAULT VALUES distance = 200; unitTypes[] = {{"LOP_US_Infantry_SL", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_TL"}, {"LOP_US_Infantry_MG_2", "LOP_US_Infantry_MG_Asst"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_MG_Asst", "LOP_US_Infantry_MG_2"}}; radiusPatrols[] = {50, 100, 200}; }; class combatPatrol_SpawnGarrison { // HERE THE FUNCTION DEFAULT VALUES distance = 100; unitTypes[] = {{"LOP_US_Infantry_SL", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_TL"}, {"LOP_US_Infantry_MG_2", "LOP_US_Infantry_MG_Asst"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_MG_Asst", "LOP_US_Infantry_MG_2"}}; ramdomizeDistance = 80; }; class combatPatrol_missions { class combatPatrol_helicopterCrashInTown { // HERE THE FUNCTION DEFAULT VALUES helicopterClass = "B_Heli_Light_01_dynamicLoadout_F"; unitTypes[] = {{"LOP_US_Infantry_SL", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_TL"}}; }; }; }; CHANGELOG ## 05-02-2018 version 1.0.1 - ADD RF_fnc_moveInCargo - FIX RF_fnc_spawnByHeli with the new move in cargo (MP fail) ## 05-05-2018 version 1.0.2 - FIX RF_fnc_moveInCargo: brute force moveInCargo with infinite loop protection ## 05-10-2018 version 1.0.3 - ADD RF_fnc_lightningBolt to flash on desirated area. - ADD RF_fnc_spectator create the spectator's mode on client - ADD RF_fnc_addSpectatorAction to addAction your object with the previous spectator's function. - ADD RF_fnc_zSpawner to spawn Zombie and Demons with more performance in MP ## 05-10-2018 version 1.0.4 - ADD Configure your mission with features: add and put earplugs, security safemod for weapons. // Example description.ext: class RedFrameworkConfig { class missionCfg { addItemEarPlugs=true; putInEarPlugs=true; putSafeMode=true; }; }; ## 05-13-2018 version 1.0.5 - FIX counter variable's name mistake, '_' missing CHANGELOG version 1.0.6 ## 05-20-2018 - HOTFIX: Resolve default value on the init - HOTFIX: Partial hotfix for RF_fnc_moveInCargo and RF_fnc_spawnByHeli CHANGELOG version 1.0.7 ## 06-02-2018 - ADD capabilities to recieve code instead string for the executed job. - ADD capabilities to recieve parameters - ADD remote action for all the types of actions see action mecanism for more details ## 07-15-2018 version 1.0.8 - FIX when you try to configure earPlug with description.ext ## 11-03-2018 version 1.0.9 - FIX move in cargo for MP
  5. Hello. I am working on a mission on Lythium and I am wondering about the functions used in Combat Patrol for garrisoning buildings and spawning random objectives. It would be nice if there was a way to use these in any mission by referencing code functions. Is there a way to do this? It would be a cool way to spawn a side mission using the Combat Patrol functions. And as they are BI built-in functions, they would be fast and reliable. Is this possible? Thanks.
  6. Afternoon all, I'm after a bit of advice with calling postinit and preinit functions from a mod. I've created a mod which is basically a functions library. I have one rather inconvenient issue. My Postinit and preinit functions execute on Arma 3 start, for example: I have dynamic text appearing on the main menu, which whilst amusing, isn't particularly professional. My question: How do I execute postinit and preinit functions only on Mission start when called within a @mod? Thanks in advance!
  7. Hey guys! I come across a mean issue where I am not able to use the function configuration that works for my addon-test mission in my packed addon.pbo. Erros in .rpt on startup 15:20:01 Warning Message: Script camp\fn_buildCampsite.sqf not found 15:20:01 Warning Message: Script camp\fn_packCampsiteItem.sqf not found 15:20:01 Warning Message: Script init\fn_init.sqf not found 15:20:01 Warning Message: Script init\fn_backpackInit.sqf not found 15:20:01 Warning Message: Script utils\fn_log.sqf not found .pbo file structure CfgFunctions.hpp class CfgFunctions{ class ReconMod{ class Camp{ file = "camp"; class buildCampsite {}; class packCampsiteItem {}; } class Init{ file = "init"; class init{preInit = 1;}; class backpackInit {}; } class Utils{ file = "utils"; class log{}; } } } CfgPatches.hpp class CfgPatches { class ReconMod { author = "xetra11"; name = "Recon Mod"; version = "1.0"; units[] = {}; weapons[] = {}; requiredVersion = 1.0; requiredAddons[] = {}; }; }; config.cpp #include <CfgFunctions.hpp> #include <CfgVehicles.hpp> #include <CfgPatches.hpp> Did I miss a part where it says to have functions work in an addon I have to go another way of declaring functions? Thanks for your help in advance!
  8. Alright. Welcome everyone. I have a very interesting problem, and I couldn't find a solution for it. I have been really trying to get past this but I can't solve this riddle. I have this small code snippet inside the initPlayerLocal.sqf: if (didJIP) then { [getPlayerUID player] remoteExecCall ["CHAB_fnc_jipcam",[-2,-(clientOwner)],false]; }; And here is the CHAB_fnc_jipcam: _uid = _this select 0; private "_player"; private "_local"; private "_localID"; { if ((getPlayerUID _x) isEqualTo _uid) then{_player = _x;}; } forEach allPlayers; _local = ???; _localID = ???; As you can see, I clearly have no clue who is the owner of machine ? In my mind's eye remoteExec sends a message to every player that they have to run this script with the given parameters. Here is what I tried so far: Create a global variable (not public) for each player and give it the playerUID -> Result is that inside the jipcam the returned value is "any" on each PC. Create a missionnamespace variable (global but not public) and give it the playerUID -> same results as before I have completely run out of ideas, I tried mostly everything I could think of. Is there anyone who has more tricks up his sleeve?
  9. Hello. I am using this script to get all the cities into an array, then make a marker on them. 95% of the time it works, and then rarely it just creates a marker at [0,0,0] and then the script is just useless. Help, please. tasknumber = ["task1","task2","task3", etc ... ]; publicVariable "tasknumber"; publicVariable "current_tasknumber"; publicVariable "current_task"; cities = nearestLocations [getPosATL officer_jeff, ["NameCity"], 25000]; publicVariable "cities"; _city = cities call BIS_fnc_selectRandom; _citypos = locationPosition _city; _citymarker = createMarker ["citymarker", _citypos]; current_taskmarker = _citymarker; current_tasknumber = tasknumber call BIS_fnc_selectRandom; [west,[current_tasknumber],["Clear out the area","Clear out",current_task],[0,0,0],true,2,true,"attack",true] call BIS_fnc_taskCreate; [current_tasknumber,current_task]call BIS_fnc_taskSetDestination; [current_tasknumber]call BIS_fnc_taskSetCurrent; ....spawn enemies etc ...
  10. With @Larrow's assistance, I was able to hash out the program I wanted to manage my soldiers with addAction menus. I will create a mod thread when I have the vehicle assignment actions added. Full script: myGrps = []; myGrps resize 10; myGrps = myGrps apply { [ grpNull ] }; TAG_fnc_hasBlankHC = { _bool = false; { _x params[ "_HCGrp", "_HCActionID" ]; if ( isNull _HCGrp ) exitWith {_bool = true;}; }forEach myGrps; _bool; }; TAG_fnc_isLastHCMan = { _bool = false; { _x params[ "_HCGrp", "_HCActionID" ]; if (( Group cursorTarget isEqualTo _HCGrp ) && {{ alive _x }count units _HCGrp isEqualTo 1}) exitWith {_bool = true;}; }forEach myGrps; _bool; }; TAG_fnc_JoinFunction = { _unit = _this select 0; _grp = _this select 1; _str = _this select 2; //accepting variable "unit or from Group" and "target group" if (_str == "unit") then { [_unit] joinSilent _grp; }else { { [ _x ] joinSilent _grp; }forEach units _unit; }; _leader = Leader _grp; { if(!(_leader isEqualTo _x) && {(rankId _x) > (rankId _leader)}) then { _leader = _x; }; }forEach units _grp; _grp selectLeader _leader; }; TAG_fnc_createNewHCGroup = { params[ "_unit", [ "_create", true ], [ "_wholeGroup", false ] ]; _CompanyNames = ["CompanyXray","CompanyNovember","CompanyNovember","CompanyNovember","CompanyNovember","CompanyWhiskey","CompanyWhiskey","CompanyWhiskey","CompanyWhiskey","CompanyXray"]; _PlatoonNames = ["Platoon1","Platoon1","Platoon1","Platoon2","Platoon2","Platoon1","Platoon1","Platoon2","Platoon2","Platoon1"]; _SquadNames = ["Squad1","Squad1","Squad2","Squad1","Squad2","Squad1","Squad2","Squad1","Squad2","Squad2"]; { _x params[ "_HCGrp", "_HCActionID" ]; if ( !isNull _HCGrp && { { alive _x }count units _HCGrp isEqualTo 0 } ) then { deleteGroup _HCGrp; player hcRemoveGroup _HCGrp; if ( _HCActionID isEqualType 0 ) then { player removeAction _HCActionID; }; myGrps set [ _forEachIndex, [ grpNull ] ]; _HCGrp = grpNull; }; if ( _create && { isNull _HCGrp } ) then { private [ "_group" ]; if !( isPlayer _unit ) then { _group = createGroup side player; }else{ _group = group player; }; _group setGroupIdGlobal [ "%GroupNames %GroupCompany %GroupPlatoon-%GroupSquad", "Yankee", _CompanyNames select _forEachIndex, _PlatoonNames select _forEachIndex, _SquadNames select _forEachIndex ]; if !( _unit in units _group ) then { _oldGroup = group _unit; if ( _wholeGroup ) then { units _oldGroup joinSilent _group; }else{ [ _unit ] joinSilent _group; }; if ( count units _oldGroup isEqualTo 0 ) then { deleteGroup _oldGroup; }; }; _actionID = if !( isPlayer _unit ) then { player hcSetGroup [ _group ]; [ _group ] call TAG_fnc_joinHCGroup; [ _group ] call TAG_fnc_groupJoinHCGroup; }else{ objNull; }; myGrps set [ _forEachIndex, [ _group, _actionID ] ]; _create = false; }; }forEach myGrps; }; TAG_fnc_grpJoinMe = { player addAction [ "Group Join Me", { cursorTarget setCaptive false; {[ _x ] joinSilent group player;}forEach units group cursorTarget; [ objNull, false ] call TAG_fnc_createNewHCGroup; }, [], 1, false, true, "", " !(isnull cursortarget) && (_this isEqualTo _target) && { (cursorTarget isKindof 'Man') && { (alive cursortarget) && { ( side cursortarget isEqualTo side player || captive cursorTarget ) && { (leader group cursorTarget isEqualTo cursorTarget) && { ({alive _x} count units group cursorTarget > 1) && (({ alive _x } count units group cursorTarget) + ({ alive _x } count units group player) < 12) } } } } }" ]; }; TAG_fnc_joinMe = { player addAction [ "Join Me", { cursorTarget setCaptive false; [ cursorTarget ] joinSilent group player; [ objNull, false ] call TAG_fnc_createNewHCGroup; }, [], 1, false, true, "", " !(isnull cursortarget) && _this isEqualTo _target && { cursorTarget isKindof 'Man' && { alive cursortarget && { ( side cursortarget isEqualTo side player || captive cursorTarget ) && { !(group cursortarget isEqualTo group player) && { ({ alive _x } count units group player < 12) } } } } }" ]; }; TAG_fnc_groupJoinHCGroup = { params[ "_HCGrp" ]; _actionID = player addAction [ format [ "Group Join %1", groupID _HCGrp ], { params[ "_target", "_caller", "_ID", "_args" ]; [ Group cursorTarget, _args, "" ] call TAG_fnc_JoinFunction; if (Group cursorTarget in myGrps) then { [ objNull, false ] call TAG_fnc_createNewHCGroup; }; }, _HCGrp, 1, false, true, "", format [" _group = %1 call BIS_fnc_groupFromNetId; !(isnull cursortarget) && (_this isEqualTo _target) && { (cursorTarget isKindof 'Man') && { (alive cursortarget) && { ( side cursortarget isEqualTo side player || captive cursorTarget ) && { (call TAG_fnc_hasBlankHC) && { !(Group cursorTarget isEqualTo _group) && { !(Group player isEqualTo _group) && { (leader group cursorTarget isEqualTo cursorTarget) && { ({ alive _x } count units (group cursorTarget) > 1) && { ({ alive _x } count units (_group) > 0) && (({ alive _x } count units (_group)) + ({ alive _x } count units cursorTarget) < 12) } } } } } } } } }", str ( _HCGrp call BIS_fnc_netId ) ] ]; _actionID; }; TAG_fnc_joinHCGroup = { params[ "_HCGrp" ]; _actionID = player addAction [ format [ "Join %1", groupID _HCGrp ], { params[ "_target", "_caller", "_ID", "_args" ]; [ cursorTarget, _args, "unit" ] call TAG_fnc_JoinFunction; [ objNull, false ] call TAG_fnc_createNewHCGroup; }, _HCGrp, 1, false, true, "", format [ " _group = %1 call BIS_fnc_groupFromNetId; !(isnull cursortarget) && _this isEqualTo _target && { cursorTarget isKindof 'Man' && { alive cursortarget && { ( side cursortarget isEqualTo side player || captive cursorTarget ) && { !(group cursortarget isEqualTo _group) && { ({ alive _x } count units (_group) > 0) && ({ alive _x } count units (_group) < 12) } } } } }", str ( _HCGrp call BIS_fnc_netId ) ] ]; _actionID }; TAG_fnc_HCActions = { player addAction [ "Unit to HC Group", { [ cursorTarget, true ] call TAG_fnc_createNewHCGroup; }, [], 1, false, true, "", " !(isnull cursortarget) && _this isEqualTo _target && { cursorTarget isKindof 'Man' && { alive cursortarget && { ( side cursortarget isEqualTo side player || captive cursorTarget ) && { (call TAG_fnc_hasBlankHC) } } } }" ]; player addAction [ "Group to HC Group", { [ cursorTarget, true, true ] call TAG_fnc_createNewHCGroup; }, [], 1, false, true, "", " !(isnull cursortarget) && _this isEqualTo _target && { cursorTarget isKindof 'Man' && { alive cursortarget && { ( side cursortarget isEqualTo side player || captive cursorTarget ) && { !(hcLeader Group cursorTarget isEqualTo player) && { (call TAG_fnc_hasBlankHC) && { leader group cursorTarget isEqualTo cursorTarget && count units group cursorTarget > 1 } } } } } }" ]; player addAction [ "Dismiss HC Group", { player hcRemoveGroup group cursorTarget; { _x params[ "_group", "_action" ]; if ( _group isEqualTo group cursorTarget ) exitWith { player removeAction _action; player hcRemoveGroup _group; myGrps set [ _forEachIndex, [ grpNull ] ]; }; }forEach myGrps; }, [], 1, false, true, "", " !(isnull cursortarget) && _this isEqualTo _target && { cursorTarget isKindof 'Man' && { alive cursortarget && { ( side cursortarget isEqualTo side player || captive cursorTarget ) && { leader group cursorTarget isEqualTo cursorTarget && { group cursorTarget isEqualTo ( _x select 0 ) }count myGrps > 0 } } } }" ]; }; _null = [ player, true ] call TAG_fnc_createNewHCGroup; _null = [] call TAG_fnc_joinMe; _null = [] call TAG_fnc_grpJoinMe; _null = [] call TAG_fnc_HCActions;
  11. I'm quite new to functions with variables and scripting in general and I would really appreciate some help! The code will not even execute and I've been banging my head for hours now. Can someone please take a look? The function I'm trying to run is called spawnHeli (see code below) and its written in a file called functions.sqf. functions.sqf is called in init.sqf by execVM "functions.sqf"; and the spawnHeli function is called in a trigger in the editor by _nul = [getMarkerPos "heliSpawnPoint", "ocra"] spawn spawnHeli; The spawnHeli function I want to run as it is written in functions.sqf: It seams like already in the init phase the end of the functions.sqf file is not reached so can it be some error in the spawnHeli function preventing it from compiling? spawnHeli = { private["_xPos","_yPos","_zPos","_type"]; _xPos = this select 0; _yPos = this select 1; _zPos = this select 2; _type = _this select 3; _spawnMarkerPos = [_xPos,_yPos,_zPos]; if (isServer) then { _heli = []; _crew = []; _crew = creategroup EAST; if(_type == "ocra") then { _heli = [_spawnMarkerPos, 180, "O_Heli_Light_02_F", _crew] call bis_fnc_spawnvehicle; } else { if(_type == "kajman") then { _heli = [_spawnMarkerPos, 180, "O_Heli_Attack_02_F", _crew] call bis_fnc_spawnvehicle; } else { exitWith {}; }; }; _wp = _crew addWaypoint [getPos player, 0]; _wp setWaypointType "SAD"; _wp setWaypointCombatMode "RED"; _wp2 = _crew addWaypoint [getPos player, 1]; _wp2 setWaypointType "LOITER"; _wp2 setWaypointCombatMode "RED"; uiSleep 300; _wp3 = _crew addWaypoint [getMarkerPos "wpCas", 2]; _wp3 setWaypointType "Move"; _wp3 setWaypointCombatMode "green"; _Ocra = _heli select 0; waitUntil{ (getPos _Ocra) distance (getmarkerpos "wpCas") < 2000}; {deleteVehicle _x} forEach (crew _Ocra); deleteVehicle _Ocra; } else {}; };