Jump to content

Guns Block of data.lua for Module..


SkateZilla

Recommended Posts

So the Wunderluft has:

 

Guns = {gun_mount("ADEN", {

count = 1000,

muzzle_pos_connector = "Gun1",

muzzle_pos = {4.052, -0.381, -0.57},

elevation_initial = 2.000,

supply_position = {1, 0, 0},

effect_arg_number = 350,

}

)

},

 

 

ok, now how do I do it if I want 4 guns, and for some reason, the one that is placed fires from 0,0,0 in my Module instead of the coordinates above, and I have a POINT _ connector at those coordinates with matching name... So... What Am I Doing wrong.

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 have same problem Skate.....

 

Why R U not listening to me Sniper ? :D

I wrote to you few weeks earlier ^ that description is wrong !

Try this:

 

 

Guns = { gun_mount

("M_61",

{ count = 676 },

{ muzzle_pos_connector = "Gun_Point" }, -- need to be "aimed"

{ muzzle_pos = {9.0, -0.067, -0.665} },

{ supply_position = {5.8, 0.1, -0.58} }, -- ammo drum coord

{ elevation_initial = 3.0 } -- not possible if you use ("aimed") connector

{ effect_arg_number = 350 },

{ max_burst_length = 200 },

)

},


Edited by HungaroJET

Atop the midnight tarmac,

a metal beast awaits.

To be flown below the radar,

to bring the enemy his fate.

 

HAVE A BANDIT DAY !

 

[sIGPIC][/sIGPIC]

"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." - R. Buckminster Fuller (1895 - 1983), American Architect, Author, Designer, Inventor, and Futurist

Link to comment
Share on other sites

muzzle_pos_connector = "Gun1",

....ok, now how do I do it if I want 4 guns....

 

In default Wunderluft there is not "Gun1", but "GUN_POINT"

 

Open Wunderluft.edm in Modelviewer.

Select View>>Show>>Show connectors

Place your mouse on L-39 gun position, you`ll see connector named GUN_POINT.

 

4cannons.png

 

I`m not test it yet, but I supposed if you want four guns, then you have to create four connectors in your 3d model.

If you get succes, share it plz.


Edited by BR=55=Sevas
Link to comment
Share on other sites

@HungaroJet, Please, what do you mean by ..need to be "aimed" ?

 

You need to rotate connector to proper direction (in .EDM) ...that's all

Atop the midnight tarmac,

a metal beast awaits.

To be flown below the radar,

to bring the enemy his fate.

 

HAVE A BANDIT DAY !

 

[sIGPIC][/sIGPIC]

"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." - R. Buckminster Fuller (1895 - 1983), American Architect, Author, Designer, Inventor, and Futurist

Link to comment
Share on other sites

In default Wunderluft there is not "Gun1", but "GUN_POINT"

 

Open Wunderluft.edm in Modelviewer.

Select View>>Show>>Show connectors

Place your mouse on L-39 gun position, you`ll see connector named GUN_POINT.

 

4cannons.png

 

I`m not test it yet, but I supposed if you want four guns, then you have to create four connectors in your 3d model.

If you get succes, share it plz.

 

Im not using the Wunderluft EDM, Im Using the Wunderluft template.

 

as for For guns I was worried about the LUA Syntax, do i just Do four blocks or do I have to add a {1} {2} {3} {4} somewhere.

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

    Guns = {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT1",
           muzzle_pos = {2.588, -0.53, 0.0},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT2",
           muzzle_pos = {2.588, -0.53, 0.0},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT3",
           muzzle_pos = {2.588, -0.53, 0.0},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT4",
           muzzle_pos = {2.588, -0.53, 0.0},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },

Link to comment
Share on other sites

Beczl,

 

Is there another location where we need to declare how many guns there are? I used the following code (yours modified) and am only getting one gun firing. It seems to fire the amount of bullets correctly and the right burst...but only one gun.

 

Guns = {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "Gun001",
           muzzle_pos = {4.052, -0.381, -0.57},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "Gun002",
           muzzle_pos = {3.859, -0.381, -0.35},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "Gun003",
           muzzle_pos = {3.859, -0.381, 0.35},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "Gun004",
           muzzle_pos = {4.052, -0.381, 0.57},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },

Coder - Oculus Rift Guy - Court Jester

Link to comment
Share on other sites

STuuuuuuuuuupid Question,

 

but does the connector Name HAVE to be GUN_POINTx?

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 think i got it working too, the smoke seems to come from the right area, from the pit i can clearly see 4 separate lines of tracers.

 

from external view though the tracer line goes all the way back to the tail of my plane (must be a global draw effect)

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 followed the tutorial beczl, I added 4 GUN_POINT connector and add the following lines to the file lua template Wunderluft.

I only work a gun_point and also by varying the values ​​muzzle_pos = {1, -0.5, -1} does not move. :helpsmilie:

 

