Jump to content

Robustcolor

Member
  • Content Count

    363
  • Joined

  • Last visited

  • Medals

Posts posted by Robustcolor


  1. Hi, is there a way to make the image fill the black box that shows when using a hint with image? Not talking about the regular hint shadow. As of now it fits perfect with the width aspect but there's some black window under the image making it look wierd between picture and text. Using width = '' or height = '' does not affect picture size.

    hint parseText "<img size ='8' img image = 'pictures\missionImages\missionImage.jpg'/><br/><br/><t size='1'>Search and Destroy</t>";

     


  2. Hi, is there any way of fecthing different soundfiles attached to the speaker _x command? I mean, using different mods like SOG have new voice lines and i would like to use the voice lines attached to the unit.

     

    My goal is to be able to do something like this below with the attached accent/soundfile for the specific unit.

    [_unit,[selectRandom ["ThrowingSmokeE_1","ThrowingSmokeE_2","ThrowingSmokeE_3"],250,1]] remoteExec ["say3D"];


  3. Hi @gatordev, the exitWith will not return the modified _damage to the EH when exiting from the main scope. Try a different approach with a ifThen or a call{} before using exitWith.

    this addEventHandler [
    	"HandleDamage", 
    	{ 
    		params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    		private _previousDamage = [_unit getHit _selection, damage _unit] select (_selection isEqualTo "");  // if selection is empty then it's overall damage
    		private _newDamage = _damage - _previousDamage;
    		call {
    		if ("glass" in toLower _selection || "window" in toLower _selection) exitWith {
    			(_previousDamage + _newDamage * 0.1)
    		};
    		(_previousDamage + _newDamage * 0.7)
    		};
    	}
    ];

     

    • Like 2
    • Thanks 1

  4. Hi @dupa1, use this in initPlayerLocal.sqf, play around with the numbers to change the angle. Remember that this will be overwrited with the new camera angle you set with the mouse inside the arsenal when you exit it. So if you want to reset it to the angle from the script use a arsenalClosed EventHandler.

    BIS_fnc_arsenal_campos_0 = [5,170,18,[0,0,0.85]];
    [missionNamespace, "arsenalClosed", {
    	BIS_fnc_arsenal_campos_0 = [5,170,18,[0,0,0.85]];
    }] call BIS_fnc_addScriptedEventHandler;

     

    • Like 1

  5. 23 minutes ago, Harzach said:

     

    Show your code.

    this addEventHandler ["HandleHeal", { 

        _this spawn { 

        params ["_injured", "_healer"]; 

        private _damage = damage _injured;

        waitUntil {(damage _injured != _damage)}; 

        if (damage _injured < _damage) then { 

            _injured setDamage 0; 

            }; 

        }; 

    }];


  6. 39 minutes ago, Harzach said:

     

    How did you come to this conclusion? MP is where this discussion started (see source link posted by HazJ above).

    Well the thing is, handleheal never triggers if someone heals you even if both has the EH. The EH only works for the local player starting a self heal or healing an AI. 

     

    There is no effect in MP between players when im testing it, Injured or healer is either the player or an AI, never another pllayer starting healing others. 

     

    So my question is, is there a solution for this? 


  7. Question, when searching in player inventory for items that has a specific string in them, in this case mine and then removing only one of it. Is this the right approach?

    First code i select all items with mine then removing one of it (seems unnecessary to select all when only one is needed to be removed) , second code is more of a BOOL but works for some reason. Is there a better way of doing this?

    player removeItem selectRandom (items player select {"mine" in _x})
    player removeitem selectRandom items player in ['mine'];

     


  8. On 1/28/2015 at 6:36 AM, das attorney said:

    The commands like removeMagazine just remove a random mag, so you can never specify which one you are working with. You could write something to iterate through until you remove the mag you want and then add the ones back in that were deleted before, but it seems like quite a lot of work and could be glitchy especially in MP. Just my own opinion though.

    Anyone figured this out how to remove a specific magazine? Since magazinesAmmoFull gives an ID with toFixed 0 but when using removeMagazine it just deletes a random magazine one.

     

    Example;
    toFixed 0;
    _magazines = magazinesAmmoFull player select {_x select 1 isNotEqualTo 18};
    {player removeMagazine _x select 0} count _magazines;

     


  9. 4 hours ago, pierremgi said:

    Sorry, I can't reproduce that, neither with script, nor module. Backpack is ventral 1st or 3rd view. Did you change something? what is the context, backpack, MP or SP...?

    Nothing changed from your code, just wondering if it's suppose to look like this in first person view.

    20230517104715-1.jpg


  10. On 12/2/2017 at 10:21 PM, pierremgi said:

    'WeaponHolderSimulated_Scripted

    Does all holders float beneath the player when using first person view? Looks ok when using third person view.

     

    Also, what's the reason for using false inside the stackedEH?

    On 12/2/2017 at 10:21 PM, pierremgi said:

    false },_parameters] call bis_fnc_addStackedEventHandler;

     


  11. Does this work if someone else is healing you?

     

    I also read this

    Quote

    If unit walks away from the healer during healing action, the heal will not finish but there is no way to detect this within "HandleHeal" framework.

    So if removing this line if (_injured == _healer) then and adding something like this to the waitUntil, waitUntil {damage _injured != _damage || _healer distance2d _injured > 5};

     

    Will it work?


  12. This command seems to follow head movement, worldToScreen.

    _position = worldToScreen (_x modelToWorldVisual (_x selectionPosition "head")) gives y,x, but it's not centered. Can't figure it out.

    _position set [2, ((_x selectionPosition 'head') # 2) + 0.4 + _dist/1.5]; sets height.

    I think worldToScreen needs to consider safeZones since the nametag just centers in one position on screen.

     


  13. Anyone have suggestion how to improve this code to follow head movement? Similiar to ace variant.

     

    This centers above head and cares for distance but stays in same position if a player leans, would like it to center above head if a player is leaning aswell.

    _x modelToWorldVisual [0,0,((_x selectionPosition 'head') select 2) + 0.4 + _dist/1.5],


  14. Hi, has anyone figured out how to use getObjectFov or something similiar like this http://killzonekid.com/arma-scripting-tutorials-get-zoom/ inside a draw3D? So the position of the drawIcon is still at the correct height when zooming.

    addMissionEventHandler ["Draw3D", { 
      { 
        if (side _x == side player && {alive _x }) then { 
          _dist = (player distance _x) / 15; 
          _color = getArray (configFile/'CfgInGameUI'/'SideColors'/'colorFriendly'); 
          _color set [3, 1 - _dist]; 
    
          drawIcon3D [ '', 
            _color, 
            [visiblePosition _x select 0, visiblePosition _x select 1, (visiblePosition _x select 2) + ((_x modelToWorld (_x selectionPosition 'head')) select 2) + 0.4 + _dist/1.5],
            0, 0, 0,
            name _x,
            2, 
            0.03,
            'PuristaMedium' 
          ]; 
        }; 
      } count allUnits - [player];
    }];

     

×