Helicopter.dll

Thunder Chicken

Resident Lua Script Rabble-Rouser
Donator
Joined
Mar 22, 2008
Messages
5,847
Reaction score
5,510
Points
188
Location
Massachusetts
I received a request to develop a general module for a helicopter, similar to Vinka's spacecraft.dll . I wrote a module for Kev's AH-64 Apache for my own personal amusement, and so the trick would be how to make it generalizable and how to permit add-on developer inputs for different ships.

My guess would be that a configuration file would be necessary. I'm not terribly familiar with the workings of spacecraft.dll, but if anyone has any suggestions for tips, tricks, things to remember, etc. from their experience with spacecraft.dll that might help me out?
 
Well, we already had aircraft.dll, but this is no longer in active development as far as I can tell, the main developers are only rarely active in the community now.
 
I've downloaded spacecraft3.dll and examined it. The code to create the main and tail rotor forces and torques are very straightforward, only a few dozen lines of code are needed. The real tough part would be providing for animations and the other bells and whistles.
 
Well, why don't you write down what you want to make? I think you can do a lot of stuff even without using ini files, but just inside the configuration file, when you write your own module to parse the extra stuff. Including animations.
 
Maybe just make something that could easely animate rear and top rotor,put hold alt "A" as defauld,just numpad 0 and del. to control ascend and descend,helicopter sound.
Well I'd help but I don't know to write a single line of code. :sorry:
 
Well, why don't you write down what you want to make? I think you can do a lot of stuff even without using ini files, but just inside the configuration file, when you write your own module to parse the extra stuff. Including animations.

A generic rotor/tailrotor animation with sound would be easy to enable through a config file. General animations beyond that - I'm not sure what the most generalizeable way to handle that would be.
 
I know this may be a tall order, but when the vehicle is in flight it would be nice to have a cone angle defined for the main rotor blades, and a droop cone angle for when the vehicle is landed and the engine is at idle (defined as throttled below some level). If you watch helicopters take off, especially big heavy ones, you can really see the blades lift from droop to dihedral, and this would really add realism.

Sounds complex to code, though.
 
Can anyone see where's the problem,can't make rear rotor to work proper.
 
Last edited:
Can anyone see where's the problem,can't make rear rotor to work proper.

There is one thing in the .ini that need to be fixed:
--------------------
[ANIM_COMP_1]
; Rear Rotor

SEQ=0
GROUPS=0,5,8,11
RANGE=(0,1)

ROT_PNT=(0,0,0) <--------This needs to be the location of the tail rotor
relative to the ship center of gravity. Something like (0, some positive number around 6, some negative number around -35). If you can open the mesh, just get the y and z coordinates of the tailrotor axis.

ROT_AXIS=(1,0,0)
ANGLE=360.
---------------------------
In the scenario file, there is a line starting with 'SEQ' - remove this, it screws up the default position of the meshes.
 
Last edited:
You could use ar81's Mesh Wizard:-

[ame="http://www.orbithangar.com/searchid.php?ID=2740"]Mesh Wizard 1.9d[/ame]

N.
 
It' could be locate with anim8tor.

clipboard02sm5.jpg


For rear rotot.

[ANIM_COMP_1]
; rear rotor
SEQ=0
GROUPS=0,5,8,11
RANGE=(0,1)
ROT_PNT=(0.569,4.9746,-33.743)
ROT_AXIS=(1,0,0)
ANGLE=360.
 
One more thing to fix - in the main rotor animation component, set ANGLE=-360 (if you slow down time, you'll see that the main rotor rotates the wrong way if ANGLE=360, just reverse the sign to take care of that).

I'll take a look at making a general helicopter.dll that works with your Skycrane. If I can get something to work for that, then that should keep most of the rotorheads happy.


-----Posted Added-----


I know this may be a tall order, but when the vehicle is in flight it would be nice to have a cone angle defined for the main rotor blades, and a droop cone angle for when the vehicle is landed and the engine is at idle (defined as throttled below some level). If you watch helicopters take off, especially big heavy ones, you can really see the blades lift from droop to dihedral, and this would really add realism.

Sounds complex to code, though.

You could use the lift force from the helicopter code and relate it to a cone angle. I think one could animate each blade to tilt up or down relative to the hub during rotation based on this. Maybe in helicopter2.dll ;)
 
