Jump to content

thy_

Member
  • Content Count

    131
  • Joined

  • Last visited

  • Medals

Everything posted by thy_

  1. Folks, I'm running around without a perfect solution to rearm vehicles with turrets and vehicles with pylons. Simplifying many things, here is an example of my solution so far (and definitely not good enough for players who want to see each magazine get its pylon in those cases). Issue 1) Conditional: How to know if only X% (50%, for example) of the vehicle's mag capacity is available? I wanna check it to decide if the vehicle needs to rearm; // I found it, but I don't got what exactly is happening: ({getNumber (configFile >> "CfgMagazines" >> _x select 0 >> "count") == _x select 1} count magazinesAmmo _veh) == 0) Issue 2) Rearmament Execution: I already coded a solution to check and change the magazines in a turret, but I'm in trouble around pylons in planes and helicopters. Current solution: // File: veh_rearming.sqf private ["_veh", "_vehType", "_vehMags", "_magsRemoved", "_mag"]; while {true} do { _veh = vehicle player; // I'm using "player" just to simplify the example. For multiplayer missions, it doesn't work well and you must check each player in mission. if ( (count weapons _veh > 0) AND (speed _veh == 0) AND (({getNumber (configFile >> "CfgMagazines" >> _x select 0 >> "count") == _x select 1} count magazinesAmmo _veh) == 0) ) then { _vehType = typeOf _veh; _vehMags = compatibleMagazines _vehType; // figuring out all mags types are default for the vehicle. if ( _veh isKindOf "Plane" OR _veh isKindOf "Helicopter" ) then { // Specific and lazy solution for vehicles with pylons (planes and helicopters) to simplify the rearming as they work differently to turrets: [_veh, 1] remoteExec ["setVehicleAmmo", _veh]; playSound3D ["a3\sounds_f\sfx\ui\vehicles\vehicle_rearm.wss", _veh]; sleep 3; format [">> The %1 has been REARMED!", typeOf (vehicle player)] remoteExec ["systemChat", player]; } else { _vehMags = magazinesAllTurrets _veh; // list of all magazines (include the empty ones) and its data as projectiles left, etc. _magsRemoved = []; for "_i" from 0 to ((count _vehMags) - 1) do // building the removing mag looping from the amout of vehicle magazine capacity. { _mag = (_vehMags select _i) select 0; // selecting only the magazine classname; _veh removeMagazines _mag; _magsRemoved pushBack _mag; }; { // forEach for add new mags based on those ones already removed: _veh addMagazine _x; format [">> Ammo %1 on board...", _x] remoteExec ["systemChat", player]; playSound3D ["a3\sounds_f\sfx\ui\vehicles\vehicle_rearm.wss", _veh]; sleep 3; } forEach _magsRemoved; // if something goes wrong with reloading, this will help to fix as vehicle smoke granades sometimes don't reload: [_veh, 1] remoteExec ["setVehicleAmmo", _veh]; format [">> The %1 has been REARMED!", typeOf (vehicle player)] remoteExec ["systemChat", player]; }; } else { sleep 3; }; }; Inconsistencies of the solution above: If the vehicle is configured by Editor to spawn with NO AMMO, if you try to rearm that vehicle, it will never have this original number of magazines loaded; Vehicles with pylons are no working as other vehicles with turrets that each ammo is loaded individually (on its pylon in planes and helicopters); P.S.: No worries regarding drone vehicles. The download of my problematic example: https://drive.google.com/file/d/14vjjl3HsImEDfhybzbt_0YkJptuNYJru/view?usp=sharing
  2. 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.
  3. 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?
  4. 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.
  5. To make it easier, I already updated the first message and the download file with some progress. Some advice or code lines would be awesome from you.
  6. 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.
  7. Hi there, Vehicles Overhauling (VO) is a system of repairing, refueling, and rearming vehicles by proximity and with any asset of your choice. Also, the services are divided by doctrine: Ground, Air, and Nautical. Each doctrine and even service is easily turned Off or On, according to the editor's needs. If needed, the editor can allow repairing just for ground vehicles while unavailable for air ones, for example. Triggering or code via Eden Editor is needless. VO is configured through only one file, prioritizing implementation simplicity and quick change management that the mission editor might want. How to install / Documentation: https://github.com/aldolammel/Arma-3-Vehicles-Overhauling-Script/blob/main/vehicles-overhauling.VR/vehiclesOverhauling/_VO_Script_Documentation.pdf What to expect from VO script: Define what vehicle type have automatically access to ground, air or nautical services (rearm, repair, refuel); Define what service each station (asset) will provide: repair, refuel or rearm or all of them (full service); Every object/asset on Eden Editor can be traceable as station automatically, it's up to the mission-editor; Once defined which assets are stations, on Eden you just drag and drop the asset and the script will track them; All repair, refuel, and rearm Arma 3 and its DLCs assets are already tracked; All repair, refuel, and rearm RHS and CUP assets are already tracked; 100% compatible with CBA+ACE. No code or triggers is needed on Eden Editor; Just one file to set your mission needs easily: fn_VO_parameters.sqf; Script working as gold on hosted and dedicated servers; Demo: Main file > fn_VO_parameters.sqf: Dependencies: None! Download: From Github: https://github.com/aldolammel/Arma-3-Vehicles-Overhauling-Script From Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=2758919670 Missions running it: Tanks & Helicopters (Light) Tanks & Helicopters Livonia Tanks Theater TvT Bradley Furious - - - - - - - - - - - Changelog: 2022-Sep-27, v2.1: news, fixes and notes here. Known issues: Critical > Dedicated Server > If two or more players are in the same armed vehicle, the vehicle will rearm two or more times after spend some ammo ------ (WIP) Critical > RHS on > Air Doctrine > RHS airplanes are NOT rearming properly. ------ (WIP) Important > ACE on > Repairing > if the vehicle got damage only in wheels/tracks, guns and/or turret, the repairing doesn't run; Minor > ACE on > Refueling > I'm trying to hide the pump hose; Minor > ACE on > Repairing > If the vehicle starts to cook-off with a repair station close, the vehicle gets repaired, but still cooking. Cheers, thy
  8. Check this topic. Maybe it will help you:
  9. Working as gold in dedicated server as well 😉 Sorry for the delay.
  10. I'm finishing a script to release soon but I am facing an annoying bug around isTouchingGround I guess. // scope: checking if the "special boxes" are in good conditions: // _specialBox = _x; if ( !(isTouchingGround _x) OR (underwater _x) OR (speed _x > 0) ) exitWith { ["The box doesn't meet the conditions to work!"] remoteExec ["systemChat", _eachHumamPlayer]; }; What I expect: if the box/object is NOT touching the ground, or is under the water, or even is moving, that message above MUST shows up to the player. What is happening now: Even the object touching the ground, not underwater and totally stopped, the message is running for the player. Tests: If I remove just that piece "!(isTouchingGround _x)" everything runs as fine as possible with that important feature missing. I already checked the syntax and looks correct. I did a few investigations (below) about isTouchingGround bugs but no clue what exactly I am facing here. https://www.reddit.com/r/armadev/comments/fal7ko/whats_wrong_with_my_code/ https://forums.bohemia.net/forums/topic/149495-istouchingground-help-needed/ What am I missing?
  11. How to know if the vehicle has or not (true or false) weaponry? I mean, turret position or driver with this ability (as Air vehicles)? // NOT WORKING if ( {_vehPlayer weaponsTurret} count > 0 ) then { hint "Your veh has guns like someone from Texas..." } else { hint "This veh's kind of Brithish policeman..." };
  12. thy_

    Simple Rearm Script

    Hey @scottb613, a strategy I'm using in the new (and unpublished yet) version of the Vehicle Overhauling Script is to read with kind of ammo magazines the vehicles got, remove them with looping and, after that, add each new magazine again. _object = _this; _type = typeOf _object; _magazines = getArray(configFile >> "CfgVehicles" >> _type >> "magazines"); if (count _magazines > 0) then { _removed = []; { if (!(_x in _removed)) then { _object removeMagazines _x; _removed = _removed + [_x]; }; } forEach _magazines; { _object addMagazine _x; } forEach _magazines; }; _count = count (configFile >> "CfgVehicles" >> _type >> "Turrets"); if (_count > 0) then { for "_i" from 0 to (_count - 1) do { _config = (configFile >> "CfgVehicles" >> _type >> "Turrets") select _i; _magazines = getArray(_config >> "magazines"); _removed = []; { if (!(_x in _removed)) then { _object removeMagazines _x; _removed = _removed + [_x]; }; } forEach _magazines; { _object addMagazine _x; } forEach _magazines; _count_other = count (_config >> "Turrets"); if (_count_other > 0) then { for "_i" from 0 to (_count_other - 1) do { _config2 = (_config >> "Turrets") select _i; _magazines = getArray(_config2 >> "magazines"); _removed = []; { if (!(_x in _removed)) then { _object removeMagazines _x; _removed = _removed + [_x]; }; } forEach _magazines; { _object addMagazine _x; } forEach _magazines; }; }; }; }; _object setVehicleAmmo 1; // Reload turrets / drivers magazine Hope this piece of code brings ideas for you.
  13. Hey there, tudo bem com você? 😄 Just sharing with you all my configs for Visual Studio Code (VS Code), a simple and feasible coding tool for Arma 3, even in 2022 where, if you already tried to use some available extensions, may be frustrating. If you got some smart stuff to VS Code, please, be kind and share it here 😉 VS Code here on my end: VS Code > tool download (free): https://code.visualstudio.com/download (Win/Linux/Mac) VS Code > Essential extensions for Arma 3: SQF-VM Language Server by SQF-VM https://marketplace.visualstudio.com/items?itemName=SQF-VM.sqf-vm-language-server SQF Language Updated by blackfisch https://marketplace.visualstudio.com/items?itemName=blackfisch.sqf-language SQFLint by SkaceKachna https://marketplace.visualstudio.com/items?itemName=skacekachna.sqflint SQF Wiki by Eelis Lynne https://marketplace.visualstudio.com/items?itemName=EelisLynne.sqf-wiki VS Code > extensions recommended: Theme: Atom One Dark Theme https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark VS Code > My customs to help for ARMA: Ctrl+Shift+P; Type "settings.json" (no quotes) and select "Open USER settings (json)"; Adapt the code below for your like: { "sqf.enableCBA": true, "sqf.enableACE3": true, "workbench.iconTheme": null, "workbench.colorTheme": "Atom One Dark", "editor.minimap.enabled": false, "breadcrumbs.enabled": false, "editor.renderWhitespace": "all", "workbench.activityBar.visible": false, "zenMode.hideLineNumbers": false, "security.workspace.trust.untrustedFiles": "open", "editor.wordWrap": "on", "diffEditor.wordWrap": "on", "files.autoSaveDelay": 5000, "editor.tokenColorCustomizations": { "[Atom One Dark]": { "variables": "#eb54de", "functions": "#ff9b58", "numbers": "#49f5b3", "strings": "#70fa20", "keywords": "#fc6620", "comments": "#505050", "types": "#0004ff", "textMateRules": [ { "scope": ["constant.other"], "settings": { "foreground": "#1400c4" } }, { "scope": ["support.function"], "settings": { "foreground": "#fff5cb", "fontStyle": "italic" } }, { "scope": ["keyword.operator"], "settings": { "foreground": "#7ee9fc", "fontStyle": "bold" } }, { "scope": ["variable.language"], "settings": { "foreground": "#a13140" } }, { "scope": ["meta.function-call"], "settings": { "foreground": "#fc6620" } }, { "scope": ["punctuation.terminator"], "settings": { "foreground": "#ffffff" } }, ] } }, "editor.semanticHighlighting.enabled": true, "editor.semanticTokenColorCustomizations": { "[Atom One Dark]": { "enabled": true, "rules": { "*.declaration": { "bold": true } } } }, "files.associations": { "*.json": "jsonc" }, "C_Cpp.autocompleteAddParentheses": true, "sqflint.checkPaths": true } Share your thoughts and exp 😉
  14. Pretty sure I'm stepping through a basic question but, really, I've TRIED hard all this afternoon to find out on my own how to make the forEach understand the array content are trigger variable names already dropped in place via Eden Editor. myTriggersVarNames = [ "myTrg1", "myTrg2", "myTrg3" ]; while {true} do { // Doesn't work: { if (player inArea _x) then { systemChat "Player inside the trigger"; }; } forEach myTriggersVarNames; // Working fine: /* if (player inArea myTrg1) then { systemChat "Player inside the trigger" }; */ sleep 3; }
  15. Forget. 🤣 If the Trigger's array got one or more vanames and those triggers don't exist on Eden Editor, the "Error Undefined Variable" is shown up. Thanks.
  16. You right, @Harzach. I didn't notice, even though with the error below, that forEach works in my tries with no quotes. Some advice to avoid this error? It says the trigger var names are not defined. How can I define them since they're just triggers?
  17. Hey there, hope this message finds you well. I just read a bit around this below, but no clue how I'll know through the code if the player's vehicle is amphibious. All I want is a bool value as a return. https://community.bistudio.com/wiki/CfgVehicles_Config_Reference#canFloat I've already investigated: https://community.bistudio.com/wiki/BIS_fnc_objectType https://community.bistudio.com/wiki/isKindOf https://community.bistudio.com/wiki/typeOf
  18. 🙂 PAC is a simple script that controls the map limits for players in multiplayer, preventing players from leaving the mission area allowed by the mission editor. Designed for dedicated and hosted servers, doesn't matter what mods are loaded or not. How to install / Documentation: https://github.com/aldolammel/Arma-3-Playable-Area-Control-Script/blob/main/_PAC_Script_Documentation.pdf What to expect from PAC script: Playable area defined by just one named trigger added in the Eden Editor itself; 100% functional in Dedicated Server; The editor has the option to allow or not air vehicles (including drones) to be tolerated when outside the playable area; The editor has the option of allowing or not air vehicles outside the playable area to have restrictions on minimum speed; The editor has the option to allow or not the PAC to issue text and sound notifications when the player is outside the playable area; Compatible with ACE and any other popular mod; Compatible with missions that use BIS respawn system; Full documentation. Demo: Main file > initPlayerLocal.sqf (no respawn needed) Main file > onPlayerRespawn.sqf (respawn needed) Dependencies: None! Missions running it: All my missions - - - - - - - - - - - - - - - Changelog: 2022-Aug-24, v1.5: news, fixes and notes here. Download: From Github: https://github.com/aldolammel/Arma-3-Playable-Area-Control-Script From Steam Workshop (no respawn): https://steamcommunity.com/sharedfiles/filedetails/?id=2835758829 From Steam Workshop (with respawn): https://steamcommunity.com/sharedfiles/filedetails/?id=2835759780 Known issues: None yet. Cheers, thy
  19. Thanks, @pierremgi For you that won't download the file above: 0) Drag and drop the convoy vehicles, connecting each other to be the same group; 1) Copy and paste the code line below in the INIT of the group composition; if (isServer) then {this execVM "TOV_fnc_SimpleConvoy.sqf"}; 2) Into your mission folder, create the file TOV_fnc_SimpleConvoy.sqf, adding in its content: // Original Bohemia Forums post: https://forums.bohemia.net/forums/topic/226608-simple-convoy-script-release/ params [["_convoyGroup", grpNull],["_convoySpeed", 50],["_convoySeparation", 50],["_condition", {false}]]; systemChat str _convoyGroup; _convoyGroup setFormation "COLUMN"; _convoyGroup setBehaviour "SAFE"; private _vehicles = vehicles select {group _x == _convoyGroup}; systemChat str _vehicles; { _x limitSpeed _convoySpeed*1.15; _x setConvoySeparation _convoySeparation; driver _x setCombatBehaviour "CARELESS"; } forEach _vehicles; waitUntil {sleep 5; (!isNull _convoyGroup) && !(call _condition) }; { _x limitSpeed _convoySpeed*1.15; _x setConvoySeparation _convoySeparation; driver _x setCombatBehaviour "CARELESS"; } forEach _vehicles; _convoyGroup enableAttack true;
  20. Added. Using it. Somehow, the script doesn't work properly anymore. As @YarnoR said, (and even with just the vanilla loaded) the vehicle behaviors are awful in my tests, going out of the way at the beginning. Look by your self and any help could clarify for many of us: https://drive.google.com/file/d/1CaNtFI2zwSY3SRtokWRdC-j33PXtHOmJ/view?usp=sharing
×