# Search the Community

Showing results for tags 'function'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• BOHEMIA INTERACTIVE
• BOHEMIA INTERACTIVE - NEWS
• BOHEMIA INTERACTIVE - JOBS
• BOHEMIA INTERACTIVE - GENERAL
• FEATURED GAMES
• Vigor
• DAYZ
• ARMA 3
• ARMA 2
• YLANDS
• MOBILE GAMES
• ARMA MOBILE OPS
• MINIDAYZ
• ARMA TACTICS
• ARMA 2 FIRING RANGE
• BI MILITARY GAMES FORUMS
• BOHEMIA INCUBATOR
• PROJECT LUCIE
• OTHER BOHEMIA GAMES
• ARGO
• TAKE ON MARS
• TAKE ON HELICOPTERS
• CARRIER COMMAND: GAEA MISSION
• ARMA: ARMED ASSAULT / COMBAT OPERATIONS
• ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
• IRON FRONT: LIBERATION 1944
• BACK CATALOGUE
• OFFTOPIC
• OFFTOPIC
• 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
• 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
• [H.S.O.] Hellenic Special Operations's Infos
• BI Forum Ravage Club's Forum Topics
• Exilemod (Unofficial)'s General Discussion
• Exilemod (Unofficial)'s Scripts
• Exilemod (Unofficial)'s Problems & Bugs
• Exilemod (Unofficial)'s Exilemod Tweaks
• Exilemod (Unofficial)'s Promotion
• Exilemod (Unofficial)'s Maps - Mission Files
• TKO's Weferlingen
• TKO's Virolahti
• TKO's Livonia
• TKO's Rules
• TKO's Changelog
• TKO's Help
• TKO's What we Need
• TKO's Australia
• MSOF A3 Wasteland's Server Game Play Features
• MSOF A3 Wasteland's Problems & Bugs
• MSOF A3 Wasteland's Maps in Rotation
• SOS GAMING's Server
• SOS GAMING's News on Server
• SOS GAMING's Regeln / Rules
• SOS GAMING's Ghost-Town-Team
• SOS GAMING's Steuerung / Keys
• SOS GAMING's Div. Infos
• SOS GAMING's Small Talk
• NAMC's Topics
• NTC's New Members
• NTC's Enlisted Members
• The STATE's Topics

• 0 Replies

• 0 Views

### Occupation

Found 40 results

Hey guys! First script I've ever put up on the forums, but as far as I know no one has posted a hostage script using the new HoldAction function. I needed it for a mission and figured it may be helpful to some! I'm not sure if it works in MP yet, 2 AM so I haven't gotten to test.Tested and working in MP! For me anyway. Any bugs or blatant mis-coding, let me know! Features: Random hostage animation. AI joins player group after release. Uses Arma 3 Hostage Icons. Multiplayer Compatible (JIP should work too) Random interruption and completion dialogue from hostage. Nothing too fancy! Just simple. INSTRUCTIONS/CODE: SCRIPT: For use on units spawned via script, see @davidoss's wonderful example right here. Changelogs: For those who just want a download link: DOWNLOAD HERE (Google Drive)
2. ## function Time management function [Sharing]

