Jump to content

HonzaVinCZ

Member
  • Content Count

    77
  • Joined

  • Last visited

  • Medals

Everything posted by HonzaVinCZ

  1. Hello, I'd like to ask you if you could help me with this script. I'd like to make intel that is possible to collect by one side and that's BLUFOR. So there would be visible action on intel for BLUFOR but OPFOR would not see that action. Any ideas please?
  2. Hello guys, I have done my own weather script but as you can see, I'm not any scripting wizard and I know all these lines must be quite stressful for engine to read but don't know how to simplify the loop to make it more lag free. Basically this script has three main features: Weather, time acceleration and skip to given time. Weather is changed every ingame half hour and it takes another ingame half hour to change. The ingame half hour is calculated from time acceleration. It's the _delayHalfHourFloored variable. The _debug function is WIP. 😄 _weather = true; // Set dynamic weather on/off. Value: true/false. Default: true _timeMultiplier = 1; // Set time acceleration. Value: 0.1-120. Default: 1 _timeTrue = true; // Set scripted mission start time on/off (using skipTime function) _time = 10; // Set mission start time. Value in 24 hours format (1-24). Minutes usage example: 18.24 means 18:24. Default: 10 _debug = true; // Set debug on/off _delay1Hour = 3600 / _timeMultiplier; _delay1HourFloored = floor _delay1Hour; _delayHalfHour = _delay1HourFloored / 2; _delayHalfHourFloored = floor _delayHalfHour; skipTime (_time - daytime + 24 ) % 24; if (_timeTrue) then { setTimeMultiplier _timeMultiplier; }; while {_weather} do { _daytime = floor daytime; _valueOvercast = random [0, 0.3, 1]; if (_daytime == 0) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 1) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 2) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 3) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 4) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 5) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 6) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 7) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 8) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 9) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 10) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 11) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 12) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 13) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 14) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 15) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 16) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 17) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 18) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 19) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 20) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 21) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 22) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; if (_daytime == 23) then { _delayHalfHourFloored setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _vauleRain = _valueOvercast; _delayHalfHourFloored setRain _vauleRain; if (_vauleRain <= 0.4) then { _delayHalfHourFloored setFog random [0, 0.2, 0.5]; }; } else { _delayHalfHourFloored setRain 0; }; }; sleep _delayHalfHourFloored; };
  3. I wonder how can I find a unit (player in my case) in array of vehicles. I spent hell of a time on this one and couldn't find a solution. Example array of my vehicles: _vehicleList = [MGI802,MGI804,MGI809] I need to make it return boolean true/false if player is present in any of vehicles above. Vehicles in array can change so I can't hardtype "crew MGI802" and so on. My further use for that is to set player's marker alpha depending if he is in a vehicle or not; (I know this one is propably extremely unoptimised but I wanted to try make vehicle and player markers on my own) while {true} do { // Vehicle Markers _vehicleList = [MGI802,MGI804,MGI809,MGI810,MGI814,MGI815,MGI1843,MGI818,MGI823,MGI1504,MGI1507,MGI271,MGI253,MGI1847,MGI386,MGI1612,MGI836,MGI829,MGI1437,MGI835,MGI348,MGI824,MGI365,MGI369]; { _name = getText (configFile >> "CfgVehicles" >> typeOf _x >> "displayName"); _vehmark = vehicleVarName _x; if (getMarkerType _vehmark == "") then { _vehmark = createMarker [_vehmark, getPos _x]; _vehmark setMarkerType "mil_arrow2"; _vehmark setMarkerSize [0.4, 0.5]; _vehmark setMarkerAlpha 1; }; if (alive _x) then { if ((count crew _x) > 0) then { _crewlist = ""; { _crewlist = format ["%1%2 | ",_crewlist, (name _x)]; } forEach crew _x; _vehmark setMarkerText ([_name, _crewlist] joinString " | "); } else { _vehmark setMarkerText _name; }; _vehmark setMarkerColor "colorWEST"; _vehmark setMarkerDir (getDir _x); _vehmark setMarkerPos (getPos _x); } else { _vehmark setMarkerColor "colorGrey"; _vehmark setMarkerText ([_name, "(Destroyed)"] joinString " "); }; } forEach _vehicleList; // Player Markers _playermark = name player; if (getMarkerType _playermark == "") then { _playermark = createMarker [_playermark, getPos player]; _playermark setMarkerType "mil_triangle"; _playermark setMarkerSize [0.5, 0.8]; _playermark setMarkerAlpha 1; }; if (alive player) then { // HOW TO RETURN PLAYER PRESENCE BOOLEAN FROM _vehiclelist ? if (true) then { _playermark setMarkerText (name player); _playermark setMarkerColor "colorWEST"; _playermark setMarkerDir (getDir player); _playermark setMarkerPos (getPos player); _playermark setMarkerAlpha 1; } else { _playermark setMarkerAlpha 0; }; } else { _playermark setMarkerColor "colorGrey"; _playermark setMarkerText ([name player, "(KIA)"] joinString " "); }; sleep 1; };
  4. HonzaVinCZ

    Find unit in array of vehicles

    That simple 😐 However it works as I wanted, thank you!
  5. Hello guys, I need your help with variables in this script: #define __dbug__ _posATL_1 = _this select 0; _posATL_2 = _this select 1; _posATL_3 = _this select 2; _posATL = selectRandom [_posATL_1, _posATL_2, _posATL_3]; _wCache = "CUP_BOX_TK_MILITIA_Wps_F" createVehicle [0,0,0]; _wCache allowDamage false; _wCache enableSimulation false; _wCache setDir (random 359); _wCache setPosATL _posATL; _wCache enableSimulation true; _wCache enableDynamicSimulation true; _wCache allowDamage true; _pos = getPos _wCache; _loc = text nearestLocation [_pos, ""]; tskCrt = { _taskwcache = [west, ['wcachetask_'], [format ['Destroy enemy weapon cache near %1 found by our forces', _loc], format ['Destroy Weapon Cache near %1', _loc], ''], _wCache, 'CREATED', -1, true, 'destroy', true] call BIS_fnc_taskCreate; deleteVehicle _trig; }; _trig = createTrigger ["EmptyDetector", _pos]; _trig setTriggerArea [10,10,0,FALSE,10]; _trig setTriggerActivation ["ANYPLAYER","PRESENT",false]; _trig setTriggerTimeout [0,0,0,false]; _trig setTriggerStatements[ "this", "call tskCrt", ""]; #ifdef __dbug__ cacheMkrs=[]; _mkrID=format["wCache_%1",_loc]; _mkr=createMarker[_mkrID,_pos]; _mkr setMarkerShape"ICON";_mkr setMarkerType"mil_dot";_mkr setMarkerBrush"Solid";_mkr setMarkerAlpha 1;_mkr setMarkerColor"ColorEast";_mkr setMarkerText format ["wCache %1", _loc]; cacheMkrs pushBack _mkr; #endif _exists = [_taskwcache] call BIS_fnc_taskExists; waitUntil {sleep 1; !alive _wCache}; if (_exists) then { [[_taskwcache],"SUCCEEDED"] call BIS_fnc_taskSetState; "Bo_GBU12_LGB" createVehicle getPos _wCache; } else { "Bo_GBU12_LGB" createVehicle getPos _wCache; deleteVehicle _trig; }; Basically when player enters the trigger, it creates a task but variables I set on the beginning of the script doesn't work in the task creation line - the place in the desc and title shows as "any". Also when I want to check if task exists in the end of the script, it says _taskwcache variable doesn't exist. What do I do wrong please? Thank you.
  6. No problem! Oh nice, but also I guess from your reply these explosion made craters can't be deleted individually or? Btw sorry for late reply, I was busy during this week.
  7. Oh, that is cool and works perfectly, thank you! Btw the crater I create can be deleted but it won't delete the explosion crater mark, described below my thought hint shows it's "krater.p3d" which is basically "Crater" but if I want to delete it, it just won't delete. Maybe it needs little delay beacause the crater don't get created that quick as the script runs. I left it without creating my own crater and left there the one which is created by the explosion itself, I'll try to code to remove at least that one. Thank you both for your help, I couldn't continue my code without your help!
  8. Hm, it doesn't detect the crater mark created by the explosion. It detects craters placed by the script but for some reason it can't detect crater mark created by the explosion itself. Tested it with hint.
  9. Sure but it doesn't get deleted with the crater model. The crater mark is still on the ground when the crater gets deleted and the mark from the explosion of the IED should not be even there because just after it explodes, there is code below and after that the whole crater thing I want is created. {deleteVehicle _x}forEach nearestObjects[getPosATL _iedObj,["Crater"],4]; Some of the crater markers is still there but idk which one. If that from IED of that I spawned by the code.
  10. ok, gonna test it EDIT: Yeah, this works fine, thank you. But as I edited above, the crater mark on the ground doesn't get deleted, any clue why?
  11. @gc8 I found one more thing I need to ask you or someone else about... This code creates crater when IED explodes but when there is more than one crater, it always deletes just one instead of each of them after 60s. The idea is each crater gets deleted after given time, not all of them at one time. It has to do something with the variables again and I do something wrong again too. The 0.5 sec sleep is to delay the hideObject true because otherwise the explosion gets blocked by the object and it doesn't damage anything. Then the 60 sec delay is for crater deletion, by default it'll be about 15 mins. I tried to use getVar and setVar but this time I use it propably wrong way. I didn't know what to attach the var when it is in [] spawn {}; I have this code called in trigger, it is not all but I'm quite sure there must be the problem: EDIT I had typo in [] spawn {}; where I wrote crater instead _crater... Anyway it leaves crater on the ground even when I have this code after bomb gets spawned {deleteVehicle _x}forEach nearestObjects[getPosATL _iedObj,["Crater"],4]; _crater = "Crater" createVehicle [0,0,0]; _crater setDir (random 359); _crater enableSimulation false; _crater allowDamage false; _crater hideObject true; _crater setPos (getPos thisTrigger); _crater1 = "Land_ShellCrater_02_small_F" createVehicle [0,0,0]; _crater1 setDir (random 359); _crater1 enableSimulation false; _crater1 allowDamage false; _crater1 hideObject true; _crater1 setPos (getPos thisTrigger); _crater2 = "Land_ShellCrater_02_debris_F" createVehicle [0,0,0]; _crater2 setDir (random 359); _crater2 enableSimulation false; _crater2 allowDamage false; _crater2 hideObject true; _crater2 setPos (getPos thisTrigger); [] spawn {_crater = missionNamespace getVariable 'crater'; _crater1 = missionNamespace getVariable 'crater1'; _crater2 = missionNamespace getVariable 'crater2'; sleep 0.5; _crater hideObject false; _crater1 hideObject false; _crater2 hideObject false; sleep 60; deleteVehicle _crater; deleteVehicle _crater1; deleteVehicle _crater2}; missionNamespace setVariable ["crater", _crater]; missionNamespace setVariable ["crater1", _crater1]; missionNamespace setVariable ["crater2", _crater2];
  12. Woah, now this works! Thank you very much for all your help!
  13. Tried "nameCity", "nameVillage", "name" and it shows just one name, for ex. Arobster on all markers 😕
  14. Added _loc same way as you did and it works!... but still some places seem like they don't recognize location. Any idea why? idk, code below seems good to me but it isn't for some reason. _loc = text nearestLocation [_pos, ""];
  15. You're right, now the mission works perfectly! Thank you. Now I only need to fix the location names doesn't show properly in task desc, title and debug markers. Simliar way as you did here?
  16. just tested it, tasks doesn't get created.
  17. Sorry, I still have massive problems with variables here. Suffering with it over three hours today already and can't make it work. I do something wrong, I know, but I can't make it working, I just don't know how. I need variable for each weapon cache. Each weapon cache needs its position, task, marker and location name but it doesn't work the way I try all time. I changed the way weapon caches are recognized, I placed them on the map and used this to call the script for them: this is how it looks like on the map... tasks are creating at one same place and it seems like they get accomplished randomly when I destroy any of the caches. actual script looks like this: // Lythium weapon caches script by HonzaVinCZ #define __dbug__ _wCache = _this select 0; wCache = _wCache; _posATL_1 = _this select 1; _posATL_2 = _this select 2; _posATL_3 = _this select 3; _posATL = selectRandom [_posATL_1, _posATL_2, _posATL_3]; _wCache setDir (random 359); _wCache setPosATL _posATL; _pos = getPos _wCache; _loc = text nearestLocation [_pos, ""]; loc = _loc; tskCrt ={ taskwcache = [west, [format["task_%1",(random 1000)]], [format ['Destroy enemy weapon cache near %1', loc], format ['Destroy Weapon Cache near %1', loc], ''], wCache, 'CREATED', -1, true, 'destroy', true] call BIS_fnc_taskCreate;deleteVehicle thisTrigger}; _trig = createTrigger ["EmptyDetector", _pos]; _trig setTriggerArea [10,10,0,FALSE,10]; _trig setTriggerActivation ["ANYPLAYER","PRESENT",false]; _trig setTriggerTimeout [0,0,0,false]; _trig setTriggerStatements[ "this", "call tskCrt", ""]; #ifdef __dbug__ _mkrID=format["wCache_%1",_pos]; _mkr=createMarker[_mkrID,_pos]; _mkr setMarkerShape"ICON";_mkr setMarkerType"mil_dot";_mkr setMarkerBrush"Solid";_mkr setMarkerAlpha 1;_mkr setMarkerColor"ColorEast";_mkr setMarkerText format ["wCache %1", _loc]; #endif _wCache enableDynamicSimulation true; waitUntil{sleep 1; !alive _wCache}; if (true) then { [taskwcache,"SUCCEEDED"] call BIS_fnc_taskSetState; "Bo_GBU12_LGB" createVehicle _pos; deleteVehicle _wCache; } else { "Bo_GBU12_LGB" createVehicle _pos; deleteVehicle _trig; deleteVehicle _wCache; };
  18. _exists = ["wcachetask_"] call BIS_fnc_taskExists; waitUntil {sleep 1; !alive _wCache}; if (_exists) then { [["wcachetask_"],"SUCCEEDED"] call BIS_fnc_taskSetState; "Bo_GBU12_LGB" createVehicle getPos _wCache; deleteVehicle _wCache; } else { "Bo_GBU12_LGB" createVehicle getPos _wCache; deleteVehicle _trig; deleteVehicle _wCache; }; Sadly, it doesn't work. Shows no error but also the mission doesn't get accomplished as it should. ok, thank you. I'll also need some explain how to "import" the variables to that tskCrt, because I really need them there. Same with the task ID.
  19. That is what I thought. Can I ask you if you could show me example of that on my script please? I have really no idea how could I use publicVariable in this.
  20. Hello, my mate has some error happening after upgrading his GPU. He can launch Arma with mods without any problems but after 5-10min, his client crashes. He has everything up to date as he says. He also tried to reinstall the game but it didn't help. Log download ( Google Drive ) Also one note worth to say... The .mdmp file has over 46 MB. The mdmp file download ( Google Drive )
  21. HonzaVinCZ

    C0000005 ACCESS_VIOLATION at F88B6A1D

    No, I don't know.
  22. HonzaVinCZ

    Need your help with this script

    Yes, that is what I'm looking for. But I'm not sure how to use that properly in my script.
  23. Hey guys, today I have problem with this script. I have been working on this thing for like 4 hours now and can't make it work without problems. I have tried many different ways to solve the described problem below but without effect. Basically this script is executed from init field of IED and if player enters proximity of 5 meters around the IED (IED is placed on table), it will create task informing player he found IED factory and it must be destroyed. The problem is, there are no errors popping out when mission is started and task is created well as it should but the task missing place and if the IED is destroyed or disarmed, mission is not succeeded. Btw ignore the _table, I'm working on it. _ied = _this select 0; _iedPos = getPosATL _ied; _table = nearestObject [_iedPos, "Land_WoodenTable_small_F"]; _iedTrig1 = createTrigger ["EmptyDetector", _iedPos , true]; _iedTrig1 setTriggerArea [5, 5, 0, false, 5]; _iedTrig1 setTriggerActivation ["WEST", "PRESENT", false]; _iedTrig1 setTriggerStatements [ "this", "[west, ['iedFactoryTask_'], ['Our forces found enemy IED factory, your task is destroy it.', 'Destroy IED factory'], objNull, 1, 3, true, '', true] call BIS_fnc_taskCreate; ['iedFactoryTask_', _iedPos] call BIS_fnc_taskSetDestination; deleteVehicle thisTrigger;", ""]; _iedTrig2 = createTrigger ["EmptyDetector", _iedPos , true]; _iedTrig2 setTriggerActivation ["NONE", "PRESENT", false]; _iedTrig2 setTriggerStatements [ "!alive _ied", "['iedFactoryTask_', 'SUCCEEDED', true] call BIS_fnc_taskSetState; deleteVehicle thisTrigger;", ""];
  24. HonzaVinCZ

    Need your help with this script

    So I have solved half of the problem. Now I have problem with mission variable. If I place two objects with same init, the script can't make variable for each object when creating mission ID. Any idea how can I make mission ID variable, please? _ied = _this select 0; _iedPos = getPosATL _ied; _table = nearestObject [_iedPos, "Land_WoodenTable_small_F"]; _iedTrig1 = createTrigger ["EmptyDetector", _iedPos , true]; _iedTrig1 setTriggerArea [10, 10, 10, false, 5]; _iedTrig1 setTriggerActivation ["WEST", "PRESENT", false]; _iedTrig1 setVariable[ "ied", _ied ]; _iedTrig1 setVariable[ "iedPos", _iedPos ]; _iedTrig1 setTriggerStatements [ "this && (thisTrigger getVariable 'ied') mineDetectedBy west && alive (thisTrigger getVariable 'ied')", "[west, ['mission_'], ['Our forces found enemy IED factory, your task is to destroy it.', 'Destroy IED factory'], thisTrigger getVariable 'iedPos', 1, 3, true, 'destroy', true] call BIS_fnc_taskCreate;", ""]; _iedTrig2 = createTrigger ["EmptyDetector", _iedPos , true]; _iedTrig2 setTriggerActivation ["NONE", "PRESENT", false]; _iedTrig2 setVariable[ "ied", _ied ]; _iedTrig2 setVariable[ "iedTrig1", _iedTrig1 ]; _iedTrig2 setTriggerStatements [ "!alive (thisTrigger getVariable 'ied') && triggerActivated (thisTrigger getVariable 'iedTrig1')", "['mission_', 'SUCCEEDED', true] call BIS_fnc_taskSetState;", ""]; waitUntil {triggerActivated _iedTrig2}; deleteVehicle _iedTrig1; deleteVehicle _iedTrig2;
  25. HonzaVinCZ

    Need your help with this script

    Thank you very much, I thought these vaules are undefined in trigger but had no idea how to define them in trigger. So if I want define any values in trigger, I must define them by _trigg setVariable ... ? Also does it work for multiple values? For example if I wanted to store two values, I just write more setVariable ?
×