Jump to content


  • Content count

  • Joined

  • Last visited

  • Medals

Community Reputation

218 Excellent


About Leopard20

  • Rank
    Staff Sergeant

Profile Information

  • Gender
  • Location
  • Interests
    ARMA Scripting

Recent Profile Visitors

1400 profile views
  1. @Dedmen Right! "Lazy-checking" the condition using { } (at least that's what Larrow called it!)! I totally forgot! Thanks! The reason for checking that the target (player) is facing the wounded unit is to make sure that the action correctly corresponds to the unit you're looking at, not any random unit in your vicinity.
  2. Here's the code: Init box: this setVariable ["VehDamage", (getDammage this)]; this addEventHandler ["HandleDamage", { params ["_obj", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; _damage = ((_obj getVariable ["VehDamage", 0]) + _damage)/2 min 1; //**** _obj setDamage _damage; _obj setVariable ["VehDamage", _damage]; _damage }]; If you want to reduce the damage even further, like 1/3, change the asterisked line as follows: _damage = ((_obj getVariable ["VehDamage", 0])*2 + _damage)/3 min 1; //**** Note that it won't necessarily reduce the damage by half; it will simply keep it "close" to the previous damage to prevent "excessive" damage (sometimes damages over 1 can be dealt to objects!) For the mod version, you can add a loop like this: waitUntil { sleep 10; { if (vehicle _x != _x) then { _veh = vehicle _x; if (_veh getVariable ["damageEH", -1] == -1) then { _veh setVariable ["VehDamage", (getDammage _veh)]; _EH = _veh addEventHandler ["HandleDamage", { params ["_obj", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; _damage = ((_obj getVariable ["VehDamage", 0]) + _damage)/2 min 1; //**** _obj setDamage _damage; _obj setVariable ["VehDamage", _damage]; _damage }]; _veh setVariable ["damageEH", _EH]; } } } forEach allUnits; false } This will add the EH to all manned vehicles. Of course you can still make this more elaborate but I'm not in the mood to explain!
  3. @john1 For creating convoys, fast roping and heli pickups you might wanna check C2 by mad_cheese. He's doing a great job at them. He also has a vehicle spawner mod you might wanna check out. They're all at his Discord channel. You can also spawn vehicles via Zeus if you enable it in my mod's settings. Changing spacing and formation for vehicles (especially air vehicles) is not possible in ARMA 3 (at least not without complicated coding). Even getting a convoy to successfully move from one point to another is a hit-or-miss. As for the half-damage-feature request, lucky for you I've been developing something similar (although more complex) for my upcoming mission. I'll post it for you when I get a chance. But I won't incorporate it into the mod, because it's nothing but a cheat. You can, however, add it to the vehicle's init field or create a mod for it yourself. You can dismantle a mod that does something similar (Liability Insurance is a great example), namely adding an EH, replace the code and recompile it for your personal use.
  4. Arma 3 Notepad++ Syntax Highlighting

    @Janez Hi. It turns out the issue I had with alphabetical sorting was because of a bug in Notepad++. I was using Function Completion only, but after switching to "Word and Function Completion" my issue is gone! I hope it'll be useful to others running into the same problem!
  5. Hi guys. I want to create a healing script using Hold Actions. I was wondering which method is best performance-wise. 1. Adding the hold actions to all individual units, with a straightforward conditionShow (see the Hold actions description): "alive _target && _target distance _this < 5 && getDammage _target > 0" in the above code, _target is the unit the action is attached to and _this is the caller (i.e player). Also, the action is removed every time it's added, so it might be applied to each unit multiple times during a game session. This code is simple if added to just one unit. However, there will be too many of these if there are lots of units (I'm aiming for +60!). 2. Adding only one action and to the player, but modifying the conditionShow as follows: "call {_units = applicableUnits select {alive _x && _x distance _target < 5 && ([visiblePosition _target, getDir _target, 60, visiblePosition _x] call BIS_fnc_inAngleSector) && (getDammage _x > 0)}; if (count _units > 0) then {_unit = _units select 0; _target setVariable ['target', _unit]; true} else {false}}" in the above code, _target is the same as the caller (i.e player), and applicableUnits is an array of applicable units! The reason for adding the "target" variable is here: This code is obviously more demanding, especially if it's run on each frame (which I'm assuming it is).
  6. Nope! At least not yet! I just typed all that on my phone. I'll have to check it later on my computer! ;)
  7. Think of it as a healing script. I want to heal the unit. https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd What I meant by my previous code is that the action appears when you look at the unit and he's close to you. I use the "patient" variable to later retrieve the unit in the conditionshow, thus eliminating the need to look at the unit all the time and also using it in code progress part.
  8. What about this one: //adding this to the "action appear" condition _unit = cursorObject player; if !(_unit in WoundedUnits && _unit distance player < 7) then {_unit = objNull}; player setVariable ["patient", _unit]} and then using this variable in "condition progress" for further processing.
  9. I don't want the player to look at the unit directly. The unit being in player's filed of view should suffice!
  10. Not a bad idea. There's just one tiny problem. I'm creating a script that performs an action on the hidden unit and thus adding the action to the unit is more convenient (you can easily retrieve the unit, i.e. target, using the action parameters). If I add it to the player, I probably should resort to using something like this: _units = allUnits select {_x distance player < 7 && ([visiblePosition player, getDir player, 60, visiblePosition _x] call BIS_fnc_inAngleSector)}; _units = [_units, [], {_x distance2D player}, "ASCEND"] call BIS_fnc_SortBy; _unit = _units select 0; just to get the unit the player is looking at! Doesn't it make the game slow?
  11. Hello everyone. Does anyone know a way to add hold actions to hidden units? Unfortunately, when a unit is hidden using hideObject the action doesn't appear anymore. However, if there was a way to hide the unit without using hideObject it would work. My first idea was to use setObjectTexture, but it doesn't hide the unit completely (the unit's face and arms are still visible)
  12. Arma 3 Notepad++ Syntax Highlighting

    @Janez Turns out the above command's sibling is also missing! BIS_fnc_holdActionRemove
  13. Arma 3 Notepad++ Syntax Highlighting

    @Janez Another missing command that I came across: BIS_fnc_holdActionAdd
  14. Hi! Thanks for the bug report. I'll look into it. If you use the "Fortify Position" infantry command under "Defense" sub-menu, you can get them to spread around in a circular fashion and take cover within a set radius. They will also use nearby buildings. I haven't checked this function in a while so it might not work perfectly but give it a go!
  15. Anyone else know the answer?