Hey all, just came up with an idea of a function and implemented it. I kinda liked the idea and thought it would be nice to share it here :). So, the function takes as arguments the desired duration of the ArmA day in real-life hours, the day-to-night ratio (how many times the day is bigger than the night) and the (ArmA) date. It returns the needed multipliers (for the desired day and night duration in respect to the total duration of the day) as well as the sunrise and sunset times for that specific day (this is somewhat redundant since you could get them from BIS_fnc_sunriseSunsetTime, but since this function is used inside my function I thought it would be nice to return them). A simple use example would be // The function will be called myTag_fnc_timeVals for this example but you can name it whatever you want // Set variables (most probably you will get them from somewhere such as a mission parameter with "BIS_fnc_getParamValue" private _dayDur = 0.3; // Duration of ArmA day in real-life hours (half an hour in real life corresponds to one full ArmA day) private _dnFac = 1.5; // Day lasts 1.5 times the duration of the night // Get day multiplier, night multiplier, sunrise (ArmA) time and sunset (ArmA) time for the current (ArmA) day given by command "date" _timeVals = [_dayDur, _dnFac, date] call myTag_fnc_timeVals; // Handle the time in a "continuous" manner while{true} do { // Check time of day if(daytime > (_timeVals select 3) || {daytime < (_timeVals select 2)}) then { setTimeMultiplier (_timeVals select 1); // Use night multiplier } else { setTimeMultiplier (_timeVals select 0); // Use day multiplier }; // Sleep (a lot...) sleep 120; }; Below is the implementation of the function. I would like to apologise in advance though, for the cluttering with posting all the code here. I thought it could be a convenience for anyone who would like to use it. The function can also be found in this GitLab repository. In the code posted here, I have skipped parameter checks which you can implement yourself or copy the code from the provided link. NOTE: Due to the fact that the function will force the day and the night to have the given relation (given by the fraction), and due to the fact that possibly the "natural" day has different duration than the "natural" night, setting the ratio to 1 does not mean that the time multipliers will be 1. If you want to return to "normal" time use directly setTimeMultiplier command. Finally, please feel free to suggest (or implement yourself and share back) any improvements, or changes :). /* ---------------------------------------------------------------------------------------------------- * Inputs * ---------- * dayDur [Number] (Optional): Duration of the whole day in real hours (defaults to 24) * dnFac [Number] (Optional): The day-to-night ratio (defaults to 1) * dayOfYear [date] (Optional): The day of the year for which the multipliers will be * calculated (defaults to the current ArmA date) * ---------------------------------------------------------------------------------------------------- * Output * ---------- * data [Array]: - _this select 0 [Number]: Day multiplier * - _this select 1 [Number]: Night multiplier * - _this select 2 [Number]: Sunrise time * - _this select 3 [Number]: Sunset time * * ---------------------------------------------------------------------------------------------------- */ // Get input variables params[["_dayDur", 24, [24]], // Total duration of day ["_dnFac", 1, [1]], // Day-to-Night factor ["_dayOfYear", date, [date]]]; // Asked date // Declare some variables private _riseSet = _dayOfYear call BIS_fnc_sunriseSunsetTime; // Get the sunrise and sunset times of the day private _durs = [nil, nil]; // Calculate day and night duration (in real life hours) _durs set[0, (_riseSet select 1) - (_riseSet select 0)]; // Calculate day duration _durs set[1, 24 - (_durs select 0)]; // Calculate night duration // Calculate multipliers /* Solve simultaneously: * * dayDur * dayMul + nightDur * nightMul = 24 (1) * (dayDur * dayMul)/(nightDur * nightMul) = dayNightFrac (2) * * The result is: * * dayMul = 24/(nightDur * (1 + dayNightFrac)) * nightMul = (nightDur * dayNightFrac * dayMul)/dayDur */ private _dMul = 24/((_durs select 1) * (1 + _dnFac)); // Calculate the day multiplier private _nMul = ((_durs select 1) * _dnFac * _dMul)/(_durs select 0); // Calculate the night multiplier // Multiply with "global multiplier" _dMul = _dMul * 24/_dayDur; // Final day multiplier _nMul = _nMul * 24/_dayDur; // Final night multiplier // Return and exit [_dMul, _nMul, _riseSet select 0, _riseSet select 1] Hope this will be useful to someone. Take care, have fun and ArmA a lot :). EDIT: Corrected the code. A "total multiplier" was missing and day and night multipliers needed corrections. Now works correctly (I hope)... EDIT: A couple of bug fixes... Sorry ;(
3. ## [BETA] Arma COMREF - Offline Wiki

Hello everyone, Here is a small project that may be helpful to everyone that doesn't always have access to internet/the wiki, or to everyone needing the biki when it is down. With the support of peeps in the #community_wiki Arma 3 Discord channel, I managed to extract wiki data to make a COMREF (Operation Flashpoint flashbacks intensify) This is basically offline documentation for commands and functions in all Arma titles - note that some glitches are still present, but the data is pretty much usable. newest version: 2020-06-12 COMREF (added messagebox colours and better parsing) old version: 2020-06-10 COMREF (first version) My little helpers: @Grezvany13, @Dedmen, @x39, @optix, @Heyoxe, @A3_Stickie

5. ## Changing all regular ammo to Tracer ammunition

Dear follow Arma addicts, can anyone point me towards a performance conscious script for: 1) Replacing all the non tracer ammunition from both player and ai with tracer ammunition, both at their weapons and inventories. 2) I believe tracer ammunition effects only happens when the magazine is almost empty. Is there any way to make every round have (or simulate) tracer effects? Basically I want to simulate old school battlefield games (BF2, BF3) were all rounds have tracer like effects that help players identify the origin and location that fire is coming from. (I need to up the feedback and gameplay friendliness of my mission while compromising some realism). Thank you in advanced!
6. ## Function only working for host