Guns = {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT1",
           muzzle_pos = {4.052, -0.381, -0.57},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT2",
           muzzle_pos = {3.859, -0.381, -0.35},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT3",
           muzzle_pos = {3.859, -0.381, 0.35},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT4",
           muzzle_pos = {4.052, -0.381, 0.57},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },
           {gun_mount("GSh_23_2", {
           count = 250,
           muzzle_pos_connector = "GUN_POINT5",
           muzzle_pos = {3.859, -0.381, 0.35},
           elevation_initial = 2.000,
           supply_position = {1.42, 0.50, -0.33},
           effect_arg_number = 350,
           max_burst_length = 25,
           drop_cartridge = cartridge_30mm,
                                 }
                    )
           },


Edited by farias76
Link to comment
Share on other sites

For the Record, I noticed something funky with my Module today, despite 4 cannons, only 1 line of tracers..

 

So, I Spaced them out 3 m, 2m, -2m, -3m from the center, and only the first cannon would load using Beczl's code...

 

digging around LUAs for AI Guns I fixed it by doing this:

 

	Guns =  {
gun_mount("M_39", {count = 250},{muzzle_pos = {2.588, -0.53, -3.0}},{elevation_initial = 2.000},{supply_position = {1.42, 0.50, -0.33}}),
gun_mount("M_39", {count = 250},{muzzle_pos = {2.588, -0.53, -2.0}},{elevation_initial = 2.000},{supply_position = {1.42, 0.50, -0.23}}),
gun_mount("M_39", {count = 250},{muzzle_pos = {2.588, -0.53, 2.0}},{elevation_initial = 2.000},{supply_position = {1.42, 0.50, 0.23}}),
gun_mount("M_39", {count = 250},{muzzle_pos = {2.588, -0.53, 3.0}},{elevation_initial = 2.000},{supply_position = {1.42, 0.50, 0.33}})
},[/Code]

 

As Long as it's forward facing cannon, you wont need connectors.. I spaced the coordinates out so I could see the separate Trails and confirm all 4 cannons are firing from correct positions entered into the mount info.

 

Screenshot Attached.

Screen_121104_013849.thumb.jpg.7c170a4c2bee9a6d31d5f3fab8ecb5bb.jpg

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

 

digging around LUAs for AI Guns I fixed it by doing this:

 

 

hehe, yeah :hehe:

 

http://forum.lockon.ru/showpost.php?p=1588605&postcount=3

Atop the midnight tarmac,

a metal beast awaits.

To be flown below the radar,

to bring the enemy his fate.

 

HAVE A BANDIT DAY !

 

[sIGPIC][/sIGPIC]

"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." - R. Buckminster Fuller (1895 - 1983), American Architect, Author, Designer, Inventor, and Futurist

Link to comment
Share on other sites

 

 

I tried yours and it seemed to not wanna work (But I prolly forgot to clean up one of the open/close brackets, when i pasted it,, So I may have overlooked trying your code again.).

 

Beczl's block worked, but he had open/close brackets at the beginning/end of each gun mount which causes my module to only load the first gun.

 

My making it Guns = { gun1({data1},{data2}), gun2({data1},{data2}), gun3({data1},{data2}), gun4({data1},{data2}) } all mounts are loaded and works

 

 

which i got that syntax from the AI Guns Data blocks, then it was just a matter of formatting out the un-needed/incorrect stuff that was causing problems.

 

 

Ie:

 

aircraft_guns("P_51B",

--left wing

gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001,-0.306}}), --outboard

gun_mount("M_2", { count = 270 },{muzzle_pos = {-0.028, -0.447, -2.032}}), --inboard

--right wing

gun_mount("M_2", { count = 270 },{muzzle_pos = {-0.028, -0.447, 2.032}}), --inboard

gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001, 0.306}}) --outboard

);

 

We dont need the Aircraft Call for "P_51B"

 

So:

 

guns =(

--left wing

gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001,-0.306}}), --outboard

gun_mount("M_2", { count = 270 },{muzzle_pos = {-0.028, -0.447, -2.032}}), --inboard

--right wing

gun_mount("M_2", { count = 270 },{muzzle_pos = {-0.028, -0.447, 2.032}}), --inboard

gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001, 0.306}}) --outboard

);

 

didnt work, caused a Crash as soon as you fired cannons.

 

 

So I Tried One Cannon and replaced () with {} and removed the data block separator ";"

 

guns ={gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001,-0.306}})}

 

 

That worked.

 

So I copied the line to make a second Cannon, and made it on the opposite side So:

guns ={gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001,-0.306}})}

{gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001, 0.306}})}

 

That didnt work, it only loaded the first cannon, then i realized, the first open bracket was for the guns block, and that closing after the first cannon would end the guns block, and the rest of the mounts would be ignored.

 

So, I reformatted the Syntax and moved the open/close brackets to their own line so they wouldn't be accidentally added to the gun_mounts, which led me to this:

 

guns ={

gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001,-0.306}})

gun_mount("M_2", { count = 270 },{muzzle_pos = {5.421, 0.001, 0.306}})

}

 

This worked, from there it's just a matter of correctly adding new mount lines and data for your modules guns.


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

  • Recently Browsing   0 members

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