Jump to content

DCS Mods structure : How to create your plugin from scratch


Recommended Posts

Yes it seems at present time, just having personal mods in the mods folder without all players having the same content will result in an application error.

 

That's only on the server though right?

Or does it still not work if you have additional mods installed on the client?

Link to comment
Share on other sites

Dimebag, check my 2 posts also. http://forums.eagle.ru/showthread.php?t=90599&page=2#16

There is in russian, but screenshots in english :D

In post #17 download working Wunderluft-example with clickable 2-position switch - link

 

Ells thx for detailed help! Some new info inbound, great!

Link to comment
Share on other sites

Adding Ground Unit

 

Hi!

 

When trying to add a "pilotable" ground unit in the Mods/tech folder (as here) an error occured and the game crash at 72% when loading.

 

The mod seems to be well installed since I get the following line in my me.log :

MOD ADDED VEHICLE:	Strela

 

The errors are :

 

00007.315 UNKNOWN main: GUI Error: [string ".\MissionEditor\modules\me_vehicle.lua"]:105: table index is nil
GUI debug.traceback: stack traceback:
[C]: ?
[string ".\MissionEditor\modules\me_vehicle.lua"]:105: in function 'create'
[string ".\MissionEditor\MissionEditor.lua"]:632: in function 'loading'
[string ".\MissionEditor\MissionEditor.lua"]:1048: in main chunk
stack traceback:
[C]: ?
[string ".
00007.315 ALERT   LUACOMMON: Error: GUI Error: [string ".\MissionEditor\modules\me_vehicle.lua"]:105: table index is nil
GUI debug.traceback: stack traceback:
[C]: ?
[string ".\MissionEditor\modules\me_vehicle.lua"]:105: in function 'create'
[string ".\MissionEditor\MissionEditor.lua"]:632: in function 'loading'
[string ".\MissionEditor\MissionEditor.lua"]:1048: in main chunk
00007.320 INFO    SOUND: detaching sdef path ".\sounds\"

 

I tried to add the unit in the db_countrie.lua, game still crashed.

 

This situation does not occur when adding a new plane.

 

 

 

********

 

Faulting line has been identified, the error occurs when using parameters from the line "attribute".

 

Code involved :

 

	shape_table_data 	= 
{
	{
		index    =  WSTYPE_PLACEHOLDER;
	},
},

 

	mapclasskey 		= "P0091000025",
attribute  			= {wsType_Ground,wsType_SAM,wsType_Miss,WSTYPE_PLACEHOLDER,"SAM",},
Categories 			= {"{B84C5FC5-9893-45e4-A712-E3D4D201A003}","SAM",},,

 

 

Any tips?


Edited by Haddock
Link to comment
Share on other sites

Just off the top of my head, it looks like a problem with the shape file - i.e. that the mod refers to a 3d model that doesn't exist.

 

If you configure script files to employ a shape file that either isn't listed in any of the shape table files or isn't physically present in the shapes folder, the game will crash at start-up(when trying to load the specified file).


Edited by Alfa

JJ

Link to comment
Share on other sites

Tanks for the help!

 

The shape called by the script exists and is located in the right folder.

 

If I change my attribute line by the one use in the Wunderluft mod (it makes no sense but it is just a test:book:), crash disappear and my vehicule is added as a fortification.

 

The problem seems to come from the Categories according to the log but the line attribute is also involved. Or problem could also come from the value of index...

 

I don't get it...


Edited by Haddock
Link to comment
Share on other sites

Ok it was just a guess based on the shape thing mentioned in your error log - I don't have DCS world myself, so I don't really have a chance help you trace down the problem :) .

 

Judging from the code bits you posted, the "categories" CLSID should be correct for SAMs, but I wonder about the "mapclasskey" in your example.

 

In FC2 the Strela-10(if thats the unit you are messing with) has mapclasskey: P0091000086

JJ

Link to comment
Share on other sites

No probs mate. Post up any problems you're having or if you get it working :D

 

Well I have been attempting to get my gear lever to be clickable with not much success. I can get modelviewer to recognise the dummy helper associated with the lever, however I think my problem is I don't really know how to code for a simple two state gear lever. The other problem is that the gear lever is already animated before it is even clickable, which has thrown me off.

 

Here is what I have code wise for clickabledata.lua:

 

elements["GEAR LEVER"] = FCS_Tumb("Gear Control", devices.AVIONICS, device_commands.Button_19, device_commands.Button_20,8) -- 8 arg number

 

Argument 8 is the argument which actually controls the gear in game, and also moves the gear lever in the cockpit. I wasn't sure how to code this as there is only really one gear command, rather than two for up and down.

 

Here is the code for devices.lua

creators[devices.AVIONICS] = {"avLuaDevice" ,LockOn_Options.script_path.."Avionics/avionics.lua"}

 

Here is the code for avionics.lua:

local GearLever = 8

local GearLeverdown = 3019

local GearLeverup = 3020

function SetCommand(command,value)

if command == 3019 then

dispatch_action(nil,GearLever)