Hey guys just tested a mission and came up with an issue. I am using this code: ["init", [y, "images\spoilers.jpg", "Spoilers"]] call BIS_fnc_initLeaflet; ["init", [x, "images\spoilers.jpg", "Spoilers"]] call BIS_fnc_initLeaflet; in an MP mission. All worked fine but one thing. The action to see the leaflet both times was only visible to the host. Clients could not even see the action. How can I make the above action visible to all in MP please?

8. ## create Module Civilian Presence with script

Hello everyone, I need a little help I try to create, through a script, a combination of modules to add a civilian presence to the cities crossed by the player. The problem is that at the launch of the mission, despite the generation of three modules (visible and existing in Zeus mode) the main module (ModuleCivilianPresence_F) does not link with the other two modules (ModuleCivilianPresenceSafeSpot_F and ModuleCivilianPresenceUnit_F), and I have the following error message : "bis_fnc_moduleCivilianPresence [x] Civilian Presence L-Alpha 1-2: 1 terminated." There are at least 1 spawnpoint and 1 position module. " How to make dialogue, synchronize the three modules, created via a script, ingame ? This is just a piece of extracted code; the rest of my project works perfectly : Do not pay attention to the two ways to create a unit, both ways work exactly the same, I put the necessary characters to hide the text for reading the script > /* and */ _townLoc = nearestLocations [getPos player, ["NameVillage","NameCity","NameCityCapital","NameLocal","CityCenter","Airport"], 2500]; if ((count _townLoc) > 0) then { sleep 0.01; _townPos = locationPosition (_townLoc select 0); /* sleep 0.50; _MCP_Spawn = (createGroup sideLogic) createUnit ["ModuleCivilianPresenceUnit_F",_townPos,[],0,"NONE"]; _MCP_Spawn setvariable ['BIS_fnc_initModules_disableAutoActivation', false]; sleep 0.50; _MCP_SafeSpot = (createGroup sideLogic) createUnit ["ModuleCivilianPresenceSafeSpot_F",_townPos,[],0,"NONE"]; _MCP_SafeSpot setvariable ['BIS_fnc_initModules_disableAutoActivation', false]; sleep 0.50; _MCP_Module = (createGroup sideLogic) createUnit ["ModuleCivilianPresence_F",_townPos,[],0,"NONE"]; _MCP_Module setvariable ['BIS_fnc_initModules_disableAutoActivation', false]; */ sleep 0.50; _MCP_SafeSpot = "ModuleCivilianPresenceSafeSpot_F" createUnit [_townPos, createGroup sideLogic, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false];", 0.6, "PRIVATE"]; sleep 0.50; _MCP_Spawn = "ModuleCivilianPresenceUnit_F" createUnit [_townPos, createGroup sideLogic, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false];", 0.6, "PRIVATE"]; sleep 0.50; _MCP_Module = "ModuleCivilianPresence_F" createUnit [_townPos, createGroup sideLogic, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false];", 0.6, "PRIVATE"]; }; Otherwise I also tried another method : I to place the necessary modules in the 3den editor, then move them by script when the player is near a locality. The modules change position, but the created civil entities always go to the moduleCivilianPresenceSafeSpot module's initial position, ie the position of the module when it was placed in the editor, even if it was changed position. :/
9. ## scripting [SOLVED]Using BIS_fnc_isCuratorEditable

Does anyone have any idea how to use the function "BIS_fnc_isCuratorEditable" to kill curator editable units when they enter a trigger. I am trying to create a restriction zone around my map which kills the player and curator units when they enter the zone but will allow none curator units to pass through (so I can simulate reinforcements entering the region after a certain amount of time). I have been running some tests to get an idea on how the "BIS_fnc_isCuratorEditable" function works. I currently have four triggers around the map which tell me through a hint whether a unit is curator editable or not. I am now trying to work out how to change it from giving me a hint which is either true or false, to killing the unit if true or allow the unit through if false. Something along the lines of... Just can not seem to work it out. Also tried this to no avail...

12. ## Select tracks in BIS_fnc_Jukebox

Is there a way to change BIS' jukebox function so that it selects the tracks from a custom array instead of the whole cfgMusic? Here's the function:
13. ## Check if local is function caller

Hi, I am currently trying to find a way to check if local player is function caller in sqf file. I have civilian with addAction, which calls this script: _caller = _this select 2; if (local player == _caller) then { _handle = createdialog "Interaction"; } I need to show the GUI only to player using the action. Sorry if it's somewhere on these forums, but I was unable to find it. Thanks for your answers 🙂 WendAF

