Jump to content

HonzaVinCZ

Member
  • Content Count

    75
  • Joined

  • Last visited

  • Medals

Community Reputation

16 Good

1 Follower

About HonzaVinCZ

  • Rank
    Corporal

Profile Information

  • Gender
    Male
  • Location
    CZE

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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.
  2. 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!
  3. 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.
  4. 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.
  5. 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?
  6. @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];
  7. Woah, now this works! Thank you very much for all your help!
  8. Tried "nameCity", "nameVillage", "name" and it shows just one name, for ex. Arobster on all markers 😕
  9. 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, ""];
  10. 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?
  11. just tested it, tasks doesn't get created.
  12. 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; };
  13. _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.
  14. 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.
  15. 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.
×