Jump to content

thy_

Member
  • Content Count

    344
  • Joined

  • Last visited

  • Medals

Everything posted by thy_

  1. 😅 It will be a script where you drag and drop area-markers on Eden Editor, re-name them and that's it. Through a parameter file, you manage everything about your minefields. WIP, just one of some functions: THY_fnc_DAMM_minefields_scanner = { // This function search and append in a list all area-markers confirmed as a real minefield. The searching take place once right at the mission begins. // Returns _confirmedMinefields. params ["_prefix", "_spacer"]; private ["_realPrefix", "_acceptableShapes", "_txtDebugHeader", "_txtWarningHeader", "_txtWarning_1", "_confirmedMinefields", "_possibleMinefields", "_index", "_mfNameStructure", "_spacerAmount", "_itShouldBeNumber"]; _realPrefix = _prefix + _spacer; _acceptableShapes = ["RECTANGLE", "ELLIPSE"]; // Debug txts: _txtDebugHeader = "DAMM SCRIPT DEBUG >"; _txtWarningHeader = "DAMM SCRIPT WARNING >"; _txtWarning_1 = format ["If the intension is make it as minefield, its sctructure name must be '%1number'. Otherwise, just ignore this message.", _realPrefix]; // Initial values: _confirmedMinefields = []; // Step 1/2 > Creating a list with only area markers with right prefix: if ( !DAMM_debug ) then { // Smarter and faster solution, searching and creating the list: _possibleMinefields = allMapMarkers select { (_x find _realPrefix == 0) AND {(markerShape _x) in _acceptableShapes} }; } else { // As the slower solution, for debugging purporses, the way to select the relevant markers here it is slightly different. Now searching for all marker shapes: _possibleMinefields = allMapMarkers select { _x find _realPrefix == 0 }; { // forEach _possibleMinefields: // It will be needed to identify what will be deleted later: _index = _possibleMinefields find _x; // if the marker has no the shapes acceptables, do it: if ( !((markerShape _x) in _acceptableShapes) ) then { // delete the marker from the list: _possibleMinefields deleteAt _index; // delete the marker from the map: //deleteMarker _x; // and print this messages: systemChat format ["%1 Marker '%2' has NO a rectangle or ellipse shape to be considered a minefield.", _txtDebugHeader, _x]; }; } forEach _possibleMinefields; }; // Step 2/2 > Deleting to the list those selected markers that don't fit the name's structure rules: { // forEach _possibleMinefields: // check if the marker name has more than one _spacer character in its string composition: _mfNameStructure = _x splitString ""; _spacerAmount = count (_mfNameStructure select { _x find _spacer isEqualTo 0}); // if the _spacer is been used correctly: if ( _spacerAmount == 1 ) then { // spliting the marker name to check its structure: _mfNameStructure = _x splitString _spacer; // picking up the second/last string and convert it to integer: _itShouldBeNumber = parseNumber (_mfNameStructure select 1); // result will be a number extracted from string OR ZERO if inside the string has no numbers. // if the second/last string is numeric, and the marker structure's name is composed by 2 strings, do it: if ( _itShouldBeNumber != 0 AND ((count _mfNameStructure) == 2) ) then { // the area marker represents a confirmed minefield: _confirmedMinefields append [_x]; //if ( DAMM_debug ) then { systemChat format ["%1 The marker '%2' is a confirmed minefield.", _txtDebugHeader, _x] }; } else { // Warning message: systemChat format ["%1 Marker called '%2' has NO a valid name. %3", _txtWarningHeader, _x, _txtWarning_1]; }; } else { // Warning message: systemChat format ["%1 Marker called '%2' has more than 1 prefix spacer (%3). %4", _txtWarningHeader, _x, _spacer, _txtWarning_1]; }; } forEach _possibleMinefields; // Debug message: if ( DAMM_debug ) then { systemChat format ["%1 Minefields built: %2", _txtDebugHeader, _confirmedMinefields] }; // Returning: _confirmedMinefields; };
  2. // Lots of code... _acceptableShapes = ["RECTANGLE", "ELLIPSE"]; _prefix = "mark_"; if ( !_debug ) then { // Selecting only relevant markers: _areaMarkersOnly = allMapMarkers select { (_x find _prefix == 0) AND {(markerShape _x) in _acceptableShapes} }; } else { // For debugging purporses, the way to select the relevant markers here it is slightly different. Now selecting all markers shapes: _areaMarkersOnly = allMapMarkers select { _x find _prefix == 0 }; { // forEach _areaMarkersOnly: // _x index in the list, need it to delete _x from the list: _markerIndex = _areaMarkersOnly find _x; // if the marker has no the shapes acceptables, do it: if ( !((markerShape _x) in _acceptableShapes) ) then { // delete the marker from the list: _possibleMinefields deleteAt _markerIndex; // delete the marker from the map: deleteMarker _x; // and print this messages: systemChat format ["DEBUG > Marker '%1' has NO a rectangle or ellipse shape to be considered a area marker.", _x]; }; } forEach _areaMarkersOnly; }; // Lots of code...
  3. 😅 but how could I save the search in the _markersToReview array in this specific case?
  4. This code line through the slicing method is so elegant 🙂
  5. Added in main post code block the "selectionHighlightBackground" customization 😉 Cheers!
  6. Script has been updated 😎 Jan, 20th 2023 | v2.8: Improvement > You can define through fn_CSWR_loadout.sqf file a custom helmet for infantry and other only for heavy armored crewmen; Documentation has been updated.
  7. Oh, It would be very much appreciated. 😉
  8. I just made a video explaining how to use the script. The head's topic has been updated.
  9. Hey, @Blitzen88 This down below is my current solution for the CSWR script where you are able to change backpacks, vests and uniforms without losing the items in the original unit gears. Perhaps you can find out inspiration to run through your needs:
  10. Let me test the script with respawn system to check if the script is running more times for some unknown reason...
  11. Again: there is NO respawning in the CSWR script, @avibird 1. If you populate just 4 OpFor soldiers with CSWR, and you got your mission configured to finish if all OpFor is dead, the mission will be finished as expected, @avibird 1.
  12. @avibird 1 ?? Let me help you: Open your fn_CSWR_population.sqf, set the BLUFOR like down below and I promise that you'll see just 4 blufor soldiers spawning at once. So, why "units never stop spawning"? if (CSWR_spawnBlu) then { // DEFINING GROUPS: BLUFOR // Define the number of soldiers and who is who in each type of group. // Vehicles private _bluVehLight = ["B_G_Offroad_01_armed_F"]; // Soldiers private _bluSquadLight = ["B_Soldier_TL_F", "B_Soldier_F"]; // SPAWNING GROUPS: BLUFOR // Define each group and their features and destination. // Vehicles Groups // [ faction, faction's spawnpoints, faction's vehicle size, initial crew behaviour ("SAFE", "AWARE", "COMBAT", "STEALTH", "CHAOS"), vehicle waypoints ] [BLUFOR, CSWR_bluSpawnPoints, _bluVehLight, "SAFE", THY_fnc_CSWR_wpGoToAnywhere] call THY_fnc_CSWR_vehicle; // Soldiers Groups // [ faction, faction's spawnpoints, faction's squad size, initial squad behaviour ("SAFE", "AWARE", "COMBAT", "STEALTH", "CHAOS"), squad waypoints ] [BLUFOR, CSWR_bluSpawnPoints, _bluSquadLight, "SAFE", THY_fnc_CSWR_wpGoToAnywhere] call THY_fnc_CSWR_people; }; // blufor ends. I DO recommend you to run the example and, through Zeus ("Y" key), watch the sides playing. The CSWR will spawn exactly and just the number of unit groups you have set in fn_CSWR_population.sqf.
  13. I'm trying hard to understand why I should stop the spawning of my unit groups IF this script was built to spawn all units at once and in the mission starts... 🙄 Lets read the first topic again: "CSWR is a simple and limited spawn and waypoints solution (...)".
  14. CSWR is a script to create spawn points for AI, be it from any Side. After the AI units spawn where you authorized the AI to be spawned, the CSWR will tell the AI to go to some points of interest (pre-defined waypoints) that you allow the AI to go. Having said all that, it's not possible to disable the spawn functionality because the script is made for exactly that. If you don't wanna units to spawn in a specific area, just don't set any spawn points in that region. CSWR is just to spawn the AI (once right before the mission starts), not to Re-spawn them (once more or multiple times). The focus here is to populate a mission map as fast as possible, giving customization options like: For which Side(s) you want to spawn dynamically and how big each side's unit group must be; Where the AI units will spawn randomly through the pre-defined spawn points (landmarks) dropped on the map; To where AI is able to go (forever) randomly through the pre-defined waypoints (landmarks) dropped on the map, also randomly taking a break or non-stop movements; What is the behavior of each unit group, even when in vehicles; What loadout the side's unit groups must have (On each side, you can for example remove all night visions goggles, or add a specific item, or even change their backpack without losing the items inside the original unit's backpack, preserving their ammo and stuff); No. All pre-defined side unit groups will spawn right before the mission starts. @avibird 1, feel free to ask anything about the script. And for detailed information, you got the documentation as well: https://github.com/aldolammel/Arma-3-Controlled-Spawn-And-Waypoints-Randomizr-Script/blob/main/controlled-spawn-and-waypoints-randomizr.VR/CSWRandomizr/_CSWR_Script_Documentation.pdf Cheers.
  15. Script has been updated 😎 Oct, 18th 2022 | v2.7 Fixed > Crewmen were not getting customized loadout; Improvement > fn_CSWR_debug.sqf file has been merged with fn_CSWR_spawnsAndWaypoints.sqf one; Improvement > Now, mission editor has a specific file to customize their AI units: fn_CSWR_loadout.sqf; Improvement > Loadout function is much more reliable to custom; Documentation has been updated. The first post was updated as well!
  16. EDITED on Oct 13th, 2022: Folks, here is the best solution I have developed to rearm ground vehicles (works fine with nautical too but not really reliable with air vehicles, mainly from RHS, CUP, etc), so feel free to check the code and point fixes, changes, improvements. THY_VO_functions.hpp fn_VO_parameters.sqf fn_VO_globalFunctions.sqf fn_VO_coreGrd.sqf Download the current solution: https://drive.google.com/file/d/1Ls2ZYb3ibb8mRZYJ7u4p_KBZwwGt04Hx/view?usp=sharing
  17. Btw, thanks, @avibird 1. Good fellas, the first topic message has been edited with my "final" solution for u to evaluate. Just letting you know, this rearm solution is part of my Vehicles Overhauling Script:
  18. Changelog V0 v2.2: FIXED - when feedback messages On, the messages are shown just for the vehicle owner and not for the whole crew team; FIXED - bug where vehicles are rearming even when there's no on-board weaponry; FIXED - bug where drones could not get serviced when the player wasn't close.
  19. Oi, @avibird 1 @avibird 1 , I hope your code can bring ideas or, at least, help those who are looking for a simpler solution. Yes, please.
  20. Hey, tudo bem com você? 🤓 Gentlemen, I've read the Jets DLC functions to understand how the USS Freedom Carrier accepts landings by planes with tailhook, 'cause I wanna print out a hintSilent "You did it!", but only and precisely at that cables area (X, Y, Z), even if the Mission Editor changes the carrier's spot. A3_Jets > BIS_fnc_AircraftTailhook A3_Jets > BIS_fnc_AircraftTailhookAi How can I smartly track that area to print out the message with no triggers and hidden objects dropped around?
  21. Just coming back to share the solution is present in my Vehicle Overhauling Script: Thanks, @pierremgi, and @Larrow for the ideas. Resuming the solution: Instead of looking for cables in the aircraft carrier asset, reading the Jets DLC functions, I realized that the USS Freedom asset is composed of 3 smaller assets. I've stored your asset classnames in a list, and as soon as a plane approaches any classname within the list, the plane gets the action to rearm, repair, and refuel. fn_VO_parameters.sqf: VO_assetsRangeChanger = ["Land_Carrier_01_hull_08_1_F","Land_Carrier_01_hull_07_1_F","Land_Carrier_01_hull_06_1_F"]; fn_VO_globalFunctions.sqf THY_fnc_VO_isStationRangeChanger = { // This function checks if the current station has the ability to change its service range to attemp planes only. If so, the range is increase where _servRng != _currentRng. // Returns the integer range _currentRng. params [["_stat", objNull], ["_veh", objNull], ["_hasRngChanger", false], ["_servRng", 20]]; private ["_rangeChanger", "_currentRng", "_statType"]; _rangeChanger = 80; _currentRng = _servRng; if ( !_hasRngChanger ) exitWith { _currentRng /* Returning. */ }; // Handling Errors: if (_stat isEqualTo objNull) exitWith {if (VO_debugMonitor) then {systemChat "VO > THY_fnc_VO_isStationRangeChanger error: needs a station as parameter."; sleep 15}}; if (_veh isEqualTo objNull) exitWith {if (VO_debugMonitor) then {systemChat "VO > THY_fnc_VO_isStationRangeChanger error: needs a vehicle as parameter."; sleep 15}}; _statType = typeOf _stat; // Range-Changer trigger to action: if ( _veh isKindOf "Plane" AND _statType in VO_assetsRangeChanger ) then { if ( _servRng < _rangeChanger ) then { _currentRng = _rangeChanger }; if ( VO_debugMonitor AND (_currentRng >= _rangeChanger) AND ((_veh distance _stat) <= _currentRng) ) then { systemChat format ["DEBUG: station %1 is a RANGE-CHANGER, its service range increase to %2m for Planes.", _statType, _currentRng]; sleep 3; }; }; _currentRng // returning. }; Cheers, thy SOLVED.
  22. Everyone, the script has been updated. The first message on this topic is already updated too: 😊 Changelog VO v2.1: NEW - Now Aircraft Carrier USS Freedom asset can provide all services exclusively for planes. Others vehicles from air and ground doctrine will need some specific assets on carrier's deck to access their available services; NEW - Amphibious vehicles even from Air or Ground doctrine are allowed to get services at stations of Nautical doctrine; NEW - When debug is true, the mission editor has now an expanded handling error messages and other alerts to help them to find out misconfiguration; FIXED - fixed the rearming issues around vehicle with different amount of magazines and turrets; FIXED - fixed the bug (remoteExec) in Dedicated Server with parking helper assets weren't doing correctly the plane manouver inside the hangars; FIXED - bug that made ground and nautical vehicles with complex weaponry don't rearm properly; FIXED - bug that, after a landing, helicopters were able to rearm if they take off but stay into the service range, even on air; PERFORMANCE IMPROVED - more functions, less repeatable code lines; PERFORMANCE IMPROVED - duplicated content inside asset arrays are automatically deleted; Documentation has been updated.
×