end

elseif command == 3020 then

dispatch_action(nil,GearLever)

end

end

 

I have no doubt my code is wrong, and I am going about it the wrong way, please excuse my complete ignorance in these matters. :doh:Any advice or help you can give is much appreciated. Also thanks to Sevas for the info.

[sIGPIC][/sIGPIC]

Find us at http://virtual-roulettes.forumotion.com/

Link to comment
Share on other sites

Then definitely problem in code.

 

For clickabledata.lua try this string, works for my switch...

elements["GEAR_LEVER"] = { class = {class_type.LEV}, hint = "GEAR", device = devices.AVIONICS, action = {device_commands.Button_1}, arg = {8}, arg_value = {0.05}, arg_lim = {{0.0, 1.0}} }

 

Also check errors in log files.

Link to comment
Share on other sites

  • 2 weeks later...

Hello Alex, is there some ed_fm_template sample that could work with a chopper ?

At the moment I compiled a dll from the ed_fm_template and it's ok with the wunderluft plane, but no go with the sa342 gazelle I'm working on.

Some tips to start with would be great too if no chance of template.

 

Thanks.

Link to comment
Share on other sites

what we need is a GUI Program that you enter values into and it automatically makes a LUA for you. lol...

 

And I thought Thirdwire's Data INIs were complex.

 

 

 

dumb question,

 

what's the format for the Coordinates? X,Y,Z,??


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

Program that you enter values into and it automatically makes a LUA for you.

I know you were joking, but that won't happen. This capability to create content for the simulator is designed for advanced users and frankly for people with professional skills. That's clearly the intent. Sorry, I just feel like that needs to be reiterated now and then. ;)

 

Coordinates:

Usually X,Z,Y; where X is the longitudinal axis, and Z is the vertical axis.

 

Please consolidate your posts when you can to help keep this thread well-organized! (Edit function)

Link to comment
Share on other sites

i was gonna go back and edit them all together,.

 

i just wasnt sure of the Coordinates, they looked "off"...

and the fact that some items had 5 values.

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 was gonna go back and edit them all together,.

 

i just wasnt sure of the Coordinates, they looked "off"...

and the fact that some items had 5 values.

 

OK, no worries just a friendly reminder. Not sure what you mean by "5 values." What file are you looking at?

Link to comment
Share on other sites

OK, no worries just a friendly reminder. Not sure what you mean by "5 values." What file are you looking at?

 

Must have been more tired than I thought after 6 hours of scripting last night,

 

I know there's 5 Values for the Pylons. Second Value is always "0" but i dont know yet what it's for, this ois prolly the only spot i saw 5 Values.

 

pylon( Pylon ID, Unknown , X Coor, Z Coor, Y Coor )

 

 

The regular 3 Value for other items confused me at first because I was used to XX.XXXX, YY.YYYY, ZZ.ZZZZ from thirdwire's engine. and there's alot of stuff in the Data Blocks that are just simple -1, 0, 1 etc etc.

 

Im still in my office, so, this helps for tonite.

 

Diggin through LUAs for stuff is fun.

 

:joystick:

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

thirdwire's engine

 

That explains your confusion. :D There will not be much transfer... adding aircraft to that platform is very simple and generally designed to be done simply and with little room for expansion. Not so for ED's sims! Remember that coordinate systems are used differently in Eastern countries.

 

pylon( Pylon ID, Unknown , X Coor, Z Coor, Y Coor )

 

AFAIK, the second value refers to the wing fold argument. 1 for a "folding" pylon, 0 for fixed. I have not yet used that, however, so I couldn't tell you how it works.

Link to comment
Share on other sites

thirdwire's engine

 

That explains your confusion. :D There will not be much transfer... adding aircraft to that platform is very simple and generally designed to be done simply and with little room for expansion. Not so for ED's sims! Remember that coordinate systems are used differently in Eastern countries.

 

 

 

AFAIK, the second value refers to the wing fold argument. 1 for a "folding" pylon, 0 for fixed. I have not yet used that, however, so I couldn't tell you how it works.

 

Thanks, that will help with some stuff.

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

ok, annoying..

 

Another 7 hours of work,

 

Save everything, Copy to DCSWorld/Mods folder.

 

Boot DCSW.

 

Module Shows on the Mainscreen, but isnt availible for selection for a Mission or in the Mission Editor.... Doh... Hand to head...

 

ok renamed everything back to wunderluft and it works again, so I changed a name somewhere and it didnt like it..

 

MOdel in Game, 90% of the Animations, SFM for AI... Now to figure out how to get the lights mounted.....


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

i didnt use any "-"s

 

name was simply Test

 

 

changed mod folder name to /Test/

 

changed everything else to "Test" in the LUAs, it shows on the menu, but not in the list to fly or add to a mission, change everything back to wunderluft and it shows up, so Im looking at a naming conflict somewhere.

 

Now I'm working on finishing animations so I can start working with connectors for Lights/Guns/Whatever

 

Anyone Got a Guide for that?

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

  • Recently Browsing   0 members

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