Jump to content

DCS Mods structure : How to create your plugin from scratch


Recommended Posts

I'm having an issue that I just can't get my head around. When adding force in the ed_fm_add_local_force function the plane starts to nose up (x), nose down (y) or roll left (z) as if I'm not adding the force the CoG. But I am giving it a force-position of 0,0,0 so this shouldn't happen. Something I am missing? Please help if you can :)

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

Not sure what is going on...

 

So if it is just pitch and roll... look at the z and x axis respectively. Remember that ED uses a different axis-system as opposed to almost every text on stability and control out there on the subject.

"It's not the years, honey. It's the mileage..."

Link to comment
Share on other sites

Thanks! I am setting the other forces to 0 and testing each one individually, so whichever axis is which shouldn't matter in this case as the aircraft shouldn't rotate at all if I haven't misunderstood something. I can rotate the aircraft as I want in the ed_fm_add_local_moment function, this works just the way I think it does, the problem just lies in the ed_fm_add_local_force function. I'd really appreciate if anyone could take a look at an own project to see if maybe ED has changed something or the other over the past couple of updates.

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

Thanks! I am setting the other forces to 0 and testing each one individually, so whichever axis is which shouldn't matter in this case as the aircraft shouldn't rotate at all if I haven't misunderstood something. I can rotate the aircraft as I want in the ed_fm_add_local_moment function, this works just the way I think it does, the problem just lies in the ed_fm_add_local_force function. I'd really appreciate if anyone could take a look at an own project to see if maybe ED has changed something or the other over the past couple of updates.

Ok, so I put a few hours into trial-and-error and found that if you put:

pos_x = 0.17939;
pos_y = 0.25561;
pos_z = 0;

you get pretty near the CoG... Strange anyway. :huh:

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

Ok, so I put a few hours into trial-and-error and found that if you put:

pos_x = 0.17939;
pos_y = 0.25561;
pos_z = 0;

you get pretty near the CoG... Strange anyway. :huh:

Ahhhh :doh: Disregard. Its in the entry.lua...

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

  • 3 weeks later...

Cockpit trials

 

Hi guys,

 

I am putting my hands in the cockpit mechanics for a while and finally got some of my homemade arguments to work. I can push some buttons and make the external model do some things, but, I still do have a residual bug for a long time now that, as usual I do not understand despite liters of coffee, outside of the box thinking and buddism zen attitude...

 

The dummies I am creating in 3Ds max (I have tried several same result: Helpers as dummy, box (different sizes) etc..). The dummy is at the size of the required lever or button. In appears correctly as a connector in Modelviewer. It is tag properly as required as well BUT:

In the game, the dummies are like ten times their actual sizes and are overlapping, messing around the whole cockpit. I did some screenshots to illustrate. In the last one you will see the actual "activated" area. I triple^n checked the units as meters etc...Any clues? :helpsmilie:

 

 

ysgd.th.jpgsbjv.th.jpg9vnw.th.jpg

 

Appreciate your thoughts! :smartass:

Erwan "Airone", JetESons Team Member

AlphaJet Lover

Link to comment
Share on other sites

Make the dummy size 4.0 meters, then scale it to fit the switch, that'll fix the issue.

i7 7700K | 32GB RAM | GTX 1080Ti | Rift CV1 | TM Warthog | Win 10

 

"There will always be people with a false sense of entitlement.

You can want it, you can ask for it, but you don't automatically deserve it. "

Link to comment
Share on other sites

Make the dummy size 4.0 meters, then scale it to fit the switch, that'll fix the issue.

 

Oh man, you killed it in an eyeblink!

 

I am speechless, I guess my outside the box thinking should increase by 4 meters! It works perfectly... :thumbup: :doh:

 

I own you one buddy...No actually, open a line of credit for me because I I think I may own you more... lol

 

Great job on the "GPS assisted smoke" btw! I am a fan!

Cheers

Erwan "Airone", JetESons Team Member

AlphaJet Lover

Link to comment
Share on other sites

Glad to help bud. :)

i7 7700K | 32GB RAM | GTX 1080Ti | Rift CV1 | TM Warthog | Win 10

 

"There will always be people with a false sense of entitlement.

You can want it, you can ask for it, but you don't automatically deserve it. "

Link to comment
Share on other sites

  • 2 weeks later...

I have a problem with what seems like the pilot keep suddenly passing out even though I'm not pulling heavy G's. The screen in the cockpit turns black (not the external view) and the controls stop responding. Any hint to why this happens or can I turn it off?

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

  • 1 month later...

