Jump to content

DCS Mods structure : How to create your plugin from scratch


Recommended Posts

Still not working...

I copied font.lua and material.lua to my /Scripts, copied LeVince's files since you said they worked, but I still can't see that damn mach number! :(

 

Do I need to use a makeflyable() command in the entry.lua or the dofile() is enough ? What else is missing from the wunderluft example, else the font issue that you mentioned? I spent all week end on that thing, to make sure I didn't miss a thing, and still the addition of font and materials didn't change a thing...


Edited by archimaede
Link to comment
Share on other sites

il faut que tu créée ce dossier:

 

C:\Program Files\Eagle Dynamics\DCS World\Mods\aircraft\Wunderluft\resources\indicationtextures

 

dans lequel tu met le .tga qui correspond au FONT que tu a mis

 

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

 

Ici c'est "font_HUD" que tu trouvera en le cherchant dans les fichiers DCS (pas ceux du module). Et pense à virer le missing texture du HUD car c'est de la même couleur :thumbup:

Link to comment
Share on other sites

  • 3 weeks later...

Hi, back again with another question :

I animated my model, the animations work just fine in the model viewer, but they do not play in game...

 

Basically, it seems like the animations linked to a user input (press G for gear up, ctrl C for canopy, etc) do not work, while the automated animations (strut compressions, pilot head turning, etc) play just fine in game.

 

The weird part is that the "user input animations" still are in the right position on start up (gear down if I start on the ground, gear up if I start in the air). But if I press G, nothing happens...

 

What's the issue ? I thought it might be linked to the input.lua file, but I simply copied one from another mod that does work perfectly...

Link to comment
Share on other sites

My argument's numbers are fine, they are the same than the one from the core game (F-15, the L39, etc.) and the same than the ones from the mod.

 

Also, I forgot to add it, but the tail hook does work when I press the keys to it, meaning that I can see it get lowered or raised. It's the only user controled animation working so far, and I've got no idead as to why...

Link to comment
Share on other sites

  • 3 weeks later...

is the LAU-115C+LAU-127 Available to use in game?

 

Cant find any option for it?

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

NONE of my external Animations work (Control Surfaces etc)

 

If I remove cockpit and try to use a make_flyable line, DCS Crashes w/ DCS.exe Faulting.

(which I assume is because the old FC Cockpits are gone for the new ones)

 

So, Either I missed how to transfer cockpit input to external animations, or I'm setting up something wrong.

I have the same issue :) When loading my own pit, only the internal animations work, all the external ones are off...

 

What's your make_flyable ? It should look like this :

make_flyable('plane-name', current_mod_path..'/Cockpit/KneeboardLeft/',{nil, old = 54}, current_mod_path..'/comm.lua')

Make sure you're using the name of your plane (the one from name = 'plane-name', , and not your variable name (which should be something like plane_name ).

 

is the LAU-115C+LAU-127 Available to use in game?

Well you could either use the .edm model for the lau115+127, and create your own loadout, or directly use a CLSID with the lau115+127.


Edited by archimaede
Link to comment
Share on other sites

I have the same issue :) When loading my own pit, only the internal animations work, all the external ones are off...

 

What's your make_flyable ? It should look like this :

make_flyable('plane-name', current_mod_path..'/Cockpit/KneeboardLeft/',{nil, old = 54}, current_mod_path..'/comm.lua')

Make sure you're using the name of your plane (the one from name = 'plane-name', , and not your variable name (which should be something like plane_name ).

 

 

Well you could either use the .edm model for the lau115+127, and create your own loadout, or directly use a CLSID with the lau115+127.

 

I dont use the make flyable lines, as the module has it's own temp pit at the moment and some basic systems mapped.

 

Yeah, that's what Im trying to do, make a loadout declaration in the data LUA that uses the LAU-115+127 + 2 AIM 120s.

 

however the LAU115+127 has no entries defined as far as I can tell.

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

I dont use the make flyable lines, as the module has it's own temp pit at the moment and some basic systems mapped.

What do you use then instead of the make_flyable ? I'm interested cause it might be a solution to my own problem :)

 

