Jump to content

sarogahtyp

Member
  • Content Count

    1335
  • Joined

  • Last visited

  • Medals

Community Reputation

300 Excellent

6 Followers

About sarogahtyp

  • Rank
    Master Gunnery Sergeant

Profile Information

  • Gender
    Male
  • Location
    Berlin, Germany
  • Interests
    arma :-)

Recent Profile Visitors

1608 profile views
  1. sarogahtyp

    Get position on top of object

    if [2, 2, 1] is ur relative position from slabs center then: _world_pos_corner = _slab modelToWorld [2,2,1]; look at wiki: modelToWorld ______________________ @DeathF0X what should this help with?
  2. .rar file seems to be broken. maybe you could upload it again?
  3. I'm absolutly happy that I was able to help you here. Thank you for the scripting idea and for your respond to my solution. 😊 I think you should use the 1st script which is without thrust. I doubt that my thrust method works with mlrs rounds as I told above. But you could test the 2nd with mlrs and if it works then use it. You could try to optimize the _time_step value. I think a value which produces an error of 10-20 meters should be good as well and would save some calculation iterations. just FYI if you double the value then you save the half calculation time. If the flight time from grabbing to impact is 30 second then a value of 0.1 means 300 calculation iterations. With 0.2 its 150! Therefore you should set it as low as necessary but as high as possible.
  4. You are using a flat area relativly near above sea level. try it with the target in a much higher area. it should make a difference I guess. Also what happens if you set _time_step to 0.1 in my script? it should be much more precise then. Last thing is you should not draw the crosshair at the intended target location but exactly where the shell has hit the ground.
  5. I wanted to see the contents of _Objetos array not any prior thing. add this before your test hint and show the .rpt output of it: diag_log _Objetos;
  6. what r these extra quotation marks? "["OPTRE_Ins_ER_uniform_GAgreen","OPTRE_INS_UNSC_vest2","G_Aviator","sl_phone_1","ItemMap"]"
  7. did u look for an error in .rpt file? If yes then post it. also show us the content of _Objetos
  8. sarogahtyp

    Minefield

    @alphaBroMega He was not logged in in forum since May 20, 2018
  9. I would be surprised if this solves it. As I told before, what does your script when a mountain is hit during the flight and how do you know the terrain height of the impact point before calculating it? Also how do you like to get thrust into your calculations? Its direction is changing while propulsion is active. EDIT: But I think my scripts have a big mistake in it currently therefore it will not work. I've to think about. EDIT2: First script should have correct calculations now. EDIT3: 2nd script corrected as well.
  10. afaik it detects a shell which entered the radar range, calculates its impact position and draws a marker on the map where the impact will happen.
  11. Next step is taking thrust into account: /* Author: Sarogahtyp File: calc_impact_pos.sqf Description: Calculates the impact postion of non propelled or self propelled artillery shell by a very simple and unprecise simulation of flight path This version takes possible thrust of self-propelled shell into account Parameter(s): 0: shell - the object of the shell one likes to know impact position of - default is null object Returns: position - impact position */ params [["_shell", objNull]]; if (_shell isEqualTo objNull) exitWith {[0,0,-100]}; //return nonsense position if no object was given _epsilon = 3; // meters - height at which calculation will abort due to near impact _curr_pos = position _shell; _shell_height = _curr_pos select 2; if (_shell_height < _epsilon) exitWith {position _shell}; //shell is already/nearly impacted, return its position _max_speed = 0; _grav = -9.81; _time_step = 1; // second - iteration resolution - could be adjusted to needs _thust_vec = [0,0,0]; _thrust = getNumber(configFile >> "CfgAmmo" >> (typeOf _shell) >> "thrust"); if ( _thrust > 0) then { _max_speed = getNumber(configFile >> "CfgAmmo" >> (typeOf _shell) >> "maxSpeed"); _thrust_vec = (vectorDir _shell) vectorMultiply _thrust; } _curr_vel = velocity _shell; _curr_pos_asl = getPosASL _shell; while {_shell_height > _epsilon} do { _shell_height = (ASLToATL _curr_pos_asl) select 2; //calculate next shell position by adding velocity vector to current position _curr_pos_asl = curr_pos_asl vectorAdd (_curr_vel vectorMultiply _time_step); // add velocity change caused by gravity to current velocity vector _curr_vel = _curr_vel vectorAdd [0, 0, _grav * _time_step]; // add current thrust vector to current velocity vector to take thrust into account if ((_thrust > 0) && ((vectorMagnitude _curr_vel) < _max_speed) then { _curr_vel = _curr_vel vectorAdd (_thrust_vec vectorMultiply _time_step); //calculate next base thrust vector by normalizing next velocity vector and applying base thrust _thrust_vec = (vectorNormalized _curr_vel) vectorMultiply _thrust; }; }; //return the impact position (ASLToATL _curr_pos_asl) This script is untested as well. before testing this version you should test the version without thrust to get rid of possible errors. Next step is to calculate acceleration/deceleration between time steps more precisely. After that the impact position should be relatively precise. EDIT: corrected position calculation to use ASL position format. EDIT2: corrected name of shell object in CfgAmmo lookup EDIT3: maybe this script with thrust will not work. depends on fact if mlrs uses winglets to control flight path. If so then I cant imagine a way to predict its flight path.
  12. If I did no logical mistake due to brain farting 😉 then this should give you the impact position by simulating the flight path: /* Author: Sarogahtyp File: impact_pos.sqf Description: Calculates the impact postion of non propelled artillery shell by a very simple and unprecise simulation of flight path Parameter(s): 0: shell - the object of the shell one likes to know impact position of - default is null object Returns: position - impact position */ params [["_shell", objNull]]; if (_shell isEqualTo objNull) exitWith {[0,0,-100]}; //return nonsense position if no object was given _epsilon = 3; // meters - height at which calculation will abort due to near impact _curr_pos = position _shell; _shell_height = _curr_pos select 2; if (_shell_height < _epsilon) exitWith {position _shell}; //shell is already/nearly impacted, return its position _grav = -9.81; _time_step = 1; // second - iteration resolution - could be adjusted to needs _curr_vel = velocity _shell; _curr_pos_asl = getPosASL _shell; while {_shell_height > _epsilon} do { _shell_height = (ASLToATL _curr_pos_asl) select 2; //calculate next shell position by adding velocity vector to current position _curr_pos_asl = _curr_pos_asl vectorAdd (_curr_vel vectorMultiply _time_step); //calculate next velocity vector by just taking gravity into account _curr_vel = _curr_vel vectorAdd [0, 0, _grav * _time_step]; }; //return the impact position (ASLToATL _curr_pos_asl) you should play around with _time_step to get a good balance between precision and performance. I did not test anything. errors may happen. EDIT: corrected position calculation to use ASL position format.
  13. I think you have no chance to calculate the impact point without simulating (or do some iterations of calculation) the flight instead of calculating with those simple physics formula. The reason is that you don't know the height of the terrain on impact point before calculation. Also there could be a mountain along the flight path of the shell and it would just impact in the mountain instead of flying a few kilometers more.
  14. the difference is that players would see the impact point when shell enters radar range and not just see a realtime marker of the shell.
  15. Not yet but I think u should use the alternative syntax of getPos cause it does the same and one should use the engine command if available (getPos in this case) instead of that BIS function. Later on Ill look for a solution of your 3D problem.
×