Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Schatten

Member
  • Content Count

    816
  • Joined

  • Last visited

  • Medals

Everything posted by Schatten

  1. @.Avoid, sure, @gc8 already provided working solution in this message of this topic.
  2. @.Avoid, replace this string in your code: _selected = parseNumber lbData[1011,lbCurSel 1011]; by this.
  3. @pierremgi, sorry, I was wrong -- have noticed that if arrays have same length then order of elements of returned by arrayIntersect command array match with one of second array: _array1 = ["beer", "steak", "girls1", "gaming", "chocolate"]; _array2 = ["chocolate", "gaming", "girls", "steak", "beer"]; _result = _array1 arrayIntersect _array2; // ["chocolate", "gaming", "steak", "beer"] Otherwise, if arrays have not same length, then order of elements match with one of first array: _array1 = ["beer", "steak", "girls1", "gaming", "chocolate"]; _array2 = ["chocolate", "gaming", "steak", "beer"]; _result = _array1 arrayIntersect _array2; // ["beer", "steak", "gaming", "chocolate"] Looks like your solution is the best!
  4. Well... Unfortunately, my solution will fail with these arrays: _array1 = ["beer", "beer", "steak", "girls", "gaming", "chocolate"]; _array2 = ["chocolate", "gaming1", "gaming", "girls", "steak", "beer"]; _result = (count (_array1 arrayIntersect _array2)) == (count _array1); // true, because "_array1 arrayIntersect _array2" returns array with 6 elements: ["beer", "steak", "girls", "gaming", "chocolate", "gaming1"] Seems, this is the best solution for sortable arrays. If arrays contain non sortable elements (e. g., objects), you can try this solution: ((_array1 apply {str _x}) sort true) isEqualTo ((_array2 apply {str _x}) sort true) Unfortunately, this solution can fail in case if order of elements of returned by "_aa arrayIntersect _bb" array differs with one of _bb.
  5. _array1 = ["beer", "beer", "steak", "girls", "gaming", "chocolate"]; _array2 = ["chocolate", "gaming", "gaming", "girls", "steak", "beer"]; _result1 = (count (_array1 arrayIntersect _array2)) == (count _array1); // false _result2 = (count (_array1 arrayIntersect _array2)) == (count (_array1 arrayIntersect _array1)); // true But, as we can see, arrays are not equal!
  6. @Tankbuster, another solution: (_array1 sort true) isEqualTo (_array2 sort true)
  7. @Tankbuster, (count (_array1 arrayIntersect _array2)) == (count _array1)
  8. @Lineman, { call (compile (format (["%1 = '%2' createUnit [_CorpSpawnPosition, newGroup];"] + _x))); } forEach [ ["SpawnSoldier_02", "B_SOLDIER_A_F"], ["SpawnSoldier_03", "fow_s_ger_heer_rifleman"] ]; sleep 1; removeUniform SpawnSoldier_02;
  9. @Tostm8, _displayName = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName");
  10. https://community.bistudio.com/wiki/Variables#Scopes
  11. @Thorimus, sure, _vic1 is defined only in if-statement scope. For _vic1 to be defined outside, just place _vic1 = objNull; after _marker = ""; But don't forget check if _vic1 is null!
  12. @Thorimus, _marker = ""; {if ((markerText _x) == "Vehicle Here") exitWith {_marker = _x;};} forEach allMapMarkers; if (_marker != "") then { _vic1 = createVehicle ["C_Offroad_01_F", getMarkerPos _marker, [], 0, "NONE"]; };
  13. @Thorimus, _marker = ""; {if ((markerText _x) == "Vehicle Here") exitWith {_marker = _x;};} forEach allMapMarkers;
  14. @elthefrank, moreover, place setDir before setPos (see notes).
  15. Schatten

    read scripts from an addons

    @elthefrank, do not use @ symbol.
  16. @Lineman, use spawn instead of call.
  17. @[email protected], if I understood correctly: this and {!(triggerActivated Trigger2)}
  18. @[email protected], very strange... Do you use waypoint of "MOVE" type? If so, insert this code into "On act." field: (vehicle this) land "LAND";
  19. @[email protected], check each unit: _aliveUnits = (units (group player)) select {alive _x}; ({_x in vehicleName} count _aliveUnits) == (count _aliveUnits)
  20. @[email protected], you can't delete finally compiled functions. But you can delete objects (crows) created by function: {deleteVehicle _x;} forEach bis_crows;
  21. @gc8, look at example 2: https://community.bistudio.com/wiki/allTurrets.
  22. Schatten

    need help with trigger

    @twistking, seems like result of isTouchingGround command is still inaccurate. However, it works fine for me, at least in VR map. Well, it is also possible to check altitude: this and {({((getPos (vehicle _x)) select 2) < 0.5} count thisList) > 0}
×