As for the LAU, try that :

 

declare_loadout({	--
category		=	CAT_AIR_TO_AIR,
CLSID			= 	"{LAU_115_2_AIM120}",
Picture			=	"aim120c.png",
wsTypeOfWeapon	=	{wsType_Weapon,wsType_Missile,wsType_AA_Missile,	24},
displayName		=	_("2*AIM-120C"),
attribute		=	{4,	4,	32,	24},
Cx_pil			=	0.001959765625,
Count			=	2,
Weight			=	370,
Elements	=	
{
	{	ShapeName	=	"LAU-115C+2_LAU127",	IsAdapter   =   true		   }, 
	{	ShapeName	=	"AIM-120C" ,	Position	=	{0.4,   -0.15,   0.25}},
	{	ShapeName	=	"AIM-120C" ,	Position	=	{0.4,   -0.15,   -0.25}},
}, -- end of Elements
})

 

You'll just have to ajust the missiles position (and maybe Cx and weight), since I wrote that quickly, but it seems to work.

Also with that code you don't have to modify the data.lua, you can directly put it in the aircraft.lua of your mod, which means you don't have to worry about modifying core files ;)


Edited by archimaede
Link to comment
Share on other sites

What do you use then instead of the make_flyable ? I'm interested cause it might be a solution to my own problem :)

 

As for the LAU, try that :

 

 

You'll just have to ajust the missiles position (and maybe Cx and weight), since I wrote that quickly, but it seems to work.

Also with that code you don't have to modify the data.lua, you can directly put it in the aircraft.lua of your mod, which means you don't have to worry about modifying core files ;)

 

I knew the part about placing into the Data.lua, I had some stuff already declared but it wasnt working correctly,

 

That's exactly what I was looking for, thanks a million, had most of it correct, but was missing a few characters.

 

I also have to declare a load out for AIM120B/C and the Single LAU for it for the outer under wing pylons.

 