I'll take a look at making a general helicopter.dll that works with your Skycrane. If I can get something to work for that, then that should keep most of the rotorheads happy.

Well, I also think about making one such generic module, but more similar to the Velcro rockets concept (As using ini files is a relict from the times when parsing the configuration file was not possible).

Maybe, we can join efforts, if we can find a common way.

Here is a list of features what I would expect from a excellent helicopter.dll (not all to be done):


  • Support generic animations and special animations, like:
    • Rotors and rotor elements
    • Landing gear
    • Doors
    • Winch
  • Support attachment points. Ideally allow also a generic winch animation with attachment system.
  • Support a basic VC, based on using common pattern elements (for example cyclic control or MFDs)
  • Support UMMU, but without a docking port.
  • Support Kulchs payload system, if possible.
  • Support Orbiter Sound.
  • Pseudo-Realistic flight physics, which means, better than SimCopter, but less fine-tuned as the old DID games (Hind, Apache Longbow). Concentrate flight physics for Earth.
  • Allow acting as Non-Player Vessels, assigning generic mission profiles to them (For example as SAR helicopter).
  • Develop a system to let helicopters land on other vessels, more specific ships or oil rigs.
  • Support light beacons.
 
Well, I also think about making one such generic module, but more similar to the Velcro rockets concept (As using ini files is a relict from the times when parsing the configuration file was not possible).

Maybe, we can join efforts, if we can find a common way.

You have some ideas for helicopter.dll that are beyond my experience. I'll take your list and pull out what I think I can do, and another list where some help would be needed (and I would need a lot):

What I can handle:
-Support generic animations, like:
  • Rotors and rotor elements
-Support Orbiter Sound.
-Pseudo-Realistic flight physics, which means, better than SimCopter, but less fine-tuned as the old DID games (Hind, Apache Longbow). Concentrate flight physics for Earth.
-Support light beacons.
What I would need assistance with:

-Support special animations, like:

  • Landing gear
  • Doors
  • Winch
-Support attachment points. Ideally allow also a generic winch animation with attachment system.
-Support a basic VC, based on using common pattern elements (for example cyclic control or MFDs)
-Support UMMU, but without a docking port.
-Support Kulchs payload system, if possible.
-Allow acting as Non-Player Vessels, assigning generic mission profiles to them (For example as SAR helicopter).
-Develop a system to let helicopters land on other vessels, more specific ships or oil rigs.
The flight physics is really pretty simple and realistic. It's based on a so-called 'boostrap' method of Lowry, used to predict propeller-driven aircraft performance, and it works nicely with helicopters. It is physics driven, and naturally sets ceiling altitudes, etc (no flying helicopters in LEO or on the moon).

I think perhaps the thing to do is to make a function that takes the required inputs and spits out the rotor forces. This can then be incorporated into a code that would include all of the animations, etc.


-----Posted Added-----


I suppose the first major hurdle is to actually figure out how to read information from a config file using Visual C++. The following gives me tons of linker errors, just opening and closing the file.

#include <iostream>
#include <fstream>
#include <cstdlib>

void RotorThrust ()
{
std::ifstream data_file; // File we are reading the data from
data_file.open("Helicopter.cfg");

/* read in data here */

data_file.close( );
}
 
Because, prior to your post, I was ignorant of the existence of oapiOpenFile :(. I'm still learning, mind you.

No problem, i think I should not tell you, that you will get a opened file handle for the current vessel configuration file in the parameters of function clbkSetClassCaps(). ;)
 
I am trying this, but I am getting linker errors:

FILEHANDLE input_file;
input_file= oapiOpenFile ("/Helicopter/Helicopter.cfg", FILE_IN, CONFIG);

The config file is in C:/Orbiter/Config/Helicopter/Helicopter.cfg
 
I am trying this, but I am getting linker errors:

FILEHANDLE input_file;
input_file= oapiOpenFile ("/Helicopter/Helicopter.cfg", FILE_IN, CONFIG);

The config file is in C:/Orbiter/Config/Helicopter/Helicopter.cfg

Did you include the orbiter library files to the project (Orbiter.lib and OrbiterSDK.lib)?
 
Back
Top