Jump to content

Search the Community

Showing results for tags 'function'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Arma Reforger
    • 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
  • Exilemod (Unofficial)'s General Discussion
  • Exilemod (Unofficial)'s Scripts
  • Exilemod (Unofficial)'s Addons
  • 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 Napf
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • TKO's Cam Lao Nam
  • 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
  • HavenEmpire Gaming community's HavenEmpire Gaming community
  • Polska_Rodzina's Polska_Rodzina-ARGO
  • Carrier command tips and tricks's Tips and tricks
  • Carrier command tips and tricks's Talk about carrier command
  • ItzChaos's Community's Socials
  • Photography club of Arma 3's Epic photos
  • Photography club of Arma 3's Team pics
  • Photography club of Arma 3's Vehicle pics
  • Photography club of Arma 3's Other
  • Spartan Gamers DayZ's Baneados del Servidor
  • Warriors Waging War's Vigor
  • Tales of the Republic's Republic News
  • Operazioni Arma Italia's CHI SIAMO
  • [GER] HUSKY-GAMING.CC / Roleplay at its best!'s Starte deine Reise noch heute!

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 57 results

  1. 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...
  2. 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. :)
  3. You know the vehicles I'm talking about - the HEMTT ammo / fuel / repair truck, the Huron containers, Taru pods, Zamaks, etc... you drive up to it and it just automatically repairs / refuels or rearms you, as is the case. I've searched high and low through the functions and config files, and I can't find the scripting that is making this effect happen. Does anyone know what it is, or where it can be found? Please don't answer with references to your own or other's Rearm / Refuel / Repair scripts, I have a ton of those but that's not what I'm asking - thank you! Why am I looking for this, specifically? 1. Vehicle rearming, with turrets and especially with dynamic loadouts, is especially problematic. I challenge you to reload 13 out of 19 rockets, exactly, on a rocket pod that's not on the vanilla configuration of a dynamic loadout aircraft. The vehicle rearm script on the Huron pod just works, it an cosmetically appealing way: the numbers just increase while you're next to the rearming source, until you're fully reloaded, and it doesn't seem to care whether it's a vanilla loadout or a dynamic one, whether the turret is local or not, etc. 2. There's no way to adjust the "flow rate" of vehicle rearming, repairs, or refueling. 3. The effect itself is capricious. Sometimes it works as intended (drive up to the box/ car/ whatever) and the vehicle resupplies as intended. Sometimes it doesn't, but it provides you with an action (complete with a lovely icon) to perform it. And sometimes it doesn't work at all. Thank you in advance! Ryko
  4. 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:
  5. 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
  6. Hi everyone, I found this topic And in it there is a code given by Larrow : //initPlayerLocal.sqf //Start custom loading screen aswell [] spawn { [ "MyLoadingScreen" ] call BIS_fnc_startLoadingScreen; uiSleep 20; [ "MyLoadingScreen" ] call BIS_fnc_endLoadingScreen; }; waitUntil { //If there are no current loading screens if ( missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]] isEqualTo [] ) then { //Continue true }else{ //Otherwise log current loading screens to RPT diag_log str ( missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]] ); false }; }; _loadedTime = time; uiSleep 1; hint format[ "Finished loaded %1 seconds ago", time - _loadedTime ]; It works fine but the problem is that with the function BIS_fnc_startLoadingScreen my loading screen doesn't appears and if i use the command startLoadingScreen it appears. But i need to use the function for the following waitUntil. So : startLoadingScreen ["", "begin_dialog"]; Works fine but can't use with the waitUntil. ["begin_dialog"] call BIS_fnc_startLoadingScreen; Doesn't works! Can anyone help me?
  7. 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 :-)
  8. 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.
  9. 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!!
  10. 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.
  11. 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 !
  12. Ok, that's a bit of a complex problem. As far as I know arma uses 2 kinds of variables: private and global and that will be the biggest problem here. I'm trying to call a script from a object (Data Transmiter) that will add a Hold Action to it. No problem for now and works as intended for a single Data Transmiter. But when I use the same script for a second Data Transmiter only the second one will work. Why that happens? Because some parts of the code requires global variables. So, how can I fix it? I honestly have no idea. That's the code for reference, just call it with a handle = [this] execvm "name of the file.sqf" and should work. //select object name and apply to global _datalinkname = this select 0; datalinkname = _datalinkname; //params ["_datalinkname"]; //Set Datalink Color [datalinkname,"blue","orange","red"] call BIS_fnc_DataTerminalColor; //open/arm function fn_potato = { [ datalinkname , "Hack DataLink", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "_this distance _target < 3", "_caller distance _target < 3", { systemChat "Start Hacking"; }, { playSound3D ["a3\sounds_f\sfx\beep_target.wss", datalinkname, false, getPosASL datalinkname, 1, 1, 0] }, { [datalinkname, 3] call BIS_fnc_DataTerminalAnimate; sleep 5; hint "after 5 sec..."; playSound3D ["A3\Sounds_F\sfx\alarm.wss", datalinkname, false, getPosASL datalinkname, 1, 1, 0]; datalinkname call fn_potato2 }, {}, [], 3, 0, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, datalinkname]; }; //close/disarm function fn_potato2 = { [ datalinkname , "Hack DataLink", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "_this distance _target < 3", "_caller distance _target < 3", { systemChat "Start Hacking"; }, { playSound3D ["a3\sounds_f\sfx\beep_target.wss", datalinkname, false, getPosASL datalinkname, 1, 1, 0] }, { [datalinkname, 0] call BIS_fnc_DataTerminalAnimate; sleep 5; hint "after 5 sec..."; playSound3D ["A3\Sounds_F\sfx\alarm.wss", datalinkname, false, getPosASL datalinkname, 1, 1, 0]; datalinkname call fn_potato }, {}, [], 3, 0, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, datalinkname]; }; //calls first function datalinkname call fn_potato;
  13. edit: completely replaced the code so no longer interested in help. Trying to find the delete button vOv
  14. [“$STR_HGY_ID_Frost”,“$STR_HGY_kb_MeetCivilian_Frost_1”] spawn BIS_fnc_showSubtitle; not work。 how to display Written words?
  15. 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.
  16. 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
  17. 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.
  18. Hello everyone! I wrote a script with which you can turn a dialog config into the format that the GUI editor uses. The goal was to be able to edit an already existing dialog after the GUI editor has been closed. This should make alternating dialog configs easier. Before: After: Currently known issues: Thanks to @HallyG, @HazJ, @dreadedentity! And one second later I discover that ArmA3 already has a system. With the given config path you can press Ctrl+I and insert your path.
  19. Hello everyone, here is a really simple function that I put together: /* Author: Terra Description: Converts the elements of an array into a string Parameter(s): 0: ARRAY - array of elements of any type 1 (Optional): STRING - seperator between elements (default: ", ") Returns: STRING */ params [ ["_array", [],[[123]]], ["_seperator", ", ", ["123"]] ]; _str = format ["%1", _array select 0]; { private _addString = _x; if (typeName _addString != typeName "123") then {_addString = str _addString}; _str = _str +_seperator +_addString; } forEach (_array -[_array select 0]); _str Just some code that I wrote down while working on another project. Feel free to modify and comment.
  20. Hi all, i'm creating a scenario in which I'd need some (a lot actually) groups of AIs to spawn in certain markers and follow a waypoint assigned after their creation. Since I need to do that a lot of times, i tried to create an Inline function inside of the .sqf file I use to control all the processes and spawns during the mission. spawngroup = { params ["groupname", "marker"]; "Terrorista1" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"]; "Terrorista2" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"]; "Terrorista3" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"]; "Terrorista4" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"]; "Terrorista5" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"]; wp = groupname addWaypoint [position attack,0,0]; wp setWaypointType "DESTROY"; groupname setCurrentWaypoint [groupname, 0]; }; gruppo1 = createGroup EAST; [gruppo1,"spawn1"] call spawngroup; gruppo2 = createGroup EAST; [gruppo2,"spawn2"] call spawngroup; etc... Obviously (because I suck) this does not work, inside the missions it returns an error like local variable in global space.. Anyone can make this work properly? I just want a func that given a groupname and a marker, create those AI and send them to destroy anything on marker "attack"
  21. Hello everyone, if you want to know exactly how the random command behaves with your own values then here is just a small function to test it with "random [min,mid,max]". Output is similar to the example 4 on the Biki page. /* Author: Terra Parameters: 1: Number - Minimum 2: Number - Middle 3: Number - Maximum (Optional) 4: Number - Runs, higher numbers take longer *Default: 100000 (Optional) 5: Number - Return specific element *Default: -1 (return all) (Optional) 6: String - Round method, can be "round","ceil","floor" *Default: "round" Return: Array of arrays OR with param 4: array Example: 0 = [0,5,10] call TER_fnc_randomTest; */ TER_fnc_randomTest = { params [ "_min","_mid","_max", ["_runs",10^5, [123]], ["_spec",-1,[123]], ["_mode","round", ["string"]]]; private ["_random"]; _minMidMaxArr = [_min,_mid,_max]; _countArray = []; for "_i" from 1 to _runs do { switch _mode do { case "round": {_random = round random _minMidMaxArr}; case "ceil": {_random = ceil random _minMidMaxArr}; case "floor": {_random = floor random _minMidMaxArr}; }; _countArray pushBack _random; }; _outputArray = []; _biggest = selectMax _minMidMaxArr; _smallest = selectMin _minMidMaxArr; for "_h" from _smallest to _biggest do { _count = {_x == _h} count _countArray; _outputArray pushBack ([_h,_count, 100*(_count/_runs)]); // Output as [Tested Number, occurences, probability %] }; if (_spec != -1) exitWith { copyToClipboard str _outputArray; _output = _outputArray select _spec; systemchat str _output; _output }; copyToClipboard str _outputArray; systemchat str _outputArray; _outputArray }; Just a quick warning: This function can take up some time. It runs several thousand times after all. See you around, 7erra
  22. --------------------------------- UPDATE 29.01.2022 With Arma 3 2.06+ it is now possible to use regexReplace instead: https://community.bistudio.com/wiki/regexReplace Performance: ["12345 123456", "123", "abc"] call TER_fnc_editString; Execution Time: 0.0093 ms | Cycles: 10000/10000 | Total Time: 93 ms "12345 123456" regexReplace ["123/g", "abc"] Execution Time: 0.0016 ms | Cycles: 10000/10000 | Total Time: 16 ms --------------------------------- Hello everyone, I just wanted to share a small function. It can replace certain parts of a string with your own string. /* Author: Terra Description: Substitute a certain part of a string with another string. Parameters: 1: STRING - Source string 2: STRING - Part to edit 3: STRING - Substitution Returns: STRING Example: ["12345 123456", "123", "abc"] call TER_fnc_editString; Returns: "abc45 abc456" */ TER_fnc_editString = { params ["_str", "_toFind", "_subsitution"]; _char = count _toFind; _no = _str find _toFind; while {-1 != _str find _toFind} do { _no = _str find _toFind; _splitStr = _str splitString ""; _splitStr deleteRange [(_no +1), _char -1]; _splitStr set [_no, _subsitution]; _str = _splitStr joinString ""; }; _str }; Additional information:
  23. So i saw a video a couple of days ago where the player that controled zeus has access to thermal vison. After a google search i found this http://feedback.arma3.com/view.php?id=17794 on the Arma 3 feedback website. I tried multiple times to get it to work but no progress, so i went in the editor and looked up the function in the function viewer. This is what i got from it. I have tried a couple of things but nothing has worked yet. If anyone knows how to get this to work that would be great. Hopefully it will also help other mission makers in the future. Thanks in advance for any help or tips i get.
  24. Hello, I'm trying to figure out how to use this function: BIS_fnc_prepareAO I understand the function needs a trigger placed for it to work. Just not understanding how to use it fully. thanks for the help in advance.
  25. Hi all, I have been having a problem with a set of functions of mine, I can't reproduce it locally, but it occurs on my Unit's dedicated server occasionally (not all the time), I can't quite figure out what is causing it. Error in the .rpt: I had this problem previously but I fixed it in the below Function (fn_RainTexture.sqf) by adding this Line: if (isNull _unit) exitWith {}; fn_RainTexture.sqf: So I figured that the error must have something to do with an un-handled null "_unit", maybe? fn_GearSwitch.sqf (the script where the problem occurs): What happens is that this script is executed on on a bunch of Units (AI and Players), the server "Hands out" the script to to each unit to execute. Ideally I'd like to be able to, when it causes the .rpt error, somehow spit-out which unit the error occurs on. Essentially making it much easier to track down the root cause. Anybody know a way to log only when the function trips with an error? PS: I wouldn't object if someone managed to figure out what the problem with the function is as well :P Thanks in Advance, Squirrel.