As well as the rotation for the 127 rails. (hopefully by just adding the rotation{} will work.

 

might as well export the tanks and use the tank shape as well.

 

 

--edit 1: adding the rotation{} works


Edited by SkateZilla

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

Guess I gotta build an LAU-127, as I dont see one in the shapes folder.

 

Right now I'm declaring new settings for LAU-115C+AIM-7M, LAU-115C+LAU-127 For Dual AIM-120, etc etc.

 

Edit: Exported a LAU127 from another project I was doing..

 

So now new Declares so far for:

LAU127 (with Shape in SH's Shape Folder) + AIM-120C

LAU115C+LAU127 + 2* AIM120B/C

LAU115C + AIM-7M

 

Dual AIM-120 Rack is Tweaked, Need to finish adjusting points for AIM-7 and LAU127+AIM120B/C (Well AIM-120C, as the SH's dont use the -Bs)

 

Also Havent Added Connector for pylon itself yet.


Edited by SkateZilla

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

Looking nice :)

 

As for the Connector, how do you procede to add them ?

Do I have to add a dummy in 3dsmax, change its properties, rename it ? If so, to what ?

Do I have to link things to it ? etc etc

If you've already done it in one of your other mods, please let me know and help me out, I've found ways around it, but I'd rather do it the right way...


Edited by archimaede
Link to comment
Share on other sites

Looking nice :)

 

As for the Connector, how do you procede to add them ?

Do I have to add a dummy in 3dsmax, change its properties, rename it ? If so, to what ?

Do I have to link things to it ? etc etc

If you've already done it in one of your other mods, please let me know and help me out, I've found ways around it (as you can see on the screenshot), but I'd rather do it the right way...

 

 

Helper Points, Will post image in a minute.

 

(Image Uploaded, Basically, You place a Helper Point, and line it up with the pylon (position and rotation orientation.)

 

that way you dont have to worry about setting YZX coordinates etc in the LUA,

 

EACH Point should be Named "Pylon1, Pylon2" etc. the corresponding pylon number in the LUA will place Stores w/ the point number.

 

Code:

pylon(<Pylon Number> <Pylon Type> <Y,Z,X Coordinates if needed>

 

ie:

			pylon(1, 0, 0.0,0.0,0.0,  
			{use_full_connector_position = true,}, -- Left Wingtip Station (1)
			{
                               { CLSID = "{6CEB49FC-DED8-4DED-B053-E1F033FF72D3}"}, -- AIM-9M SIDEWINDER
                               { CLSID = "{9BFD8C90-F7AE-4e90-833B-BFD0CED0E536}"}, -- AIM-9P SIDEWINGER
			{ CLSID = "{5CE2FF2A-645A-4197-B48D-8720AC69394F}"}, -- AIM-9X SIDEWINGER
			{ CLSID = "{D3F65166-1AB8-490f-AF2F-2FB6E22568B3}"}, -- Blue Smoke
			{ CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E743}"}, -- Blue Smokewinder
			{ CLSID = "{D3F65166-1AB8-490f-AF2F-2FB6E22568B1}"}, -- Red Smoke
			{ CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E741}"}, -- Red Smokewinder
			}	
		),  --End Of Pylon


Edited by SkateZilla

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 have to define a custom loadout for fuel tank too, but I wanna make sure I got this right:

 

declare_loadout(
			{
--Got it			category		= CAT_FUEL_TANKS,
--Got it			CLSID			= "{PTB_120_F86F35}",
--Got it			attribute		=  {wsType_Air,wsType_Free_Fall,wsType_FuelTank,WSTYPE_PLACEHOLDER},
--Got it			Picture			= "PTB.png",
--Got it			displayName		= _("Fuel Tank 480 gallons"),
--Is lbs or kg?		Weight_Empty	= 50,
--same as above		Weight			= 50 +  3.028 * 120,
--Drag Coefficient	Cx_pil			= 0.001313754,
--Got it					shape_table_data = 
				{
						{
							name 	= "",
							file	= "";
							life	= 1;
							fire	= { 0, 1};
							username	= "";
							index	= WSTYPE_PLACEHOLDER;
						},
				},
				Elements	= 
					{
						{
							ShapeName	= "",
						}, 
					}, 
			}
)

 

 

Im Assuming it's KG, So...

1lb = .453592kg, So for 480 US GAL Drop Tank of JP-5 at 6.8 lbs per gallon

480x6.8 LBs = 3264 LBs x .453592 = 1480.524288 KG

 

EDIT: This Worked perfectly.

 

declare_loadout(
{
	category		= CAT_FUEL_TANKS,
	CLSID			= "{PTB_480_F18EFG}",
	attribute		=  {wsType_Air,wsType_Free_Fall,wsType_FuelTank,WSTYPE_PLACEHOLDER},
	Picture			= "PTB.png",
	displayName		= _("Fuel Tank 480 gallons"),
	Weight_Empty	= 50, --kg
	Weight			= 50 +  3.084 * 480, --kg
	Cx_pil			= 0.001313754,  
	shape_table_data = 
	{
		{
			name 	= "PTB_480_F18EFG",
			file	= "f-18-fuel-tank-480";
			life	= 1;
			fire	= { 0, 1};
			username	= "PTB_480_F18EFG";
			index	= WSTYPE_PLACEHOLDER;
		},
	},
	Elements	= 
	{
		{
			ShapeName	= "PTB_480_F18EFG",
		}, 
	}, 
}
)


Edited by SkateZilla

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

You were too quick for me to reply, but yes that was exactly it. Also they will act as fuel tanks with this code (whereas with a slightly different code, they seem to act like tanks but don't actually add fuel, they're just useless weights).

 

I'm trying to add my custom cockpit, but it only partially works.

 

In the aircraft.lua, I have :

HumanCockpit 		= true,
HumanCockpitPath    = current_mod_path..'/Cockpit/Scripts/',

 

In the entry.lua, I only have the dofile :

dofile(current_mod_path..'/aircraft.lua')

 

That's pretty much all I have to load my cockpit, and it works. However, I then lose all my external animations (flaps, gear, etc)... What did I miss ?


Edited by archimaede
Link to comment
Share on other sites

  • Recently Browsing   0 members

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