Search the Community
Showing results for tags 'arrays'.
Found 9 results
-
I've been scratching my head at a problem with arrays recently but I can't seem to find a decent solution to it. So let's say I have an array that looks like this: [[1,2],[2,1],[3,4],[4,3]]. In this case, the first two elements are combinations of each other, same as the last two. What I am trying to do is to filter this array to remove such combinations and leave only one of them so that the array would look like [[1,2],[3,4]] instead. I'd greatly appreciate any help with this!
-
Dead units automatically get deleted from array.
Kreu posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I made a small scenario to test the behaviour of arrays. I placed two BLUFOR soldiers inside an Trigger. Trigger name is ar1. Trigger activation is BLUFOR present. I then execute forces = list ar1; forces is now an array with two units. Now if i kill one of those units, it automatically gets removed from the array forces. I always thought i have to that myself. This doesn't match with the experiences i previously made. In another mission im currently creating, dead units seem to stay in my arrays. So what is your knowledge about this topic? -
Access external file with loot arrays
Vandeanson posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi all, I am looking for a solution or some guidance to understand how I can pull arrays of loot (e.g. weapons, gear,...) from a separate file into a .sqf file. What I want to do: - create a master file with arrays of items, weapons, or structures - create scripts (e.g. LINK)that spawn loot that can access those master files - have one single file where I can alter those arrays without having to update the arrays in each single script an example for an array that is currently in each of my scripts and that I would like to export into a master file and then acces from such master file: _itemsArray =[ "rvg_canOpener", "rvg_plasticBottlePurified", "rvg_spirit", "rvg_franta", "rvg_milk", "rvg_rice", "rvg_hose", "rvg_guttingKnife", "rvg_tire", "rvg_purificationTablets", "rvg_flare", "rvg_matches", "rvg_Geiger", "rvg_toolkit", "rvg_antiRad", "muzzle_snds_B", "muzzle_snds_L", "acc_flashlight_pistol", "optic_DMS" ]; Any input is very welcome;) thank you and cheers vandeanson -
Gentlemen, I am looking for a way to pull one array each for Uniforms, vests, backpacks, headgear and so on from configfile, similar to below example for weapons. I would like to pull all equipment items, and then pick out all uniforms or vests or.... (whatever group of items that I want to make an array for) by filtering it by the "parent" name. (eg, below example "if "rifle" in _parents) Now I tried to find the correct parents in config viewer by placing an uniform in eden editor and then rightclick + show in config viewer, but i think i get the wrong parents there (maybe just the vehicle for the placed uniform / "groundweaponholder"?) Anyway none of the parents work and i wonder where i am going the wrong way. For backpacks for example, I selected a backpack from the cfg vehicle list in the config viewer and found the parent "Bag_Base" (or something like that) and it would return an array of backpacks, however, many of the backpacks would contain items. Is there a way to avoid this? In the end I only want each array to contain empty vests/uniforms/backpacks. I think my problem is that I use the wrong method to search for an example classname in config viewer and therefore it provides me with wrong parents. I would appreciate any help or guidance in that respect;) Thanks VD
-
Just collecting classnames and putting it into format for use: ALL CUP Weapons (with attachments): CUP Weapons (without/with very limited Attachments)
-
Trying to pass elements over to BIS_fnc_ambientAnim__terminate
froggyluv posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Using the example provided by the WIKI Works great when placed into individual map placed units but Id like to have the ability to have master control over the whether they spawn in mass or just walk into a certain area. A. _this = _this select 0; [_this,"SIT2"] call BIS_fnc_ambientAnim; 0 = _this spawn waitUntil {behaviour _this == "combat"}; [_this] call BIS_fnc_ambientAnim_terminate; Doesnt Work B. {[_x "SIT2"] call BIS_fnc_ambientAnim; 0 = [_x] spawn {waitUntil {behaviour _x == "combat"}; [_x] call BIS_fnc_ambientAnim_terminate}} foreach thisList Also getting Undefined errors on this. -
2 questions: Waypoint & Arrays (non related)
Ramsen II posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Firstly I do not understand the need for the "unchanged" and "no change" when scripting waypoints? What are they for? whats the difference between: and.... whats the difference? 2nd question: How do i cycle the next element in an array each time i use, for example, add action "click"? _array [one,two,three]; player addaction ["click" { ????}]; So when i activate action "click" first time it hints "one", then when i activate it a second time it says "two" and so on. ForEach does not seem to be the answer as it does all three at once every time i activate "click". I need the array to cycle every time i select click? The "click" is an example what i want is to cycle camera channels on one TV, see code below the "camera select" part, at the moment i have to set each camera using a variable as a switch... Any help appreciated. thx ;) -
Question how to approach vehicle inventory for logistic script
ventzer0 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, I'm looking for some help in figuring something out. I am currently trying to create a logistic script with the help of the ACE3 interaction framework. My goal is to create something similar to R3F and igiLoad. Attaching the actual cargo objects to the vehicle, but instead of a one-dimensional manner I want to have it 2D. What I mean is: Take for example an Offroad and look at the truckbed. Now devide that into a grid lets say it is 3 units wide by 8 units long and define every loadable object as taking up x,y amount of grid space. There are many ways you fit things in there and attach them to the vehicle. An object that is 1x2 will fit in rows and columns. So my question really is : what would possibly be the best way to go at this problem? What might be the best approach, are there some functions I can use to make things easier? The inventory system in general? I can imagine some kind of tetris logic that would be able to accomplish this, but I'm afraid my approach would be very bulky and ugly. Also I don't really know what the best way of keeping track of the vehicles inventory would be. So I want to pose those questions to anyone here, who has more experience and knowledge, and might be able to help me figure this one out. Any pointers or thoughts would be apprechiated! If anyone wants to look at what I already have, nothing special just able to load/unload one object at the moment: https://pastebin.com/cHxknQdQ Cheers!- 3 replies
-
- data structures
- ace3
-
(and 3 more)
Tagged with:
-
Trying to get a position from arrays of nearestObjects
FederalRazer89 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
As the title suggest i am trying to get some position from arrays of the command "nearestObjects". I want the "nearestObjects" to look for a certain amount of house, so i can identify a village or town with the script and then use the average of all the listed house in the array. That way the position i am after will not be heavily affected by one or two houses caught in the calclated radius. _Center = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"); _mapsize = (_Center select 0)*2; _RandomStartPos = [_Center, (_mapsize*0.77), (_mapsize*0.78), 3, 1, 20, 0] call BIS_fnc_findSafePos; sleep 1; player moveInCargo [_heli,5]; _enemySpawnPos = [_RandomStartPos, (_mapsize*0.7), _mapsize*0.71, 3, 0, 20, 0] call BIS_fnc_findSafePos; createMarker ["marker2",_enemySpawnPos]; "marker2" setMarkerShape "ELLIPSE"; "marker2" setMarkerSize [500,500]; "marker2" setMarkerText "Enemy resupply line"; "marker2" setMarkerAlpha 0.5; _findhouses = nearestObjects [_enemySpawnPos, "house"", (_mapsize*0.2)]; //small problems on this line _divide = count _findhouses; _fortifiedpos = _findhouses/_divide; //The bigger problem createMarker ["marker3",_fortifiedpos]; "marker3" setMarkerShape "ELLIPSE"; "marker3" setMarkerSize [500,500]; "marker3" setMarkerText "Enemy resupply line"; "marker3" setMarkerAlpha 0.5; I not really sure how should proceed, because i dont think the line "_fortifiedpos" will work, the problem above prevents it from execute. "nearestObjects" contains arrays of the houses and the houses also have arrays, if there isnt a command that would merge the arrays. If anyone have any input that would be nice, arrays are some a bit new to me so this is kind of over my head.