Jump to content

sarogahtyp

Member
  • Content Count

    2494
  • Joined

  • Last visited

  • Medals

Posts posted by sarogahtyp


  1. Okay, we can start that with "Weapon" memory point even if I will not let the crosshair and range show when player is not using sights.

     

    Another thing what came in my mind is to add a laser target at end position of the IR laser.

     

    So we should implement _target = "LaserTargetW" createVehicle (getpos player);  and set its pos continueously as long as the IR laser is activated.

     

    Now back to the memory point. BI is doing the same as we do with the laser itself and it is pointing always to the correct position.

    They must have a way to do that without the name of the memory point because every modder can name the memory points as he likes for his custom weapon but the IR laser is always at correct position, isnt it?

    So we have to think about how is BI doing that?


  2. Ok, I would say lets do a manual correction for that memory point problem.

    if we do a manual correction for an average weapon (average in size and IR lasers mount point) then we have a quite good solution I think.

     

    I dont know much about the different weapons in Arma 3 so I could use a hint which weapon we should take.

     

    I already began with those manual correction but its far away from being perfect:

     

       _temppos = player selectionPosition "pilot"; // thats the same as eyePos.
       _posLaser = AGLToASL (player modelToWorld ( [((_temppos select 0)+0.05), ((_temppos select 1) + 0.1), ((_temppos select 2) - 0.05)]));

    Now I ve to go to work and so I have no time to optimize it more... maybe one of u guys could.


  3. okay, i think i cant help with the start position of that range finding thing but I ve another problem.
     
    I used sjakals script and what I dont want is that the range and the crosshair is drawn when the player is not in the sights view by clicking right mouse button.

    How do I check if the player uses the weapons sights?


  4. That should work but is not tested.

    Give feedback please!

    /*
        Author: Sarogahtyp (with help from BIki examples)
        
        Parameter(s):
        0: [OBJECT] - Unit with IR laser designator equipped weapon
    
        Returns:
        [NUMBER] - distance to object or 4999 if laser disabled or not pointing to an object
    */
    
    params [["_bob",objNull,[objNull]]];
    
    //_bob = _this select 0;   that was bullsh*t i thought I deleted it
    
    _maxdist = 4999; //laser designators range (lineIntersectsSurfaces has a hardcoded limit of 5000 meters)
    _distance = _maxdist;
    
    if (isIRLaserOn currentWeapon _bob) then
    {
     _beg = eyePos _bob;
     _end = (_beg vectorAdd (_bob weaponDirection currentWeapon _bob vectorMultiply _maxdist));
    
     _array = lineIntersectsSurfaces [_beg , _end, _bob, objNull, true, 1, "GEOM","NONE"];
    
     if((count _array) > 0) then
     {
      _endL = _array select 0;
      _distance = _beg distance _endL;
     };
    };
    
    _distance
    
    • Like 2

  5. according to dreadedentitys post u could spawn scripts with infinite loops instead of calling em because they r running parallel then. I prefer to spawn scripts too if its not needed that they run in a specific order. another advantage of spawning is that the script is not running in a scheduled environment.

    if u want to learn basics about armas init order u could look here

    https://community.bistudio.com/wiki/Initialization_Order


  6. Another try without your group:

    _nearestdist=500;
    
    {
     _dist = vehicle _x distance bombmarker1;
     if (isPlayer _x and _dist < _nearestdist) then
     {
      "bombmusic" remoteExec ["playSound", _x];
     };
    } forEach playableUnits;
    

    with that code everyone nearer 500 meters around bombmarker1 should play the sound.
    if thats a suitable solution for you...

    My way to solve that may look chaotic but dont worry ... sure it is :D


  7. I was on the next step, give me some time to check the above problem.

    things will go more complicated if grp_t2 consists of a ai/player mix because your sound will get played more than one time for the owner of the ai.

    Solution for that should be:

    _owner_ids = [];
    
    {
     _owner = owner _x;
    
     if (!(_owner in _owner_ids)) then
     {
      _owner_ids pushBack (owner _x);
     "musicbomb" remoteExec ["playSound", _owner];
     };
    
    }forEach units grp_t2;
    
×