Jump to content

soldierXXXX

Member
  • Content Count

    100
  • Joined

  • Last visited

  • Medals

Everything posted by soldierXXXX

  1. Based on the provided script, these drones have their own specific behaviour writen in init field. They are not fully functional until the westDroneTrigger is activated. Then the script creates random waypoints inside marker named "westDroneMarker" and then drone seeks the enemy until it finds one. Maybe one drone knew about the target while other didn´t. Then the script deletes created waypoints and proceeds to target until it reaches 30 meters from the target. I´m not sure what _temp does. Probably some descent or something. After that the drone falls off which activates the bomb in killed EH. _this has nothing to do with it. The script i provided just moves the drones to position you click on the map nothing else, because in your original question you asked: Next If i understand it right, naming would not help you in this case unless you want to control the drones different way (manually write code for each drone). Never try to combine two different scripts if you don´t know what you´re doing (practice first on easier scripts and try to learn what does what). If you did this, it would only create syntax errors because this and later _this in init fields of the drones refers to the drone itself while _allUAVs refers to array of all possible drones and it´s part of the other script. That means _allUAVs variable is not visible to other scripts.
  2. I have a better solution for you. This will work if you have units already spawned. _allUAVs = allUnitsUAV; _allUAVs = _allUAVs select {side _x == west AND canMove _x}; _allUAVs onMapSingleClick "{_x move _pos} forEach _this; target_zone = true; onMapSingleClick ''; true";
  3. Yes, but it depends how you want your script to work. If you perhaps creating vehicle you can simply refer to it like this in the same scope the code runs. _veh = createVehicle ["B_UAV_02_dynamicLoadout_F", position player, [], 0, "FLY"]; _veh onMapSingleClick "_this move _pos; target_zone = true; onMapSingleClick ''; true";//must be in the same scope as the code to run this way If you want to refer to already existing UAV you can return UAV vehicles with command allUnitsUAV and apply filter that suits your needs on them to return like for example the closest UAV. _allUAVs = allUnitsUAV; _allUAVs = _allUAVs select {side _x == west AND canMove _x}; _allUAVs = _allUAVs apply {[_x distance player, _x]}; _allUAVs sort TRUE; _closestUAV = _allUAVs select 0 select 1; _closestUAV onMapSingleClick "_this move _pos; target_zone = true; onMapSingleClick ''; true"; But of course, naming the UAV you want to use is the simplest way 🙂.
  4. _this refers to parameter you pass to onMapSingleClick. In your case you used the main syntax instead of alternative syntax so _this doesn´t work. Try it like this. Drone onMapSingleClick "_this move _pos; target_zone = true; onMapSingleClick ''; true";
  5. Hi. Unfortunately setAirplaneThrottle works only on player´s aircraft. However there is another command forceSpeed, which might do exactly what you need. You can test it with airplaneThrottle command. Here is example code. PathJet1 = [path data...]; Jet1 engineOn TRUE; Jet1 setVehicleTIPars [1, 1, 1];//sets the heat so the plane isn´t "cold" pilotJet1 doMove [-7974.6,30547.9,678.112];//assures that engines stays on (i personally use this every time) Jet1 forceSpeed 1100;//simulates throttle private _Jet1Path = [Jet1,PathJet1] spawn BIS_fnc_UnitPlay; sleep 5; hint str airplaneThrottle Jet1;//should return 1 waitUntil {sleep 2;scriptDone _Jet1Path}; PathJet1 = nil; Jet1 forceSpeed -1;//returns throttle to normal
  6. soldierXXXX

    adding map locations

    Okey i think i´ve found the problem. The module you have to spawn if you want to have OPCOM up and running first checks the config of the terrain. If the terrain has less than 3 locations, the module init function exits with error message. So no matter what you do, unless you create mod which adds necessary config of the locations to the map or map author adds them, this mod won´t work. This i´ve found in module init function. Not gonna post the whole code, because this is all you need to know. Or you might contact directly OPCOM developer and ask him to add support for locations created with createLocation command. Shouldn´t be that hard for him to add another condition which checks nearestLocations if config won´t find normal map locations 🙂. //--- check if map has at least three locations, otherwise abort OPCOM initalization private ["_locCnt"]; _locCnt = count (configFile >> "CfgWorlds" >> worldName >> "Names"); if (_locCnt < 3) exitWith {....
  7. soldierXXXX

    adding map locations

    Hi. Maybe this is the command you´re looking for ? createLocation If this will not work, then you have to contact the map maker and ask him to fix locations.
  8. soldierXXXX

    Problem with "knowsAbout" command

    To answer your questions. Creating unit this way returns value-object so it's preferable if you have further plans with the unit itself. Your method is good but doesn't return anything upon creation and knowsAbout depends on unit/object which we need to supply. Using private is more like force of habit for me. It protects local variables from being overwritten. It's not really necessary for this script. Yes absolutely right. waitUntil is there to stop the script until desired condition is met. Also sleep command is better to use for codes which are not needed to be time perfect. Otherwise without it it would check every frame. To use sleep in it is better for script optimization. After the condition is met script continues. I'm glad i could help :-).
  9. soldierXXXX

    Problem with "knowsAbout" command

    Hi. I spotted several mistakes you made. knowsAbout needs object/unit to work. With alternative syntax createUnit you can´t return object when you create it. If condition won´t work if player doesn´t know about unit immediately. So to make this work you do it like this. if (!canSuspend) exitWith {hint "script is not executed in scheduled environment and thus will not work properly"};//this line is to check script environment-execute script in init.sqf, execVM or spawn private _enemyteam=createGroup east; //created enemy group _enemyteam deleteGroupWhenEmpty TRUE;//Marks given group for auto-deletion when group is empty private _specificUnit = _enemyteam createUnit ["O_Soldier_F", getMarkerPos "marker3", [], 0, "NONE"];//use this syntax instead because it returns unit and you can work with it further waitUntil {sleep 1;(player knowsAbout _specificUnit) > 0};//you need to use waitUntil because player doesn´t know about unit immediately when it spawns hint "Enemy spotted";
  10. soldierXXXX

    Random Intel Items

    [_x,_intelItems] spawn soldierXXXX_fnc_randomItem; If you use the syntax this way then every unit which it is used for should get random item if they have spare space in their inventory 😉.
  11. soldierXXXX

    Random Intel Items

    Hi. Items which you want to add to inventory won´t have the same class name as they have in editor. In most cases it´s enough if you delete the prefix "Item_" but in some cases the item will have totally different name. I´ve fixed it for you 🙂. I´ve put together a function which should add the possibility for every unit to have some item generated. It´s a bit different aproach than @7erra has, but Arma is a game with a lot of ways to achieve things and every single one of us has its own style 😄. Take a look 🙂.
  12. For anyone interested, here are the defines of exitcodes (or emulated buttons) extracted from defineResincl.inc . Thank you @pierremgi for pointing it out 🙂 . #define IDC_OK 1 #define IDC_CANCEL 2 #define IDC_AUTOCANCEL 3 #define IDC_ABORT 4 #define IDC_RESTART 5 #define IDC_USER_BUTTON 6 #define IDC_EXIT_TO_MAIN 7
  13. soldierXXXX

    Keep createDisplay open

    Hi @sizraide Try this with your original code: // Add UI EventHandler _displayHandler = _display displayAddEventhandler["KeyDown",{ params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"]; private _rewriteKey = FALSE; if (_key == 1) then {systemChat "button esc clicked";_rewriteKey = TRUE;}; _rewriteKey }]; // Remove displayHandler _display displayRemoveEventHandler ["KeyDown", _displayHandler]; I´ve added eventhandler to your created display instead of mission display for the clarity purposes. Just to be sure you might also consider using disableSerialization. I´m not sure if this is actually needed but i personally use it every time i work with scripts that are using UI elements. Let me know if that helped 🙂
  14. Hi again. The code that wrote @Harzach is great 🙂. I like specialy the function that adds interaction to the key 😄 so cool. And i have to correct myself for i thought the function is only available for multiplayer-that is not true it works perfectly fine in SP. IDK why it didn´t work yesterday when i tried it 😄. However one thought got on my mind and that was what if you wanted to create like keybox ? Where you want to have keys for more than one vehicle (assigned keys) and you don´t wish to use civil key as dummy key (to not look so obvious)? Well when i dig deeper into ace code and i figured out if you want to have key registered you only have to register it to object variable ""ace_vehiclelock_customkeys"" and the vehicle lock system takes care of the rest. So i had an idea for such script. It´s also created with Take eventhandler but it could be adjusted for more cars. If you´re interested take a look 🙂. I put this into init.sqf and as i tested it, it should work-keys stays assigned as they were. You can place them on ground, back into furniture or inside cars (sometimes it´s a bit hard to detect which key you actually have). Well you can ignore this post if you want 😄 i just wanted to post it for anyone that might be interested in same thing 🙂. only thing you have to adjust is: c1 addMagazineCargoGlobal ["ACE_key_customKeyMagazine", 3]; c1 setVariable ["availableKeysCars",[car1,car1_1,car1_2]]; where c1 is the furniture, 3 is number of keys to be added and [car1,car1_1,car1_2] is the array for vehicles in order that will get their key registered when you take the keys from furniture. And if you want more units to be able to register the keys, they need to have the same eventhandler and it will work (tested with another playable unit). At the start player has two already registered keys for car1 in his inventory (i wanted to test it if it´s possible to register keys without using ace action and kept it there). //========================================================================================================================================================================================================= //with this you can automaticly assign more than one key that you already have in inventory to unlock car1-great at mission start-usefull when you want to give access to car1 to someone else but you want another key to be able to un/lock it player addMagazine "ACE_key_customKeyMagazine"; player addMagazine "ACE_key_customKeyMagazine"; arrayActiveKeys = [];//this array is most important-needs to be available for both functions-checks all active keys {if (((toLowerANSI _x) find "ace vehicle key") != -1) then {arrayActiveKeys pushBack _x};} forEach (magazinesDetail player);//this registers keys from players inventory //hint str arrayActiveKeys; private _copyArrayActiveKeys = +arrayActiveKeys; car1 setVariable ["ace_vehiclelock_customkeys",_copyArrayActiveKeys];//this syntax setups the keys that player has in inventory for car1 //========================================================================================================================================================================================================= //this is a function to simulate more than one key in furniture-needs to be assigned by Take eventhandler //Be aware that for Multiplayer usage the code would probably need some tweaks (like publicVariable arrayActiveKeys and so on) c1 addMagazineCargoGlobal ["ACE_key_customKeyMagazine", 3];//number of keys should match with availableKeysCars array c1 setVariable ["availableKeysCars",[car1,car1_1,car1_2]];//you can copy this and assign different vehicles for different furnitures f1 addMagazineCargoGlobal ["ACE_key_customKeyMagazine", 2]; f1 setVariable ["availableKeysCars",[b1,b2]]; soldierXXXX_fnc_Get_AddedKey = { private _foundKeys = []; {if (((toLowerANSI _x) find "ace vehicle key") != -1) then {_foundKeys pushBack _x};} forEach (magazinesDetail _this); private _foundNewKeys = []; {if (!(_x in arrayActiveKeys)) then {_foundNewKeys pushBack _x};} forEach _foundKeys; if (_foundNewKeys isNotEqualTo []) exitWith {_foundNewKeys select 0}; ""//returns "" if the key is registered }; soldierXXXX_fnc_ACE_VehLock_TakeEH = { params ["_unit", "_container", "_item"]; private _AddedKey =_unit call soldierXXXX_fnc_Get_AddedKey; if (_AddedKey == "") exitWith {hint "This key is already registered"}; if (_container getVariable ["availableKeysCars",[]] isNotEqualTo []) then {//if the container has unregistered keys available private _currentCarAvailable = _container getVariable "availableKeysCars"; private _currentCar = (_currentCarAvailable select 0); private _currentACEVEHvar = (_currentCar getVariable ["ace_vehiclelock_customkeys",[]]); _currentACEVEHvar pushBack _AddedKey; arrayActiveKeys pushBack _AddedKey; _currentCar setVariable ["ace_vehiclelock_customkeys",_currentACEVEHvar]; _currentCarAvailable deleteAt 0; _container setVariable ["availableKeysCars",_currentCarAvailable]; hint format ["Key taken for:%1\nUnreleased keys available for:%2",_currentCar,(_container getVariable "availableKeysCars")]; }; }; player addEventHandler ["Take", { params ["_unit", "_container", "_item"]; if ((_item isEqualTo "ACE_key_customKeyMagazine")) exitWith { _this spawn soldierXXXX_fnc_ACE_VehLock_TakeEH; }; }]; //============================================================================================================================================================================================================ I´m attaching Uploaded mission (stored for 30 days) . If you interested you can try it 🙂
  15. No that´s not possible. That´s because when using ace_vehiclelock_fnc_addKeyForVehicle with customKey parameter set to TRUE, the script behaves differently (and works only in MP environment). The script works with command magazinesDetail which returns vehicle/unit magazines with their specific ID, but it can´t return magazines from object that can´t shoot (will return [] for objects like civil cars, boxes etc...). Your best bet for making custom key for the car is to add the key directly to player with [player, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle; and not into furniture.
  16. @SGT Major Ray Jefferson You might be looking for different command. This might do what you're trying to achieve if it's ok that it's just an inventory item and it's not visible ON the furniture. c1 addItemCargo ["ACE_key_civ", 1];
  17. soldierXXXX

    Help with sleep command

    @FenixDK based on your code, you might do it like this: Version without sleep: Advantage of this is that you don´t have to create another file and just call it directly from description.ext . i assume grad_moneymenu_fnc_setFunds is already declared. And there is no need to compare type of unit. XEH does it for you. //description.ext class Extended_InitPost_EventHandlers { class LOP_ISTS_Infantry_SL { class Money_init_eh { init = "[(_this select 0),100] call grad_moneymenu_fnc_setFunds"; }; }; class LOP_ISTS_Infantry_GL { class Money_init_eh { init = "[(_this select 0),25] call grad_moneymenu_fnc_setFunds"; }; }; }; Version with sleep: There is a little more you have to do. Instead of compiling the same file over and over again i would declare it as global variable and spawn it like this. But i´m not sure why you would add money to unit after some time (it just doesn´t make sence to me). But you might use similar aproach in some other code. //money.sqf params ["_unit","_amount"]; sleep 5; [_unit,_amount] call grad_moneymenu_fnc_setFunds; //init.sqf or initPlayerLocal.sqf TAG_fnc_Money = (compile preprocessFileLineNumbers "money.sqf"); //description.ext class Extended_InitPost_EventHandlers { class LOP_ISTS_Infantry_SL { class Money_init_eh { init = "[(_this select 0),100] spawn TAG_fnc_Money"; }; }; class LOP_ISTS_Infantry_GL { class Money_init_eh { init = "[(_this select 0),25] spawn TAG_fnc_Money"; }; }; }; Hope this helps 🙂 .
  18. soldierXXXX

    Image over HUD Issue

    You can solve it by using radius parameter. 🙂 criticalNote = note1 addAction ["Read Critical Information...", {[[_this select 0], "scripts\mission\note\criticalNote.sqf"] remoteExec ["execVM", 0, true];},nil,1.5,true,true,"","true",3,false];
  19. soldierXXXX

    SOLVED Finding UXO's

    Hi again. Yesterday i read few articles and i think i learned something, but i would have to create my own function as addon to see myself how it behaves. At least now i know what you´re trying to achieve. When i thought about it, the function ran in main menu because it was called as mod and there was no restriction present. So i updated the main code and slightly also the search function (global variables were not needed at all). I assume you don´t want your function to end during mission so i removed the restrictions i put earlier. But i decided to keep the debug hints so you can see youself how the function behaves now. It can be simplified even more. Let me know how it works. I´m curious 😄 EODS_MDET_fnc_getNearestUxo = { scriptName "EODS_MDET_fnc_getNearestUxo"; private ["_found", "_nearestUxo", "_DetectionPoint", "_allUxo", "_Uxo", "_distance","_uxoType","_ArrUXOs","_EODVarRadius","_EODVarAngle"]; _uxoType = ["rhsusf_uxo_blu97","BombCluster_03_UXO1_F","BombCluster_02_UXO1_F","BombCluster_01_UXO1_F","BombCluster_03_UXO4_F", "BombCluster_02_UXO4_F","BombCluster_01_UXO4_F","BombCluster_03_UXO2_F","BombCluster_02_UXO2_F","BombCluster_01_UXO2_F", "BombCluster_03_UXO3_F","BombCluster_02_UXO3_F","BombCluster_01_UXO3_F","rhs_uxo_ao1_1","rhs_uxo_ao1_2", "rhs_uxo_ao1_3","rhs_uxo_ptab1m_1","rhs_uxo_ptab1m_2","rhs_uxo_ptab1m_3","rhs_uxo_ptab25ko_1","rhs_uxo_ptab25ko_2", "rhs_uxo_ptab25ko_3","rhs_uxo_ptab25m_1","rhs_uxo_ptab25m_2","rhs_uxo_ptab25m_3","rhs_ammo_uxo_blu97","BombCluster_03_UXO1_Ammo_F", "BombCluster_02_UXO1_Ammo_F","BombCluster_01_UXO1_Ammo_F","BombCluster_03_UXO4_Ammo_F","BombCluster_02_UXO4_Ammo_F", "BombCluster_01_UXO4_Ammo_F","BombCluster_03_UXO2_Ammo_F","BombCluster_02_UXO2_Ammo_F","BombCluster_01_UXO2_Ammo_F", "BombCluster_03_UXO3_Ammo_F","BombCluster_02_UXO3_Ammo_F","BombCluster_01_UXO3_Ammo_F","rhs_ammo_uxo_ao1_1","rhs_ammo_uxo_ao1_2","rhs_ammo_uxo_ao1_3", "rhs_ammo_uxo_ptab1m_1","rhs_ammo_uxo_ptab1m_2","rhs_ammo_uxo_ptab1m_3","rhs_ammo_uxo_ptab25ko_1","rhs_ammo_uxo_ptab25ko_2","rhs_ammo_uxo_ptab25ko_3", "rhs_ammo_uxo_ptab25m_1","rhs_ammo_uxo_ptab25m_2","rhs_ammo_uxo_ptab25m_3" ]; _EODVarRadius = 10; _EODVarAngle = 90; _found = false; _nearestUxo = []; _DetectionPoint = "Helper_Base_F" createVehicleLocal getPos Player; // create detection point _DetectionPoint attachto [player,[-0.4,0.8,-0.8],"granat"]; // attach point to player memorypoint "granat" , we can use "granat2" , "LeftHand" , "RightHand" and maybe "aimPoint".... _allUxo = position player nearObjects ["mineBase",_EODVarRadius]; _ArrUXOs = []; { if (typeOf _x in _uxoType) then {_ArrUXOs pushBack _x}; } forEach _allUxo; for "_i" from 0 to ((count _ArrUXOs) - 1) do { _Uxo = _ArrUXOs select _i; _distance = _DetectionPoint distance _Uxo; if (_distance <= _EODVarRadius) then { if ([getPos player, getDir player, _EODVarAngle, getPos _Uxo] call BIS_fnc_inAngleSector) then { if (_found) then { if ((_nearestUxo select 1) > _distance) then { _nearestUxo = [_Uxo, _distance]; }; } else { _found = true; _nearestUxo = [_Uxo, _distance]; }; }; }; }; detach _DetectionPoint; deleteVehicle _DetectionPoint; _nearestUxo; }; EODS_MDET_fnc_Detector = { scriptName "EODS_MDET_fnc_Detector"; scopeName "DetectorMain"; if (!canSuspend) exitWith {[] spawn EODS_MDET_fnc_Detector};//function needs to run in scheduled environment if (allDisplays isEqualTo [findDisplay 0]) exitWith {};//prevention to not run script in main menu (untested)-might need to add other displays that game loads in main menu (if any other than Display #0) you can find currently running displays with systemChat str allDisplays; if (!hasInterface) exitWith {};//prevention to not run script on dedicated servers or headless clients (untested); waitUntil {sleep 0.5;!isNull player};//function waits until player is ready to play- also JIP protection (untested); while {TRUE} do { if (currentWeapon player in ["EODS_Detector_Weapon", "EODS_VMH3CS_Weapon"]) then { private _NearestUxoResult = call EODS_MDET_fnc_getNearestUxo; //debug-keep sleep command if (_NearestUxoResult isNotEqualTo []) then { systemChat str _NearestUxoResult; private _ShowBomb = "Sign_Arrow_Cyan_F" createVehicleLocal position (_NearestUxoResult select 0);//just for debug _ShowBomb setPos ((_NearestUxoResult select 0) modelToWorld [0,0,0.6]); sleep 3; deleteVehicle _ShowBomb; } else { systemChat "Nothing found"; sleep 3; }; } else { systemChat "you don´t have detector";//also debug sleep 3; }; }; }; //define both functions in CfgFunctions and with EODS_MDET_fnc_Detector set the attribute postInit = 1;(function call itself automaticly) And also, i want to thank @Leopard20 for the tip 🙂.
  20. soldierXXXX

    SOLVED Finding UXO's

    I´m not sure if you need just script for mission or you´re creating a mod ? Well if so, i don´t have experience with creating mods. But i tried to customize the script a little bit. Replace [] spawn part i wrote earlier for this. I assume your script runs in main menu from the begining ? It´s probably not a nice aproach but it should work. I´m sure someone might know better way to do it. 🙂 It works for singleplayer. For multiplayer i think it would need another changes which i´m not sure if i can provide (i´m making mostly singleplayer functions). EODS_MDET_fnc_Detector = { scriptName "EODS_MDET_fnc_Detector"; scopeName "DetectorMain"; if (!canSuspend) exitWith {[] spawn EODS_MDET_fnc_Detector}; waitUntil {sleep 0.1;!isNull findDisplay 46};//waits for mission display; if (isNil "EODS_MDET_fnc_Detector_condition") then { EODS_MDET_fnc_Detector_condition = TRUE; } else { if (EODS_MDET_fnc_Detector_condition) exitWith {systemChat "protection-can´t spawn it twice";breakOut "DetectorMain"}; EODS_MDET_fnc_Detector_condition = TRUE; }; while {!(isNil "EODS_MDET_fnc_Detector_condition")} do { if (!(EODS_MDET_fnc_Detector_condition)) exitWith {systemChat "detection ended";EODS_MDET_fnc_Detector_condition = nil;}; if (isNull findDisplay 46) exitWith {systemChat "detection ended-player is not in mission";EODS_MDET_fnc_Detector_condition = nil;};//if player leaves mission display function ends; if (currentWeapon player in ["EODS_Detector_Weapon", "EODS_VMH3CS_Weapon"]) then { private _NearestUxoResult = call EODS_MDET_fnc_getNearestUxo; //debug-keep sleep command if (_NearestUxoResult isNotEqualTo []) then { systemChat str _NearestUxoResult; private _ShowBomb = "Sign_Arrow_Cyan_F" createVehicleLocal position (_NearestUxoResult select 0);//just for debug _ShowBomb setPos ((_NearestUxoResult select 0) modelToWorld [0,0,0.6]); sleep 3; deleteVehicle _ShowBomb; } else { systemChat "Nothing found"; sleep 3; }; } else { systemChat "you don´t have detector";//also debug sleep 3; }; }; }; [] spawn EODS_MDET_fnc_Detector;//to execute the function spawn this-if it´s mod you´re making you have to implement that somewhere in config (not sure where :D ) //to turn off searching use- EODS_MDET_fnc_Detector_condition = FALSE; or EODS_MDET_fnc_Detector_condition = nil;
  21. soldierXXXX

    SOLVED Finding UXO's

    If you need constant checking do it this way: EODS_MDET_var_radius = 10; EODS_MDET_var_angle = 90; EODS_MDET_fnc_getNearestUxo = { private ["_found", "_nearestUxo", "_DetectionPoint", "_allUxo", "_Uxo", "_distance","_uxoType","_ArrUXOs"]; _uxoType = ["rhsusf_uxo_blu97","BombCluster_03_UXO1_F","BombCluster_02_UXO1_F","BombCluster_01_UXO1_F","BombCluster_03_UXO4_F", "BombCluster_02_UXO4_F","BombCluster_01_UXO4_F","BombCluster_03_UXO2_F","BombCluster_02_UXO2_F","BombCluster_01_UXO2_F", "BombCluster_03_UXO3_F","BombCluster_02_UXO3_F","BombCluster_01_UXO3_F","rhs_uxo_ao1_1","rhs_uxo_ao1_2", "rhs_uxo_ao1_3","rhs_uxo_ptab1m_1","rhs_uxo_ptab1m_2","rhs_uxo_ptab1m_3","rhs_uxo_ptab25ko_1","rhs_uxo_ptab25ko_2", "rhs_uxo_ptab25ko_3","rhs_uxo_ptab25m_1","rhs_uxo_ptab25m_2","rhs_uxo_ptab25m_3","rhs_ammo_uxo_blu97","BombCluster_03_UXO1_Ammo_F", "BombCluster_02_UXO1_Ammo_F","BombCluster_01_UXO1_Ammo_F","BombCluster_03_UXO4_Ammo_F","BombCluster_02_UXO4_Ammo_F", "BombCluster_01_UXO4_Ammo_F","BombCluster_03_UXO2_Ammo_F","BombCluster_02_UXO2_Ammo_F","BombCluster_01_UXO2_Ammo_F", "BombCluster_03_UXO3_Ammo_F","BombCluster_02_UXO3_Ammo_F","BombCluster_01_UXO3_Ammo_F","rhs_ammo_uxo_ao1_1","rhs_ammo_uxo_ao1_2","rhs_ammo_uxo_ao1_3", "rhs_ammo_uxo_ptab1m_1","rhs_ammo_uxo_ptab1m_2","rhs_ammo_uxo_ptab1m_3","rhs_ammo_uxo_ptab25ko_1","rhs_ammo_uxo_ptab25ko_2","rhs_ammo_uxo_ptab25ko_3", "rhs_ammo_uxo_ptab25m_1","rhs_ammo_uxo_ptab25m_2","rhs_ammo_uxo_ptab25m_3" ]; _found = false; _nearestUxo = []; _DetectionPoint = "Helper_Base_F" createVehicleLocal getPos Player; // create detection point _DetectionPoint attachto [player,[-0.4,0.8,-0.8],"granat"]; // attach point to player memorypoint "granat" , we can use "granat2" , "LeftHand" , "RightHand" and maybe "aimPoint".... _allUxo = position player nearObjects ["mineBase",EODS_MDET_var_radius]; _ArrUXOs = []; { if (typeOf _x in _uxoType) then {_ArrUXOs pushBack _x}; } forEach _allUxo; for "_i" from 0 to ((count _ArrUXOs) - 1) do { _Uxo = _ArrUXOs select _i; _distance = _DetectionPoint distance _Uxo; if (_distance <= EODS_MDET_var_radius) then { if ([getPos player, getDir player, EODS_MDET_var_angle, getPos _Uxo] call BIS_fnc_inAngleSector) then { if (_found) then { if ((_nearestUxo select 1) > _distance) then { _nearestUxo = [_Uxo, _distance]; }; } else { _found = true; _nearestUxo = [_Uxo, _distance]; }; }; }; }; deleteVehicle _DetectionPoint; _nearestUxo; }; [] spawn { scriptName "CheckForUXO_script"; CheckActive = TRUE; while {CheckActive} do { private _NearestUxoResult = call EODS_MDET_fnc_getNearestUxo; //debug if (_NearestUxoResult isNotEqualTo []) then { systemChat str _NearestUxoResult; private _ShowBomb = "Sign_Arrow_Cyan_F" createVehicleLocal position (_NearestUxoResult select 0);//just for debug _ShowBomb setPos ((_NearestUxoResult select 0) modelToWorld [0,0,0.6]); sleep 3; deleteVehicle _ShowBomb; } else { systemChat "Nothing found"; sleep 3; }; }; }; I made a small change in the code (replaced ArrUXOs for private _ArrUXOs and changed in _allUxo 10m radius for Variable EODS_MDET_var_radius so you don´t have to rewrite it every time you change variable value 😉 ) If you want to turn off searching for UXOs then write CheckActive = FALSE; either in debug console or your script. EDIT: I don´t think this will affect the script. But, of course i´m not sure what value EODS_MDET_var_rnd_radius has and what function EODS_MDET_fnc_randomize does. Well try the code above and we´ll see 🙂.
  22. soldierXXXX

    SOLVED Finding UXO's

    I found few mistakes and fixed your code. Now it should work properly. Change the variables to fit your needs and let me know if that helped 🙂 EODS_MDET_var_radius = 10; EODS_MDET_var_angle = 90; EODS_MDET_fnc_getNearestUxo = { private ["_found", "_nearestUxo", "_DetectionPoint", "_allUxo", "_Uxo", "_distance","_uxoType"]; _uxoType = ["rhsusf_uxo_blu97","BombCluster_03_UXO1_F","BombCluster_02_UXO1_F","BombCluster_01_UXO1_F","BombCluster_03_UXO4_F", "BombCluster_02_UXO4_F","BombCluster_01_UXO4_F","BombCluster_03_UXO2_F","BombCluster_02_UXO2_F","BombCluster_01_UXO2_F", "BombCluster_03_UXO3_F","BombCluster_02_UXO3_F","BombCluster_01_UXO3_F","rhs_uxo_ao1_1","rhs_uxo_ao1_2", "rhs_uxo_ao1_3","rhs_uxo_ptab1m_1","rhs_uxo_ptab1m_2","rhs_uxo_ptab1m_3","rhs_uxo_ptab25ko_1","rhs_uxo_ptab25ko_2", "rhs_uxo_ptab25ko_3","rhs_uxo_ptab25m_1","rhs_uxo_ptab25m_2","rhs_uxo_ptab25m_3","rhs_ammo_uxo_blu97","BombCluster_03_UXO1_Ammo_F", "BombCluster_02_UXO1_Ammo_F","BombCluster_01_UXO1_Ammo_F","BombCluster_03_UXO4_Ammo_F","BombCluster_02_UXO4_Ammo_F", "BombCluster_01_UXO4_Ammo_F","BombCluster_03_UXO2_Ammo_F","BombCluster_02_UXO2_Ammo_F","BombCluster_01_UXO2_Ammo_F", "BombCluster_03_UXO3_Ammo_F","BombCluster_02_UXO3_Ammo_F","BombCluster_01_UXO3_Ammo_F","rhs_ammo_uxo_ao1_1","rhs_ammo_uxo_ao1_2","rhs_ammo_uxo_ao1_3", "rhs_ammo_uxo_ptab1m_1","rhs_ammo_uxo_ptab1m_2","rhs_ammo_uxo_ptab1m_3","rhs_ammo_uxo_ptab25ko_1","rhs_ammo_uxo_ptab25ko_2","rhs_ammo_uxo_ptab25ko_3", "rhs_ammo_uxo_ptab25m_1","rhs_ammo_uxo_ptab25m_2","rhs_ammo_uxo_ptab25m_3" ]; _found = false; _nearestUxo = []; _DetectionPoint = "Helper_Base_F" createVehicleLocal getPos Player; // create detection point _DetectionPoint attachto [player,[-0.4,0.8,-0.8],"granat"]; // attach point to player memorypoint "granat" , we can use "granat2" , "LeftHand" , "RightHand" and maybe "aimPoint".... _allUxo = position player nearObjects ["mineBase",10]; ArrUXOs = []; { if (typeOf _x in _uxoType) then {ArrUXOs pushBack _x}; } forEach _allUxo; for "_i" from 0 to ((count ArrUXOs) - 1) do { _Uxo = ArrUXOs select _i; _distance = _DetectionPoint distance _Uxo; if (_distance <= EODS_MDET_var_radius) then { if ([getPos player, getDir player, EODS_MDET_var_angle, getPos _Uxo] call BIS_fnc_inAngleSector) then { if (_found) then { if ((_nearestUxo select 1) > _distance) then { _nearestUxo = [_Uxo, _distance]; }; } else { _found = true; _nearestUxo = [_Uxo, _distance]; }; }; }; }; deleteVehicle _DetectionPoint; _nearestUxo; }; private _NearestUxoResult = call EODS_MDET_fnc_getNearestUxo; //debug if (_NearestUxoResult isNotEqualTo []) then { systemChat str _NearestUxoResult; private _ShowBomb = "Sign_Arrow_Cyan_F" createVehicleLocal position (_NearestUxoResult select 0);//just for debug _ShowBomb attachTo [(_NearestUxoResult select 0),[0,0,0.6]];//for some reason to show right position pointer needs to be attached detach _ShowBomb; } else { systemChat "Nothing found"; };
  23. soldierXXXX

    SOLVED Finding UXO's

    Hi. You tried to assign array instead of string so the command did nothing. Try it like this: Nuxos = position player nearObjects ["mineBase",10]; I assigned parent class, so you don´t have to look for every type of UXOs in your array and it automaticly finds all mines in player´s 10m area. If you wish to list only UXOs and not other mines, you could do it like this: uxoType = ["rhsusf_uxo_blu97","BombCluster_03_UXO1_F","BombCluster_02_UXO1_F","BombCluster_01_UXO1_F","BombCluster_03_UXO4_F", "BombCluster_02_UXO4_F","BombCluster_01_UXO4_F","BombCluster_03_UXO2_F","BombCluster_02_UXO2_F","BombCluster_01_UXO2_F", "BombCluster_03_UXO3_F","BombCluster_02_UXO3_F","BombCluster_01_UXO3_F","rhs_uxo_ao1_1","rhs_uxo_ao1_2", "rhs_uxo_ao1_3","rhs_uxo_ptab1m_1","rhs_uxo_ptab1m_2","rhs_uxo_ptab1m_3","rhs_uxo_ptab25ko_1","rhs_uxo_ptab25ko_2", "rhs_uxo_ptab25ko_3","rhs_uxo_ptab25m_1","rhs_uxo_ptab25m_2","rhs_uxo_ptab25m_3" ]; private _Nuxos = position player nearObjects ["mineBase",10]; ArrUXOs = []; { if (typeOf _x in uxoType) then {ArrUXOs pushBack _x}; } forEach _Nuxos; //ArrUXOs now contains only objects near player that you defined in your array uxoType. But there is one important notice. If you placed your UXOs from editor, they change into diferent type. You can find these types in cfgAmmo. That is, if you place UXO, which Editor shows as type "BombCluster_01_UXO4_F", then when you hit play, it changes to "BombCluster_01_UXO4_Ammo_F" and will be ignored in the code above. you can test it with: //insert this code into debug console (or your script) and in editor make a line of UXOs you want to have in your mission each only once (to not deal with duplicates in result array) private _Nuxos = (position player nearObjects ["mineBase",50]) apply {typeOf _x}; systemChat str _Nuxos; copyToClipboard str _Nuxos;//insert result into your uxoType array (remove brackets if you expanding original array) I hope these informations are usefull for you. 🙂
  24. soldierXXXX

    Image over HUD Issue

    @GODSPEEDSNAKE That´s very strange. Just tested it with your original picture and it worked fine for me. So i tried to resize it to 2048x2048 and it also worked. Image size should not be an issue. If it converts correctly, then if you drag your converted image back into textview2, it should automaticly set it to RGBA/none/DXT5. If it won´t, i suggest to try different settings in software you´re using to create/edit your picture. In the end it should look like this . In case, you will not get it to work, i uploaded already converted image in your original size. You can download it here (stored for 30 days) . Let us know if that helped 🙂
  25. soldierXXXX

    Image over HUD Issue

    Hi. As 7erra said the picture should be ideally 256x256, 1024x1024 , 2048x2048 etc... Did you converted the png in Textview2 as DXT5 ? DXT5 is format for transparent pictures. Also just like 7erra said, restarting the game or changing file name is necessary to see the changes.
×