Jump to content

DCS Mods structure : How to create your plugin from scratch


Recommended Posts

Just for info

it was adding this bit of code to the DSHK.lua from my previous post that allowed it to work in CA.

 

--Chassis

GT.swing_on_run = false

 

GT.sensor = {};

set_recursive_metatable(GT.sensor, GT_t.SN_visual);

GT.sensor.height = 2.723;

GT.airWeaponDist

 

I can't wait to get home and play about with it!

 

EDIT:

After some testing it was actually this piece of code which makes it controllable in CA

 

__LN.customViewPoint = { "genericAAA", {-1.0, 0.3, 0 }, };


Edited by jib

Mods I use: KA-50 JTAC - Better Fire and Smoke - Unchain Rudder from trim KA50 - Sim FFB for G940 - Beczl Rocket Pods Updated!

Processor: Intel Q6600 @ 3.00GHz

GPU: GeForce MSI RTX 2060 6GB

RAM: Crucial 8GB DDR2

HDD: 1TBGB Crucial SSD

OS: Windows 10, 64-bit

Peripherals: Logitech G940 Hotas, TrackiR 5, Voice Activated commands , Sharkoon 5.1 headset. ,Touch Control for iPad, JoyToKey

Link to comment
Share on other sites

I have made a new package and fixed quite a few things.

attachment.php?attachmentid=78062&stc=1&d=1362517549

 

Fixed in this version:

 

Problem | (how I fixed it)

 

1) Gun_point not fixed to muzzle (Linked the helper point to the muzzle)

 

2) Model pitch turns in opposite direction (had to redo the Argument 1 keyframes so they where opposite)

 

3) Model is limited to 45 degrees rotation (changed the first value to 180

GT.WS[ws].angles_mech = {

{math.rad(180), math.rad(-180), math.rad(-12), math.rad(45)},

 

4) Make a Custom Sight (changed the Crosshair1.tga in Mods\tech\CombinedArms\Cockpit\Resources , Warning this changes the cross hair sight for all vehicles that use Crosshair1.tga)

 

5) I would love to model the recoil seen

 

5) Fixed holes in model (Created missing faces in 3dMax and flipped some others)

 

6) Changed ammo box angle (in .max model)

 

7) Corrected shinny textures (Changed reflection value to 0 in the material editor)

 

8) Smoothed jagged edges (changed smoothing groups in .max)

 

9) Cleared out some files and code not needed (Combined Arms .dlls)

 

10) gun firing at 90 degrees to barrel. ( I had to spin the .max model 90 Degrees)

 

 

Know Bugs: (Cause/Fix)

 

1) The first ammo clip is 500 rounds then the other magazines are 50 rounds (unknown)

 

2) The view distance to the model changes as you rotate the model if you set an offset view (unknown)

 

3) the sight is slightly off target in some parts of the rotation (unknown)

 

4) it is currently firing 14.5mm rounds when in reality it fires 12.7 mm rounds (unknown)

 

Uploaded Here.

 

Here is the unexported .max file if anyone wants to have a look.


Edited by jib

Mods I use: KA-50 JTAC - Better Fire and Smoke - Unchain Rudder from trim KA50 - Sim FFB for G940 - Beczl Rocket Pods Updated!

Processor: Intel Q6600 @ 3.00GHz

GPU: GeForce MSI RTX 2060 6GB

RAM: Crucial 8GB DDR2

HDD: 1TBGB Crucial SSD

OS: Windows 10, 64-bit

Peripherals: Logitech G940 Hotas, TrackiR 5, Voice Activated commands , Sharkoon 5.1 headset. ,Touch Control for iPad, JoyToKey

Link to comment
Share on other sites

I have managed to add the recoil I wanted.

 

 

It is a bit over the top with the motion atm, I will have to tone it down a bit.

 

It was really easy to do, I just added th recoil annimation to Argument 2 in 3d max and then added this code:

__LN.BR[1].recoilArgument = 2;

 

to my .DSHK file.

 

I still don't know why the view distance relative to the gun changes when it is rotated :(


Edited by jib

Mods I use: KA-50 JTAC - Better Fire and Smoke - Unchain Rudder from trim KA50 - Sim FFB for G940 - Beczl Rocket Pods Updated!

Processor: Intel Q6600 @ 3.00GHz

GPU: GeForce MSI RTX 2060 6GB

RAM: Crucial 8GB DDR2

HDD: 1TBGB Crucial SSD

OS: Windows 10, 64-bit

Peripherals: Logitech G940 Hotas, TrackiR 5, Voice Activated commands , Sharkoon 5.1 headset. ,Touch Control for iPad, JoyToKey

Link to comment
Share on other sites

Know Bugs: (Cause/Fix)

 

1) The first ammo clip is 500 rounds then the other magazines are 50 rounds (unknown)

 

