Jump to content

5mpower

Member
  • Content Count

    9
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About 5mpower

  • Rank
    Private
  1. Yep, no more errors, but i get strange results. So here is script: _Xrnd = round(random 18) -9; _Yrnd = round(random 18) -9; _Dir = random(360); _Alt = random(5)+ 1500; camX =(getPos player select 0) + _Xrnd; camY = (getPos player select 1) + _Yrnd; camZ = (getPos player select 2) ; cam = "camera" camCreate position player; cam cameraEffect ["internal", "back"]; _configs = "getNumber (_x >> 'scope') >= 2 AND configName _x isKindof 'Tank'" configClasses (configFile >> "CfgVehicles"); _classNames = _configs apply {configName _x}; for [{ _i = 0 }, { _i < 1000 }, { _i = _i + 1 }] do { _Xrnd = round(random 18) -9; _Yrnd = round(random 18) -9; _Dir = random(360); _Alt = random(5)+ 1500; _timeToSkipTo = round(random 6)+9; _to = (_timeToSkipTo - daytime + 24 ) % 24; skipTime _to ; 0 setFog 0; 0 setRain 0; _vx = camX + 100 ; _name =(_classNames call BIS_fnc_selectRandom); _vech = createVehicle [_name, position player , [], 1000]; //_vech = vehicle player; _bbr = 0 boundingBoxReal _vech; _center = boundingCenter _vech; _p1 = _bbr select 0; _p2 = _bbr select 1; _width = abs ((_p2 select 0) - (_p1 select 0)); _length = abs ((_p2 select 1) - (_p1 select 1)); _height = abs ((_p2 select 2) - (_p1 select 2)); _TL = screenToWorld [0,0]; _TR = screenToWorld [0,1]; _BL = screenToWorld [1,0]; _BR = screenToWorld [1,1]; sleep 4; private _box = (0 boundingBoxReal _vech); private _edgePoints = [[_box#0#0,_box#0#1,_box#0#2],[_box#0#0,_box#1#1,_box#0#2],[_box#1#0,_box#0#1,_box#0#2],[_box#1#0,_box#1#1,_box#0#2],[_box#0#0,_box#0#1,_box#1#2],[_box#0#0,_box#1#1,_box#1#2],[_box#1#0,_box#0#1,_box#1#2],[_box#1#0,_box#1#1,_box#1#2]]; //PX = (x - safeZoneX) / pixelW; //PY = (y - safeZoneY) / pixelH; diag_log _edgePoints; private _result = (_edgePoints apply {worldToScreen (_vech modelToWorld _x)} apply {[(_x#0 - safeZoneX) / safeZoneW,(_x#1 - safeZoneY) / safeZoneH]}); diag_log _result; //P = (_box#0#0 - safeZoneX) / pixelW; //diag_log SafeZoneX; //diag_log SafeZoneY; diag_log [safeZoneX, safeZoneY]; diag_log [safeZoneX + safeZoneW, safeZoneY]; diag_log [safeZoneX, safeZoneY + safeZoneH]; diag_log [safeZoneX + safeZoneW, safeZoneY + safeZoneH]; //diag_log P; _vech setDir _Dir; camX =(getPos _vech select 0) + _Xrnd; camY = (getPos _vech select 1) + _Yrnd; camZ = (getPos _vech select 2) ; cam camCommit 0; cam camSetPos [camX, camY, camZ+_Alt]; cam camSetDir [0, 0, -1]; cam camSetFov 0.05; cam camCommit 0; sleep 4; camX =(getPos _vech select 0) + _Xrnd; camY = (getPos _vech select 1) + _Yrnd; camZ = (getPos _vech select 2) ; cam camCommit 0; cam camSetPos [camX, camY, camZ+_Alt]; cam camSetDir [0, 0, -1]; cam camSetFov 0.05; _vech animateSource ["MainTurret", rad 190]; cam camCommit 0; screenshot "testFile.png"; screenshot format["%9_az%3_w%1_l%2_x%4_y%5_alt%6_cx%7_cy%8.png", _width, _length, _Dir, _Xrnd, _Yrnd, _Alt, _center select 0, _center select 1, _name ]; profileNamespace setVariable ["TAG_lastPlayerLocation", getPosASL player]; saveProfileNamespace; sleep 0.1; deleteVehicle _vech; }; cam camCommit 6; cam cameraEffect ["terminate","back"]; camDestroy cam; Maybe i doing smth wrong, but in rpt file i have this: 14:14:01 [[0.674908,-5.88783],[0.674885,-5.79451],[0.655435,-5.88723],[0.655423,-5.79392],[0.674529,-5.90356],[0.674506,-5.80996],[0.655,-5.90295],[0.654987,-5.80936]] 14:14:01 [-0.712121,-0.409091] 14:14:01 [1.71212,-0.409091] 14:14:01 [-0.712121,1.40909] 14:14:01 [1.71212,1.40909] 14:14:01 [-0.712121,-0.409091] 14:14:01 [1.71212,-0.409091] 14:14:01 [-0.712121,1.40909] 14:14:01 [1.71212,1.40909] 14:43:21 [[-0.204747,-0.603099,-0.26893],[-0.204747,0.609368,-0.26893],[0.205475,-0.603099,-0.26893],[0.205475,0.609368,-0.26893],[-0.204747,-0.603099,0.273886],[-0.204747,0.609368,0.273886],[0.205475,-0.603099,0.273886],[0.205475,0.609368,0.273886]] 14:43:21 [-0.712121,-0.409091] 14:43:21 [1.71212,-0.409091] 14:43:21 [-0.712121,1.40909] 14:43:21 [1.71212,1.40909]
  2. Question about translating position in pixels: So i recieve a results of 4 edge points smth like that :[-0.712121,-0.409091] (its left top corner fo screenshot). I need that left top corner will be [0,0] and right bottom corner will be [1920,1080]. If i calculate a coefficient of "translating" it will be true? Btw i have this mistake "Error in expression <log [safeZoneX, safeZoneY + safeZoneH]" if try to "diag_log [safeZoneX, safeZoneY + safeZoneH]". Why is that mistake?
  3. Also i check what will be if we export SaveZoneX: this mistake is coming "Error position: <SaveZoneX;"
  4. How we define SafeZoneX, SaveZoneY?. I export data in rpt file. Firstly i export "_edgePoints" in rpt file and get results smth like "[[-0.204747,-0.603099,-0.26893],[-0.204747,0.609368,-0.26893],[0.205475,-0.603099,-0.26893]...". How we can translate it in meters (or pixels from screenshot)?. For better understanding i draw what i want and attach zip with "mission" and script (called "test.sqf"). Link for zip file below. Sorry for bad coding, im just trying to learn https://fex.net/ru/s/bscpd1p For open mission we need to go to "editor" then go to "scenario", "open" then choise "1111.Altis". To run script i use "execVM "test.sqf";"
  5. Yep that works, thanks. So also i need to know 4 coordinates of object in screenshot (ex. Tank or smth). So we need to use BoundingBoxReal? By that function we can only recognize Xmin, Ymin, Zmin, Xmax, Ymax, Zmax. How we can get coordinates of all corners of this object? Also there is a trouble that point Xmin, Ymin can be not one point. Picture also included
  6. Can i ask one more question? Is there Any function to get 4 extreme points of object? (Top left, top right, etc..). BoundingBoxReal?
  7. So i take a screenshot in Arma 3 and i need to know coordinates (x,y) of every corner of screenshot. Are there any command to return at least coordinate of one corner?
  8. Hello for everyone! I have a trouble: my script takes screenshot of object and i need to create log file with full dimensions of this object (basically, i need a four points of object: upper left, upper right, lower left, lower right). How can i save it? I read about saveProfileNamespace, but i cant find where i can find file with logs in arma 3 directory. Or maybe there are any way of creating .txt file with each screensot? Thanks for help before!
×