15. ## [RELEASE] GetWeapon

HI. Maybe someone can find this usable. Iterate trough config weapon classes and returns array of weapons/ammo according to given parameters /* file : fnc_getWeapon.sqf author: DaVidoSS description: Iterate trough config weapon classes and returns array of weapons/ammo according to given parameters parameters: 0: STRING one from listed below "assault" "handgun" "submachine" "rocket launcher" "missile launcher" "grenade launcher" "light machine" "medium machine" "marksman" "sniper" "all" 1: SCALAR or STRING "all" for all available classes of param 0 NUMBER classes of param 0 2: BOOLEAN true - for return ammo classes too in form ["weapon",["ammo","ammo"...]] false - for return without ammo classes in form ["weapon","weapon"...] Return: ARRAY Usage: fnc_getWeapon = compileFinal preprocessFileLineNumbers "fnc_getWeapon.sqf"; _10assaultGunsWithAmmo = ["assault" ,10,true] call fnc_getWeapon; _1MarksmanGunWithoutAmmo = ["marksman" ,1,false] call fnc_getWeapon; _allGunsofAllTypeWithAmmo = ["all","all",true] call fnc_getWeapon; */ private _paramsCheck = params [["_type","all",[""]],["_allof","all",["",0]],["_withMags",false,[true]]]; if (!_paramsCheck) exitWith {["***********ERROR:fnc_getWeapon - exiting due wrong params given %1",str _this] call BIS_fnc_error; false}; private _array = []; private _return = []; { private _class = (configName _x); if (getNumber (configfile >> "CfgWeapons" >> _class >> "type") < 5) then { private _magazines = getArray (configfile >> "CfgWeapons" >> _class >> "magazines"); private _name = toLower (getText (configfile >> "CfgWeapons" >> _class >> "descriptionShort")); if !(_magazines isEqualTo []) then { if (toLower _type != "all") then { if ((_name find (toLower _type)) > -1) then { if (_withMags) then { _array pushBack [_class,_magazines]; } else { _array pushBack _class; }; }; } else { if (_withMags) then { _array pushBack [_class,_magazines]; } else { _array pushBack _class; }; }; }; }; } forEach ("isClass _x && {(getNumber (_x >> 'scope')) isEqualTo 2}" configClasses (configfile >> "CfgWeapons")); switch (true) do { case (_allof isEqualType 0): { if (_allof isEqualTo 1) exitWith { _return pushBack (selectRandom _array); }; if (_allof > 1 && {count _array >= _allof}) then { for "_i" from 1 to _allof do { _return pushBackUnique (selectRandom (_array - _return)); }; } else { if (_allof < 1) exitWith {_return pushBack (selectRandom _array)}; _return = _array; }; }; case (_allof isEqualType ""): { _return = _array; }; default {}; }; (_return) Enjoy :-)
16. ## Arma3 random seed functions

Helo. I have a seeding problem with the random function that I just can't figure out. while { surfaceIsWater _suitable || count _list > 0} do { while {_spot distance officer_jeff < 1000 || surfaceIsWater _spot} do { _prevStep = _center getPos[ (random 2000), (random 350)]; for "_i" from 0 to 2 do { _step = _prevStep getPos[ (random 2001), (random 351)]; _prevStep = _step; }; _spot = [_step select 0,_step select 1,0]; }; _suitable = [_spot, 0, 300, 20, 0, 0.7, 0] call BIS_fnc_findSafePos; _list = nearestTerrainObjects [_suitable,["TREE","BUILDING","RUIN","ROCK","HOUSE"], _howBig,false]; }; If the script can't find a position that is not a water surface, it restarts BUT the RANDOM functions just keeps giving me the same position every time the cycle ends. I don't understand, is it not supposed to be random? I also tried this with seed using the alternate syntax of random: while { surfaceIsWater _suitable || count _list > 0} do { while {_spot distance officer_jeff < 1000 || surfaceIsWater _spot} do { _prevStep = _center getPos[ (time random 2000), (time random 350)]; for "_i" from 0 to 2 do { _step = _prevStep getPos[ (time random 2001), (time random 351)]; _prevStep = _step; }; _spot = [_step select 0,_step select 1,0]; }; _suitable = [_spot, 0, 300, 20, 0, 0.7, 0] call BIS_fnc_findSafePos; _list = nearestTerrainObjects [_suitable,["TREE","BUILDING","RUIN","ROCK","HOUSE"], _howBig,false]; }; Here is an example output: 15:12:48 "[823.795,10712.5] as _suitable, 56 as count _list, [816.133,10551.5,0] as _spot " 15:12:49 "[820.423,10745.8] as _suitable, 46 as count _list, [816.133,10551.5,0] as _spot " 15:12:50 "[828.004,10684.4] as _suitable, 76 as count _list, [816.133,10551.5,0] as _spot " Any help would be much appreciated.
17. ## [SOLVED] Can't fill a dialog by calling a function