2) The view distance to the model changes as you rotate the model if you set an offset view (unknown)

 

3) the sight is slightly off target in some parts of the rotation (unknown)

 

4) it is currently firing 14.5mm rounds when in reality it fires 12.7 mm rounds (unknown)

 

Take a look to my Project 183 2M-3M gun cannons:

 

---- Nose 2M+3M cannon

ws = GT_t.inc_ws();

GT.WS[ws] = {}

GT.WS[ws].center = 'Turret1'

GT.WS[ws].drawArgument1 = 13

GT.WS[ws].drawArgument2 = 14

GT.WS[ws].omegaY = math.rad(40)

GT.WS[ws].omegaZ = math.rad(70)

GT.WS[ws].angles = {

{math.rad(170), math.rad(-150), math.rad(-10), math.rad(85)},

};

GT.WS[ws].reference_angle_Y=math.rad(0);

GT.WS[ws].reference_angle_Z=math.rad(10);

 

 

__LN = add_launcher(GT.WS[ws], GT_t.LN_t.automatic_gun_25mm); --<= weapon definition, search them on:

--C:\Program Files\Eagle Dynamics\DCS World\Scripts\Database\scripts

--automaticgun.lua

--cannon.lua

__LN.BR = { {connector_name = 'GUN_POINT_1'},

{connector_name = 'GUN_POINT_2'}

};

__LN.PL[1].ammo_capacity = 130; --<=ammo ready to fire

__LN.PL[1].ammunition_reserve = 400

__LN.PL[1].reactionTime = 3;

__LN.PL[1].shot_delay = 0.5;

__LN.PL[1].fireAnimationArgument = 125;

__LN.PL[1].recoilArgument = 33;

__LN.PL[1].recoilTime = 0.2;

__LN = nil;

Link to comment
Share on other sites

Thanks Sliver_Dragon

 

If found the ammo type I was looking for:

attachment.php?attachmentid=78211&stc=1&d=1362833986

Thanks to you +1

Mods I use: KA-50 JTAC - Better Fire and Smoke - Unchain Rudder from trim KA50 - Sim FFB for G940 - Beczl Rocket Pods Updated!

Processor: Intel Q6600 @ 3.00GHz

GPU: GeForce MSI RTX 2060 6GB

RAM: Crucial 8GB DDR2

HDD: 1TBGB Crucial SSD

OS: Windows 10, 64-bit

Peripherals: Logitech G940 Hotas, TrackiR 5, Voice Activated commands , Sharkoon 5.1 headset. ,Touch Control for iPad, JoyToKey

Link to comment
Share on other sites

  • 2 weeks later...
Link to comment
Share on other sites

yeah, looks cool :thumbup: but next time please turn on "show control indicator" for the external view

id like to see stick movements - what you do while aircraft dances - if you do a demo

 

 

How would I turn that on?

 

I wanna record some stuff this weekend with it on, but never got around to asking how to turn it on :)

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

Hi,

 

Can you please Sevas tell the song Title of the video (FM work in project)? I like it a lot!

System specs below

Case - Antec Three Hundred

PSU - Corsair AX750watt

Board - MSI Z170A GAMING PRO

CPU - Intel i5 6600K 3900MHz

Cooler - CoolerMaster Hyper 212 Plus

Memory - Kingston HYPERX 16G DDR4 2400Mhz CL15

Graphics - MSI GEFORCE GTX 980 GAMING 4G

SSD - Samsung 950 PRO 256GB M.2 NVMe

Monitor - Philips 277E 27" 1920x1080 60Hz

OS - Windows 10 Home 64bit

Flight Controllers - Thrustmaster HOTAS WARTHOG, Saitek COMBAT RUDDER PEDALS, TrackIR 4, Track Clip Pro

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Right ctrl+enter

 

How'd I not know that.... oh well, learn something new everyday!

 

I actually have ALOT to do this weekend DCS Wise :).

 

Pretty soon we'll have to address how to get animations to work with 3rd party EDM Pits... lol..

 

Is that part of the cockpit.DLL or is that AFM related?

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

How would I turn that on?

 

I wanna record some stuff this weekend with it on, but never got around to asking how to turn it on :)

 

i was talking about external view :chair::hehe:

you need to edit:\DCS World\Mods\aircrafts\A-10C\Cockpit\Scripts\ControlsIndicator\ ControlsIndicator.lua

 

purposes = {render_purpose.SCREENSPACE_INSIDE_COCKPIT,render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,render_purpose.HUD_ONLY_VIEW}

 

kudos goes to hungarojet :worthy:

 

DXfNCSW.jpg

sign-pic4.jpg

Link to comment
Share on other sites

Read this thread... :music_whistling:

 

I have. Does getWOW_LeftMainLandingGear(), getWOW_NoseLandingGear() and getWOW_RightMainLandingGear() work now?

DCS AJS37 HACKERMAN

 

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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