Home   Help Search Login Register  

Author Topic: Helo config change problem  (Read 2827 times)

0 Members and 1 Guest are viewing this topic.

Offline Trexian

  • Members
  • *
Helo config change problem
« on: 10 Feb 2010, 18:51:53 »
I am beginning to fear that I have a fundamental misunderstanding of classes and inheritance.

Goal: change the maxspeed value of several helos.

My test config to change AH-64 max speed:
Code: [Select]
// Stang's adjusted flight models


class CfgPatches
{
class STG_FantasiesRW
{
units[] = {};
weapons[] = {};
requiredVersion = 1.00;
requiredAddons[] = {"CAA10","CAAir"};
};
};

class CfgVehicles
{
class Helicopter;
class AH64_base_EP1;
class AH64D: AH64_base_EP1
{
maxSpeed = 150;
};

};

It is in the AH64D class that the maxspeed is defined.

Now, I got the AH64_base_EP1 class from kju's all-in-one, and from here:
http://www.ofpec.com/COMREF/index.php?action=read&id=209

Full disclosure - BI thread here, where Gnat points out that I may be referencing the wrong classes:
http://forums.bistudio.com/showthread.php?t=94407&page=5

But, I simply cannot figure out what class is the correct one, if not this one.
Sic semper tyrannosauro.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Helo config change problem
« Reply #1 on: 10 Feb 2010, 19:26:02 »
AH64 already exists as a class in the 'real' air.pbo's config, so you can simply write:

Code: [Select]
class AH64D;
class AH64D: AH64D
{
bla bla
};

This is of course in theory - I've found that inheritance is rarely as easy as it seems  >:( Try making a new class to test it instead, class STG_AH64D, displayName = "My test choppa". And such?

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Helo config change problem
« Reply #2 on: 10 Feb 2010, 19:41:39 »
Nah your above example is correct, apart from

class Helicopter;//not needed

requiredAddons[] = {"CA_AH64D"};//you need to define the cfgPatches class the unit is defined in.


The config from Wolfrug might somewhat work,
yet is not correct and breaks the class inheritance.
Very bad to do this.


Back to your initial goal.
From what I recall speed is mainly based on the model p3d. Weight, mass and such.
The config speed values is (only?) for AI.


So p3d modification plus envelope array (config value) are the way to tweak the FM.
And scripting. Check easyfly by Celery for example.
« Last Edit: 10 Feb 2010, 19:44:40 by kju »

Offline modEmMaik

  • Members
  • *
Re: Helo config change problem
« Reply #3 on: 10 Feb 2010, 19:57:33 »
Well, maxspeed has an impact on the maximum speed ingame (I had to adjust it in the latest NH90 release, because I modified some other options  :o ).

But the mass distribution in the model may lower the maximum speed in game. But BI models usually get rather close to the maxSpeed option.

wolfrug's config may work, but when a function tries to to determine the lowest class, it ends up in a never ending loop.  ???

Offline Trexian

  • Members
  • *
Re: Helo config change problem
« Reply #4 on: 10 Feb 2010, 20:05:29 »
Thanks, guys, I really do appreciate it.

I'm basically helping this guy Stang out - he's doing the testing on it.  The simple config I posted does not work.  However, we're going to try some error-isolation to make sure that something else isn't interfering with it.

Oh - and no need to convince me on the futility of messing with flight models. :)  IMHO, the flight aspect of A2 is really just for fun, and to give the *idea* of flying in combat, not to really simulate it.

But, Stang has been mucking around with simulated aircraft longer than he'd care to admit. ;)
Sic semper tyrannosauro.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Helo config change problem
« Reply #5 on: 11 Feb 2010, 06:10:50 »
Um ... yes the base classes given for BI's new Apache are correct with:

"AH64_base_EP1" as the base class, followed by ...
"AH64D" and
"AH64D_Sidewinders"


Planck
I know a little about a lot, and a lot about a little.

Offline Trexian

  • Members
  • *
Re: Helo config change problem
« Reply #6 on: 12 Feb 2010, 05:25:02 »
Wow - just verified myself.

My original config at the top, although it appears to use the correct classnames, doesn't actually change the max speed of the AH64D.

Are the flight characteristics for helos located someplace else?
Sic semper tyrannosauro.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Helo config change problem
« Reply #7 on: 12 Feb 2010, 05:59:57 »
In the config.cpp for the Ah64.pbo, for the "AH64D":

Code: [Select]
class AH64D: AH64_base_EP1
 {
  destrType = "DestructWreck";
  soundGetIn[] = {"ca\sounds\air\noises\heli_door_01",0.316228,1};
  soundGetOut[] = {"ca\sounds\air\noises\heli_door_01",0.316228,1,50};
  soundDammage[] = {"ca\sounds\air\noises\alarm_loop1",0.001,1};
  soundEngineOnInt[] = {"ca\sounds\Air\UH1Y\int\int-start-final",0.0316228,1};
  soundEngineOnExt[] = {"ca\sounds\Air\UH1Y\ext\ext-motor-start",1.77828,1,700};
  soundEngineOffInt[] = {"ca\sounds\Air\UH1Y\int\int-stop-final",0.0316228,1};
  soundEngineOffExt[] = {"ca\sounds\Air\UH1Y\ext\ext-motor-stop",1.77828,1,700};
  class Sounds
  {
   class Engine
   {
    sound[] = {"ca\sounds\air\ah1\ext\ext-ah1z-engine-01",3.16228,1.1,800};
    frequency = "rotorSpeed";
    volume = "camPos*((rotorSpeed-0.72)*4)";
   };
   class RotorLowOut
   {
    sound[] = {"ca\sounds\air\AH64\ext-rotor-ah64d_A",3.16228,1,1300};
    frequency = "rotorSpeed";
    volume = "camPos*(0 max (rotorSpeed-0.1))";
    cone[] = {1.8,3.14,2,0.9};
   };
   class RotorHighOut
   {
    sound[] = {"ca\sounds\air\AH64\ext-rotor-ah64d_B",3.16228,1,1800};
    frequency = "rotorSpeed";
    volume = "camPos*10*(0 max (rotorThrust-0.95))";
    cone[] = {1.8,3.14,2,0.9};
   };
   class EngineIn
   {
    sound[] = {"ca\sounds\air\AH64\int-fly-ah64d",1.77828,1};
    frequency = "rotorSpeed";
    volume = "(1-camPos)*((rotorSpeed-0.75)*4)";
   };
   class RotorLowIn
   {
    sound[] = {"ca\sounds\air\AH64\ext-rotor-ah64d_A",1,1};
    frequency = "rotorSpeed";
    volume = "2*(1-camPos)*((rotorSpeed factor[0.3, 1.1]) min (rotorSpeed factor[1.1, 0.3]))";
   };
   class RotorHighIn
   {
    sound[] = {"ca\sounds\air\AH64\ext-rotor-ah64d_B",1.77828,1};
    frequency = "rotorSpeed";
    volume = "(1-camPos)*3*(rotorThrust-0.9)";
   };
  };
  scope = 2;
  accuracy = 1000;
  cost = 10000000;
  model = "\ca\AH64\AH64D";
  armor = 60;
  damageResistance = 0.00593;
  vehicleClass = "Air";
  laserScanner = 1;
  MainRotorSpeed = -1;
  backRotorSpeed = 3;
  weapons[] = {};
  magazines[] = {};
  picture = "\ca\AH64\data\UI\Picture_ah64d_CA.paa";
  icon = "\ca\AH64\data\UI\Icon_ah64d_CA.paa";
  mapSize = 15.5;
  maxSpeed = 293;
  displayName = "AH-64D";
  crew = "USMC_Soldier_Pilot";
  typicalCargo[] = {"USMC_Soldier_Pilot","USMC_Soldier_Pilot"};
  driverAction = "AH64_Pilot";
  threat[] = {0.3,1,0.8};
  memoryPointLMissile = "Missile_1";
  memoryPointRMissile = "Missile_2";
  memoryPointLRocket = "Rocket_1";
  memoryPointRRocket = "Rocket_2";
  selectionFireAnim = "zasleh";
  class HitPoints: HitPoints
  {
   class HitGlass1: HitGlass1
   {
    armor = 0.5;
   };
   class HitGlass2: HitGlass2
   {
    armor = 0.5;
   };
   class HitGlass3: HitGlass3
   {
    armor = 0.5;
   };
   class HitGlass4: HitGlass4
   {
    armor = 0.5;
   };
   class HitGlass5: HitGlass5
   {
    armor = 0.5;
   };
  };
  dammageHalf[] = {"\CA\AH64\data\AH64D_mfd_normal_co.paa","\CA\AH64\data\AH64D_mfd_malfc_co.paa"};
  dammageFull[] = {"\CA\AH64\data\AH64D_mfd_normal_co.paa","\CA\AH64\data\AH64D_mfd_malfc_co.paa"};
  class Damage
  {
   tex[] = {};
   mat[] = {"ca\ah64\Data\AH64D_body.rvmat","ca\ah64\Data\AH64D_body_damage.rvmat","ca\ah64\Data\AH64D_body_destruct.rvmat","ca\ah64\Data\AH64D_details.rvmat","ca\ah64\Data\AH64D_details_damage.rvmat","ca\ah64\Data\AH64D_details_destruct.rvmat","ca\ah64\Data\AH64D_inter.rvmat","ca\ah64\Data\AH64D_inter_damage.rvmat","ca\ah64\Data\AH64D_inter_destruct.rvmat","ca\ah64\Data\AH64D_glass.rvmat","ca\ah64\Data\AH64D_glass_damage.rvmat","ca\ah64\Data\AH64D_glass_damage.rvmat","ca\ah64\Data\AH64D_glass_in.rvmat","ca\ah64\Data\AH64D_glass_in_damage.rvmat","ca\ah64\Data\AH64D_glass_in_damage.rvmat"};
  };
  class Turrets: Turrets
  {
   class MainTurret: MainTurret
   {
    gunnerAction = "AH64_Gunner";
    gunnerInAction = "AH64_Gunner";
    minElev = -60;
    maxElev = 15;
    initElev = 0;
    minTurn = -120;
    maxTurn = 120;
    initTurn = 0;
    weapons[] = {"M230","FFARLauncher","HellfireLauncher"};
    magazines[] = {"1200Rnd_30x113mm_M789_HEDP","38Rnd_FFAR","8Rnd_Hellfire"};
    enableManualFire = 1;
    memoryPointsGetInGunner = "pos_gunner";
    memoryPointsGetInGunnerDir = "pos_gunner_dir";
    gunnerGetInAction = "GetInHigh";
    gunnerGetOutAction = "GetOutHigh";
    memoryPointGun = "machinegun";
    gunnerOpticsModel = "\ca\air\optika_AH1Z";
    class ViewOptics
    {
     initAngleX = 0;
     minAngleX = -30;
     maxAngleX = 30;
     initAngleY = 0;
     minAngleY = -100;
     maxAngleY = 100;
     initFov = 0.155;
     minFov = 0.047;
     maxFov = 0.155;
    };
   };
  };
 };


Planck
« Last Edit: 12 Feb 2010, 16:45:01 by Planck »
I know a little about a lot, and a lot about a little.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Helo config change problem
« Reply #8 on: 12 Feb 2010, 12:37:38 »
Quote
Are the flight characteristics for helos located someplace else?

 There very well could be if your using other addons ;).
   If your using Vanilla then i would suggest you do an accurate test , i have found t , the nature of Air vehicles is not all that reliable and can be exceeded due toother factors such as , weight in Geometry and centers can affect speed too not only in lift but foreward.
 however if your chopper is maintaining a higher speed constantly for a good period of time way above what you have set , then i would suggest that :

A another addon is updating the AH64 class again after yours
B your addon as an addon requirement in its config that is out of sync with BIS setup
C you have a previous version saved locally ( look in your saved mission folders addons are saved there too especially when messing with userconfigs ( Alot of people dont realise they get BLah requires _x when they delete an @ folder and there is still a version loading from there saved folder )).
D check the original AH64  does it actually max out at the speed defined in the config or have BIS dropped a bollock and forgot to inherit from a previous class something that was required ?

 check your Arma.rpt for signs of Updating cfg class Helicopter/air/ah64 etc and see if you can trace the last update .


the easiest way to do this IMO would be to copyt the AH64 config and retag it to your needs and see if it works , if it does and you dont have any bad Updating of classes in your amra .rpt then you good to go.


I love ofp

Offline Trexian

  • Members
  • *
Re: Helo config change problem
« Reply #9 on: 12 Feb 2010, 13:53:49 »
Thanks Deano.  Here's a rundown of how my test went.

- config - removed all addon requirements from the config
- other addons - ran it with my "testing" shortcut that only had JTD stuff, none of which changed helos, or any other vehicles for that matter :)
- empty -64D on the tarmac, got in, took off, kept it "level" (there was a bit of porpoising in altitude as I balanced nose-down/forward against "up") and blew past 150 up into the 200s
- the mission was my mine-testing mission, which had never had a helo in it before
- this was the first time I even tried the -64D (nice bird, though)
- the BI config indeed sets a max speed for the -64D (@293) and it appears to inherit correctly

The one thing is, I did not check the rpt.  I will check that tonight.
Sic semper tyrannosauro.