Hi to everyone. My problem is that I wanna fill my dialog by calling a funcion after creating it, but it doesn't work at all. I mean, the dialog is created but empty. Here's my code: When I wanna create the dialog I use ["INIT"] call my_function; disableSerialization; private _ui = uiNamespace getVariable "MyDialog"; private _list = _ui displayCtrl 1600; private _cat = _ui displayCtrl 1601; private _categories = "true" configClasses (getMissionConfig "HG_DefaultShop"); actDialog = { lbClear _list; _num = _this select 0; private _object = getText( _categories select _numCat >> "displayName"); _cat ctrlSetText _objeto; //Some lb commands. }; switch (_this select 0) do { case "INIT": { createDialog "MyDialog"; _num = 0; [_num] call actDialog; }; }; I hope u guys can help me! Thanks!!
18. ## How to Spawn and Delete Functions from Trigger Init's?

I was wondering how one could go about using a Trigger to Spawn a Function once a player enters a Trigger's area. Then delete the Function once the player leaves the Trigger? While having that process repeatable. So far I have tried using the Trigger's Activation field to call the Function (BIS_fnc_Crows), and then the Trigger's Deativation field to delete that Function. However that's where my problem is. As everything I have tired..including searching the internet and using script commands such as deleteVehicle and other similar commands has all failed! I know it's possible as I have done similar things in the past but it dont help that I have not scripted anything since early A2 days, and A3 is seemingly more complex.
19. ## function spawn error

hello guys, i've run into a strange problem and really have no idea where start to look for a solution! i've my big function container (its a big read, i post it just for the records...): ...it contains all my functions for this mission, but...when i launch mission, it start say that FUNCTION_NAME is not defined (where "FUNCTION_NAME" is the name of one of my functions, that as you can see are defined. i pre-load the file containing the functions in my initServer.sqf : call compile preprocessFile "DDscripts\DWARfunctions.sqf"; null = [] spawn SPAWNERconvoyB; null = [] spawn SPAWNERconvoyR; null = [] spawn SPAWNERciv; null = [] spawn SPAWNERind; null = [] spawn SPAWNERmine; even more strange, i noticed adding >> uiSleep 10; between a function spawn and another, some start to work!! i even started to think its like the functions are not pre-loaded, and server dont recognize them ! but isnt supposed to do this the >> calling compile preProcessFile ... ?? i'm seriously confused....any light on this? thanks !

21. ## Script stops running after fn call value changes?

edit: completely replaced the code so no longer interested in help. Trying to find the delete button vOv
22. ## About stringtable and BIS_fnc_showSubtitle

[“$STR_HGY_ID_Frost”，“$STR_HGY_kb_MeetCivilian_Frost_1”] spawn BIS_fnc_showSubtitle; not work。 how to display Written words？
23. ## Issues with Trigger and sleep, spent 10+ hours on this already

I have a function that i need to call when all the opfor is dead in a dynamically created trigger area. This function contains a sleep. I have tried all sorts of diff delays, all caused issues because i was using call in the dynamically created trigger statements. I have tried using a dynamically created trigger to create another trigger but for some reason it just kept creating triggers on load rather than after the opfor were dead. I have tried using spawn in both the int and the dynamically created trigger to fire the function for the first time. In the statement for the dynamically created trigger i used spawn to call the function that inevitably dynamically creates a new trigger. but for some reason like in my previous tests the trigger statement is getting activated on creation. i have been at this Arma 3 scripting for a week now and i keep running in to issues like this. I really could use some help on this.
24. ## Zero Divisor in select function

I keep getting a "zero divisor" error when trying to select from an array after using the find command. The basic situation is; 16 people each with their own individual waypoints. When the units reach the waypoint, the following is executed: For units in group 1: nul = [this,1] execVM 'law\setRotation.sqf'; For units in group 2: nul = [this,2] execVM 'law\setRotation.sqf'; setRotation.sqf contains the following: params [["_subject", objNull],["_typeCode", 0]]; if (_typeCode == 0) then { //Insert Code to generate error report here }; if (_typeCode == 1) then { _unitsAlpha = [ pak_mainyu1_2, pak_mainyu1_3, pak_mainyu1_4, pak_mainyu1_5, pak_mainyu1_6, pak_mainyu1_7, pak_mainyu1_1, pak_mainyu1_8 ]; _positionInQueue = _unitsAlpha find _subject; _bearingsBriefing_alpha = [ 271.587, 250.801, 225.084, 202.869, 172.511, 147.108, 26.615, 20.786 ]; _bearingFrom = _bearingsBriefing_alpha select _positionInQueue; _startPos = getPosAtl _subject; _watchTarget = [_startPos,3,_bearingFrom] call BIS_fnc_relPos; _watchTarget set [2,1.8]; _subject doWatch _watchTarget; }; if (_typeCode == 2) then { _unitsBravo = [ pak_mainyu2_2, pak_mainyu2_3, pak_mainyu2_4, pak_mainyu2_5, pak_mainyu2_6, pak_mainyu2_7, pak_mainyu2_1, pak_mainyu2_8 ]; _positionInQueue = _unitsBravo find _subject; _bearingsBriefing_bravo = [ 271.587, 250.801, 225.084, 202.869, 172.511, 147.108, 26.615, 20.786 ]; _bearingFrom = _bearingsBriefing_bravo select _positionInQueue; _startPos = getPosAtl _subject; _watchTarget = [_startPos,3,_bearingFrom] call BIS_fnc_relPos; _watchTarget set [2,1.8]; _subject doWatch _watchTarget; }; What i can't figure out is why it's trying to select a value that's out of range. There are 8 units in each group, a matching set of 8 names in the _unitsX arrays, and 8 entries within the bearing array. Should be a simple case of 1 - obtain unit name from waypoint completion 2 - find name within array 3 - select corresponding bearing from the bearing array I ran a separate test to go through the same process 1 by 1 which passed without error, so I'm guessing it's to do with some of these waypoints being completed at the same time: _testGroup = [ pak_mainyu2_1, pak_mainyu2_2, pak_mainyu2_3, pak_mainyu2_4, pak_mainyu2_5, pak_mainyu2_6, pak_mainyu2_7, pak_mainyu2_8 ]; { player sideChat (format ["Subject: %1",_x]); _subject = _x; _unitsBravo = [ pak_mainyu2_2, pak_mainyu2_3, pak_mainyu2_4, pak_mainyu2_5, pak_mainyu2_6, pak_mainyu2_7, pak_mainyu2_1, pak_mainyu2_8 ]; _positionInQueue = _unitsBravo find _subject; player sideChat (format ["PosInQ: %1",_positionInQueue]); _bearingsBriefing_bravo = [ 271.587, 250.801, 225.084, 202.869, 172.511, 147.108, 26.615, 20.786 ]; //player sideChat (format ["Subject: %1, Position: %2",_subject,_positionInQueue]); _bearingFrom = _bearingsBriefing_bravo select _positionInQueue; player sideChat (format ["BearingFrom: %1",_bearingFrom]); _startPos = getPosAtl _subject; _watchTarget = [_startPos,3,_bearingFrom] call BIS_fnc_relPos; _watchTarget set [2,1.8]; _subject doWatch _watchTarget; sleep 3; } forEach _testGroup; Maybe there's something to do with using local variable handles that I'm not understanding here. Thanks, Law
25. ## ExecVM // Compile // Functions.hpp

Hello. I am pretty sure this is a question that has been answered many many times but I really can't make differences between each of the forums topics that I have found so far. Everyone tells the same, yet for a totally different question. So I thought I might as well just create a topic and ask my questions here. Pretty sure someone will answer it sooner or later. 1. When I have multiple functions, in multiple SQFs, is it better to call them 1 by 1 with ExecVM or call them with compile or should I create functions.hpp ? -I want to use all of the scripts, and most of them are going to be used later in the mission. -Most of the scripts have a return value -Is there going to be any performance difference? 2. If I have a really huge script, (literally a random mission spawner with multiple arrays and public variables) is it better to compile it or execVM it? -The script is called each time a mission is finished. -It contains loops and many scopes -It doesn't return anything 3. If I have scripts that I want to run only on the client side, and not on the server side, do I still need to execVM it on the server? -Respawn scripts / spawn protection / addactions -Contains loops Furthermore, I want to know what is the time difference between execVM and Call? If I run bug functions multiple times, do they have a performance impact on the server? For example in the case of creating private arrays again, etc.
×

• Clubs