Ok, people of the future, I am going to go ahead and answer my own questions before I ask a new one. The moment of inertia thing is actually (as probably everyone else but me guessed) the amount of force needed to rotate the object (rotational mass) in all three dimensions. Also, you now extend the landinggear by setting the correct parameter in the getparam - function in the new wCustomHumansPhysics.h in the DCS World\API\include folder.

 

Now the new question: getting key presses through listening in the lua-devices doesn't work in 1.2.7 but did in 1.2.6. How do I get key presses now?

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

  • 1 month later...

OK, Trying to script a HUD based off the wunderluft package.

 

I want at least airspeed, alt, and the Pitch/Roll Ladder.

 

No matter what I code this is what I get:

 

A green TGA with Missing texture and a large readout that I assume is Mach.

 

Anyone?

 

attachment.php?attachmentid=94878&stc=1&d=1393549869

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

Skate definition parameter(HDG,speed etc) in test device.

 

and that add parameter HDG,speed for HUD in indication page...

 

You see TEST_PARAM in indication_page is the same way for speed.

 

This is one way......but is second way but i have problem with material for display on HUD.

Link to comment
Share on other sites

Skate definition parameter(HDG,speed etc) in test device.

 

and that add parameter HDG,speed for HUD in indication page...

 

You see TEST_PARAM in indication_page is the same way for speed.

 

This is one way......but is second way but i have problem with material for display on HUD.

 

OK, I got 2 Values to output via test: Indicated Airspeed and Heading:

 

Now problem is, Indicated Airspeed Displays as 270.87, but Airspeed in F2 shows as 529 Knots.

Heading Also does not match what's displayed on the HUD.

 

I'm Guessing the Output format in the Indication page needs adjusted?

 

local test_output           = CreateElement "ceStringPoly"
test_output.name            = create_guid_string()
test_output.material        = FONT_
test_output.init_pos        = {0,-1}
test_output.alignment       = "CenterCenter"
test_output.stringdefs      = {0.01,0.75 * 0.01, 0, 0}
test_output.formats         = {"%.2f","%s"} 
test_output.element_params  = {"TEST_PARAM"}
test_output.controllers     = {{"text_using_parameter",0,0}} --first index is for element_params (starting with 0) , second for formats ( starting with 0)
test_output.additive_alpha  = true
test_output.collimated     = true
AddElement(test_output)

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

Gonna call it a afternoon,

 

I got 3 readings to display (SPEED, ALT, HDG).

 

Though they dont exactly match whats in the F2 Info Bar, it's enough for me to navigate and land.

 

Now to go back to working on suspension and prolly brakes, as wheel brakes simply lock the tires, lol.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

Skate only what you need is function update for heading and speed.....

Here is my lua code for heading:

function update()

 

local azimuth = sensor_data.getHeading() * (180/math.pi)

 

if azimuth > 0.0 then

azimuth = 360 - azimuth

end

my_param:set(azimuth)

my_param2:set(sensor_data.getIndicationAirSpeed()*1.943)

Your speed on HUD is m/s convert to knots....see my parameter 2

Link to comment
Share on other sites

Right now I have:

	my_param:set(sensor_data.getTrueAirSpeed()*1.852)
my_param2:set(sensor_data.getMagneticHeading()*(180/math.pi))
my_param3:set(sensor_data.getRadarAltitude()*3.28084)

 

I'll look at it more tomorrow,

 

was gonna see if I can make heads and tails of the pitch ladder code.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

Great work, Skate. Nice to see, how your modell grows!

 

 

Has anyone tips, how to make a new map (links, tutorials, readings etc.)?

 

 

Thanks,

Fire

Hardware: Intel i5 4670K | Zalman NPS9900MAX | GeIL 16GB @1333MHz | Asrock Z97 Pro4 | Sapphire Radeon R9 380X Nitro | Samsung SSDs 840 series 120GB & 250 GB | Samsung HD204UI 2TB | be quiet! Pure Power 530W | Aerocool RS-9 Devil Red | Samsung SyncMaster SA350 24" + ASUS VE198S 19" | Saitek X52 | TrackIR 5 | Thrustmaster MFD Cougar | Speedlink Darksky LED | Razor Diamondback | Razor X-Mat Control | SoundBlaster Tactic 3D Rage ### Software: Windows 10 Pro 64Bit

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...