Page 1 of 2 12 LastLast
Results 1 to 10 of 12

  Click here to go to the first Developer post in this thread.  

Thread: Repairing a Helicopter

  1. #1

    Repairing a Helicopter

    I'm working on a service script that repairs a helicopter, and it seems in Take On Helicopters simply setting damage with setDamage-command is not enough.

    We have commands setHitPointDamage and getHitPointDamage for this. However, there are a lot of different hit points. Is there a command to get list of all hitpoints of a helicopter? If I would want to completely fix the helicopter, I would need a command to get all available hitpoints so I can loop it through and set each of their damage to 0.

    I noticed a list of some known hitpoints. One way might be to create setHitPointDamage command for every known hitpoint, but isn't there any easier way to repair a helicopter completely?
    Last edited by Osmo; Mar 23 2012 at 03:07.

  2. #2
    the hitpoints are defined as classes in the config space.
    you could query the list for the current vehicle and check them one by one.

    sorry cannot provide sample code right now

  3. #3
    @Osmo - the way BIS do it to check damage is to loop through each of the damage types checking them one by one (in BIS_fnc_helicopterCanFly). I guess you would just have to do the reverse using setHitPointDamage to repair the helicopter.
    Jedra's Addons
    Arma 2 : Enhanced Skills Slider
    Take On Helicopters : Take On Taxi | Jedra's Time Trials | Weapon Indicators | No Radar

  4.   Click here to go to the next Developer post in this thread.   #4

    Lightbulb

    PHP Code:
    private ["_hpClasses""_hps"];
    _hpClasses configFile >> "CfgVehicles" >> (typeOf (vehicle player)) >> "HitPoints";
    _hps = [];

    for 
    "_i" from 0 to ((count _hpClasses) - 1) do 
    {
       private [
    "_hp"];
       
    _hp _hpClasses select _i;
       if (
    isClass _hpthen {_hps set [count _hpsconfigName _hp];};
    }; 
    • HitEngine
    • HitEngine2
    • HitEngine3
    • HitHull
    • HitHRotor
    • HitVRotor
    • HitBatteries
    • HitGlass1
    • HitGlass2
    • HitGlass3
    • HitGlass4
    • HitGlass5
    • HitRGlass
    • HitLGlass
    • HitMissiles
    • HitLight
    • HitHydraulics
    • HitTransmission
    • HitAvionics
    • HitGear
    • HitFuel
    • HitHStabilizerL1
    • HitHStabilizerR1
    • HitVStabilizer1
    • HitTail
    • HitPitotTube
    • HitStaticPort
    • HitStarter1
    • HitStarter2
    • HitStarter3
    Bohemia Interactive
    Arma 3 - Project Lead
    Watch us, tweet us, poke us

    Take On Helicopters - Project Lead
    Take On Noisecontrollers!

  5. #5
    Sergeant Osmo's Avatar
    Join Date
    Feb 20 2002
    Location
    Finland
    Posts
    130
    Author of the Thread
    Thanks for your reply!

    With the above script, I got the following arrays:

    Light:
    Code:
    ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5"]
    Medium:
    Code:
    ["HitEngine","HitEngine2","HitEngine3","HitHull","HitHRotor","HitVRotor","HitBatteries","HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitRGlass","HitLGlass","HitMissiles","HitLight","HitHydraulics","HitTransmission","HitAvionics","HitGear","HitFuel","HitHStabilizerL1","HitHStabilizerR1","HitVStabilizer1","HitTail","HitPitotTube","HitStaticPort","HitStarter1","HitStarter2","HitStarter3"]
    Heavy:
    Code:
    ["HitEngine","HitEngine2","HitEngine3","HitHull","HitHRotor","HitVRotor","HitBatteries","HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitRGlass","HitLGlass","HitMissiles","HitLight","HitHydraulics","HitTransmission","HitAvionics","HitGear","HitFuel","HitHStabilizerL1","HitHStabilizerR1","HitVStabilizer1","HitTail","HitPitotTube","HitStaticPort","HitStarter1","HitStarter2","HitStarter3"]
    How come there is no engine / rotor /transmission etc hitpoints for light helicopters? Is there some other command to get those? In my experience, when I had damaged the transmission of my light helicopter, and I tried to fix it with only setDamage 0, the helicopter transmission remained damaged, so there must be some kind of transmission hitpoint in the light helicopters as well.

    Is there any relation between setDamage and the hitpoint damages? What does setDamage exactly affect in Take On Helicopters? I see it at least brings back a destroyed rotor in the helicopter model when used.

  6. #6
    Sergeant Osmo's Avatar
    Join Date
    Feb 20 2002
    Location
    Finland
    Posts
    130
    Author of the Thread
    I've done some testing and it seems indeed the above command for Light Helicopter returns wrong list of hitpoints. Light helicopter has other hitpoints too such as "HitTransmission", although the command only returns those "HitGlass" hitpoints.

    I'll have to find another way to look for what hitpoints are available for a certain vehicle, or perhaps just loop through all of them for all choppers-

  7.   Click here to go to the next Developer post in this thread.   #7
    My quick script sample may not be able to fetch inherited classes. You'd have to also fetch the HitPoints classes from the parent classes of your helicopter (script command inheritsFrom).

  8. #8
    Sergeant Osmo's Avatar
    Join Date
    Feb 20 2002
    Location
    Finland
    Posts
    130
    Author of the Thread
    I found a BIS function that gets all of the available hitpoints for a chopper (BIS_fnc_helicopterGetHitpoints).

    Code to call the function:
    PHP Code:
    _hitpoints _heli call BIS_fnc_helicopterGetHitpoints
    BIS_fnc_helicopterGetHitpoints:
    PHP Code:
    private ["_cfgHitPoints""_hps""_funcGetHitPoints"];
    _cfgHitPoints configFile >> "CfgVehicles" >> (typeOf _this) >> "HitPoints";
    _hps = [];

    _funcGetHitPoints 
    {
        for 
    "_i" from 0 to ((count _this) - 1) do 
        {
            private [
    "_hp"];
            
    _hp configName (_this select _i);
            
            if (!(
    _hp in _hps)) then 
            
    {
                
    _hps set [count _hps_hp];
            };
        };
    };

    //Explore inheritance structure fully
    while {(configName _cfgHitPoints) != ""} do 
    {
        
    _cfgHitPoints call _funcGetHitPoints;
        
    _cfgHitPoints inheritsFrom _cfgHitPoints;
    };

    _hps 

  9.   This is the last Developer post in this thread.   #9
    Funnily enough, I wrote that function I see now ... if my memory wouldn't fail me, could have saved some time

  10. #10
    Would be interested to see your script when you are done Osmo as I need to write one myself for a mission I am doing - you would save me some time and I would probably learn something from what you have done. Also, it may come in handy in Xeno's port of Domination as that can only fix Arma helicopters at the moment.

    @DnA - I don't suppose there are a few more helicopters lying around that you forgot you developed? ;-)

Page 1 of 2 12 LastLast

Similar Threads

  1. AI Repairing...
    By gopherman in forum ARMA 2 & OA - GENERAL
    Replies: 0
    Last Post: Aug 25 2010, 23:11
  2. Repairing from 1.0 in damage
    By Muzzleflash in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Aug 9 2010, 19:39
  3. repairing in manhattan where?
    By Relemar in forum ARMA 2 & OA - OFFICIAL MISSIONS
    Replies: 3
    Last Post: Aug 15 2009, 16:11
  4. Repairing a cd
    By Koolkid101 in forum TROUBLESHOOTING
    Replies: 38
    Last Post: Feb 27 2003, 12:26
  5. Repairing a cd
    By Koolkid101 in forum GENERAL
    Replies: 5
    Last Post: Feb 26 2003, 18:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •