Jump to content
Spartans Home

Flight Models - Help Please


Stang~SPARTA~
 Share

Recommended Posts

Hi Guys

 

Please excuse the "noob" question here but I have searched the forums and haven't found what I'm looking for yet.

 

Here's my question:

 

I would like to be able to "limit the top speed" of several different aircraft in a mission I'm building, to make it more realistic and balance game play. Is this possible?

 

If so, please let me know how and or what utilities or tools I may need to do this.

 

Thanks for the help in advance

 

Stang out

Link to comment
Share on other sites

The correct way would be to modify the aircraft's config file and stick it in a mod, which would require everyone who joins the server to have that mod as well.

 

The "hackish" way is to add a SQF script which repeatedly limits the speed of the aircraft. It can most certainly be done, as I used a similar method to give the C-130 JATO capability, but that was only a temporary boost for a single aircraft. The performance implications of having the script run all the time on multiple aircraft might be a bit much.

 

In my opinion you'd be better off to just make do with the regular speeds I'm afraid. That, or produce an "Air Domination" mod that would be required to join the server. It's a private server anyway so doubt it'd matter all that much. Then you could do some other cool stuff like modify the aircraft HUDs or even throw in some extra aircraft from other addons.

Link to comment
Share on other sites

Thanks MH6,

 

I think your idea is the way to go as the Server is under our control and making it a Air Dom Mod would give us the best control of what's running on it.

 

I also found the script below...do you think it will work? And what tool do you need to modify the config?

 

 

For increasing the top speed of a vehicle, you need to modify the config and change following line:

 

maxSpeed = 1470; //to a value you want. (this is taken from the Su-34)

 

If you want to limit the speed of a vehicle in a mission. Use:

 

Unit forceSpeed 150;

 

Source:

 

 

 

 

The correct way would be to modify the aircraft's config file and stick it in a mod, which would require everyone who joins the server to have that mod as well.

 

The "hackish" way is to add a SQF script which repeatedly limits the speed of the aircraft. It can most certainly be done, as I used a similar method to give the C-130 JATO capability, but that was only a temporary boost for a single aircraft. The performance implications of having the script run all the time on multiple aircraft might be a bit much.

 

In my opinion you'd be better off to just make do with the regular speeds I'm afraid. That, or produce an "Air Domination" mod that would be required to join the server. It's a private server anyway so doubt it'd matter all that much. Then you could do some other cool stuff like modify the aircraft HUDs or even throw in some extra aircraft from other addons.

Edited by Stang~SPARTA~
Link to comment
Share on other sites

I also found the script below that refers to max speed as well in the model config file

 

Could this be of any use??

 

Thanks

 

 

cfgModels

This segment defines all properties of each model. The class names correspond to the model name.

Here you define which sections the model has, which skeleton it uses and its animations.

//Declare base classes

class CarAnimations

{

class IndicatorSpeed;

};

 

class CfgModels

{

class Car; //Declare base class.

 

class Vodnik: Car

{

sectionsInherit = "Car"; //Inherit all sections from class Car.

//Add new section.

sections[] =

{

"section1"

};

skeletonName = "Vodnik"; //Use the Vodnik skeleton.

 

class Animations: CarAnimations //Inherit from generic animations.

{

class IndicatorSpeed: IndicatorSpeed //Redefine the maximum value

{ //for the speed indicator.

maxValue = 40;

};

};

};

};

Link to comment
Share on other sites

You'd want to change maxSpeed in the CfgVehicle file. The model entry is just for displaying speed on the speed indicator within the cockpit (which you could change too if you really wanted to)

 

Also, didn't know about the forceSpeed command, that's cool.

 

Basically what you need to do is create a patch for that vehicle, like so:

 

Note: Use this site to determine what classes you need for each vehicle, and what the vehicle's true name is.

class CfgPatches
{
    class StangAirDom
    {
        units[] = {A10,Su34}; //Note: Add any other vehicles you add to CfgVehicles here as well
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"CAAir"}; //Let original config be loaded first
    };
};

class CfgVehicles {
// External class references
class AllVehicles;    
class Air : AllVehicles {
};
class Plane : Air {
};
//class Helicopter : Air; //For if you change helicopter settings
    //Setup each entry as follows
    //class <vehicle name> : <parent class>
    //{
    //    set values here
    //};
    class A10 : Plane
    {
        maxSpeed = 10; //Change to w/e you want
    };
    class Su34 : Plane
    {
        maxSpeed = 10; //Change to w/e you want
    };
};

 

Now you can append any other vehicles you want to change. Just read the comments I added to the above code and you should be good to go.

 

Once you're done with that you just need to stick the config.cpp file in a PBO (using CPBO) and load it as a mod. When your mod is finalized you can convert config.cpp to config.bin if you want.

 

Edit: Scratch that, isn't working. Not sure why either. Loads fine (no errors), just doesn't work.

Link to comment
Share on other sites

Man...I thought you were on a roll there <_<

 

If its possible I would like to set the max speed individually for each aircraft type used. As we will have a few new MOD aircraft, these will have to be config'd as well.

 

Here's me list of changes I would like to do, max speed shown in knots. Once Ihave these working, I will probably have to tweak them to balance game play.

 

F16 400

F35 400

Su34 400

AV8B 350

A10 350

SU25 350

C130 350

 

MH60 175

AH64 135

AH1Z 135

Ka50 150

Ka52 150

OH58 125

MH6 160

UH1Y 125

Mi8 150

Mi24 200

Mi17 125

CH53 150

 

 

We're making progress...Thanks for all the help everyone!!

 

 

 

 

Edit: Scratch that, isn't working. Not sure why either. Loads fine (no errors), just doesn't work.
Edited by Stang~SPARTA~
Link to comment
Share on other sites

Man...I thought you were on a roll there <_>

 

Yeah I thought I was too. Goes to show you things just don't always work the first time 'round. Especially if you aren't all that familiar with it (I've only messed with config files on a few occasions)

 

Might be able to get some more support at the BIS forums, under ArmA2: Configs and Scripting. Those guys probably know better than I, as some of them do nothing but mods.

Link to comment
Share on other sites

Yup...that's where I got the scripts above from LoL

 

Might be able to get some more support at the BIS forums, under ArmA2: Configs and Scripting. Those guys probably know better than I, as some of them do nothing but mods.

 

Link to comment
Share on other sites

Finaly...

 

I'm learning waaay too much about this stuff the hard way... :lol:

 

I have learned that every aircraft has it's own .pbo file and within that file is a config.bin file. I know this is basic for most of you but I'm still a HUGE NOOB here. I also learned that it takes an extraction program to extract the pbo files,...thus allowing you to see the contents of the "compiled" file.

 

Inside of the pbo file are things like the config.cpp files which contain all the scripting for the main code to follow when it runs the program. Things like colors used, sounds called, properties of items, timings, etc etc. It also contains the "inertia" table that uses values for setting limits in the physics model...like maxSpeed, which is what I want to change.

 

So......

 

I got the config.bin file open from the A10 in my working folder (this is a copy of my Arma 2 folder on a separate drive)

 

I used "unBuildArmA.exe" to un-binarized the config.bin into a config.cpp file, which I was able to edit with notepad.

 

Whoohoo!, there may be light at the end of the tunnel.

 

Below is the section that "appears" to define what I'm looking for

 

From A10 Config.cpp file

 

};

HeadAimDown = 3;

armor = 75;

damageResistance = 0.00485;

armorStructured = 1;

maxSpeed = 720;

landingAoa = "rad 10";

landingSpeed = 220;

flapsFrictionCoef = 0.3;

aileronSensitivity = 1;

elevatorSensitivity = 0.8;

envelope[] = {0.0, 0.1, 0.65, 2.2, 3.7, 5.3, 6.0, 5.5, 5.6, 4.8, 3.6, 1.8, 0};

gearUpTime = 4.5;

gearDownTime = 3;

 

 

The Big question is...Can I just modify the line

 

maxSpeed=720

to

maxSpeed=400

 

and Waaalah, I'm done.....right???

 

By the way, how do I "re-binarize" the config.cpp file back into a config.bin file???

 

Thanks again for all the help

 

Stang out

 

....making progress finaly...Yeah!

Edited by Stang~SPARTA~
Link to comment
Share on other sites

...

By the way, how do I "re-binarize" the config.cpp file back into a config.bin file???

...

 

Don't need too, it can read .cpp files just fine.

 

I was originally going to tell you do it the way you're doing it now (extract existing config file and modify that), but quite honestly a patch is the best way to do it...assuming you can get it to work. <_>

Link to comment
Share on other sites

Here's a bit more information from the Guys that helped me over at the BI forums. With this information, I think I can get this going....hopefully

 

 

From [APS]GNat on the BI Forums

 

I think you will find that instead of modifying every original PBO, you can make a couple of new ultra-simple PBO's to "overwrite" the existing config.

- Paste the below code into a new config.cpp text file

- place the file in a folder named something like STG_A10Adjust

- Turn the folder into a PBO, place the PBO into your addons folder in ArmAII

 

Code:

class CfgPatches

{

class STG_A10Adjust

{

units[] = {};

weapons[] = {};

requiredVersion = 1.00;

requiredAddons[] = {"CAA10"};

};

};

 

class CfgVehicles

{

class Plane;

class A10: Plane

{

maxSpeed = 400;

};

};

 

 

 

 

 

From TRex on the BI Forums

 

Excellent! Gnat did what I was going to do.

 

Stang, instead of sending you a config, I'll just use Gnat's excellent example. Plus, maybe someone else can use the info.

 

Think of the config as the portal for the game to reach all the great content elsewhere in the pbos. It tells the game engine what to do with all that stuff.

 

The configs are broken down into sections, depending on what it is going to do. Pay careful attention to the braces {} and semicolons ; because they tell the game engine where the ends of sections and lines are.

 

In Gnat's example, you have 2 sections: cfgPatches and cfgVehicles. The cfgPatches section has generic information about the addon you're making. If your adding units/weapons you would put them there. The required version is self-explanatory, and the required addons just makes sure the right things are added before it loads your addon.

 

The cfgVehicles section actually does the stuff you're interested in. The class Plane line tells the engine a context for your mod - that you're changing the plane values. The class A10:Plane tells the engine specifically what a/c you're going to change. The next section tells it that you're changing the value for the maxSpeed. I noticed the landing speed is high, too, so if you wanted to change both values it would look something like this:

Code:

class CfgVehicles

{

class Plane;

class A10: Plane

{

maxSpeed = 400;

landingSpeed = 120;

};

};

Oh, and another thing, you can actually use a similar process to add your own modified A-10. This could be beneficial because as long as your mod is loaded, ALL the A-10s will be affected. So, if you play a different mission with that mod, it will still have the lower values, which may or may not be what you want.

 

If you want to know how to do that (when you're ready) just post and either I or someone else will show you. Gnat is a serious guru when it comes to this stuff, so hopefully he'll do it.

Link to comment
Share on other sites

hehe

 

When doing anything dev-like in ArmA, incrementalism is your friend. :D Change a little something, see if it works, and if it does, change a little more. ;)

 

And Stang, if you get impatient, you may try this quick to limit the speed of the A-10. Just copy/paste into an empty config.cpp (in a folder that doesn't have anything else in it) and then use Kegetys cpbo util (or whatever you want to use to create a pbo as long as it isn't the BI tool).

 

class CfgPatches
{
    class STG_Fantasies
    {
    units[] = {};
    weapons[] = {};
    requiredVersion = 1.00;
    requiredAddons[] = {};    // you had CAA10, but isn't it CAA1?
    };
};

class CfgVehicles
{
    class Plane;
    class A10: Plane
    {
    maxSpeed = 400;
    landingSpeed = 125
    };
};

 

That'll just impose the limits on the A-10.

 

OH - and don't forget to create a new folder, or drop it into whatever your sparta addon folder is. You *may* want to create a new one for dev purposes. Something like:

<ArmAroot>\@Stangishness\addons

And drop the pbo in there. And don't forget to then also add it to your command line, or your launcher parameters.

 

And you thought dancing with F4 was fun.... ;)

Link to comment
Share on other sites

 Share

×
×
  • Create New...