Jump to content

weapons questions


Recommended Posts

  • 3 years later...

Sorry to "resurrect" that post. I have a "little" problem add weapons to DCS: W, and intent search a answer to a problem.

 

That is a weapon definition:

 

torpedo_53_65k = {

category = CAT_MISSILES,

name = "torpedo_53_65k",

user_name = _("torpedo_53_65k"),

model = "torpedo_53_65k",

wsTypeOfWeapon = {wsType_Weapon,wsType_Missile,wsType_AS_Missile,WSTYPE_PLACEHOLDER},

Escort = 1,

Head_Type = 2,

sigma = {15, 15, 15},

M = 4800.0,

H_max = 12000.0,

H_min = 500,

Diam = 533.0,

Cx_pil = 2.0,

D_max = 500000.0,

D_min = 3000.0,

Head_Form = 1,

Life_Time = 1800.0,

Nr_max = 0.5,

v_min = 170.0,

v_mid = 986.0,

Mach_max = 2.5,

t_b = 0.0,

t_acc = 6.0,

t_marsh = 1800.0,

Range_max = 500000.0,

H_min_t = 0.0,

Fi_start = 3.14152,

Fi_rak = 3.14152,

Fi_excort = 3.14152,

Fi_search = 99.9,

OmViz_max = 99.9,

warhead = {

mass = 2573;

expl_mass = 513;

other_factors = {1, 1, 1};

obj_factors = {1, 1};

concrete_factors = {1, 1, 1};

cumulative_factor = 3.0;

concrete_obj_factor = 0.0;

cumulative_thickness = 0.9;

piercing_mass = 0.0;

caliber = 150,

},

Damage = 50,

exhaust = {0.9, 0.9, 0.85, 0.3}, -- Tail smoke color format {R, G, B, alpha}. All values from 0 to 1

exhaust1 = tail_solid,

X_back = -5.814,

Y_back = 0.099,

Z_back = 0.0,

Reflection = 0.75,

KillDistance = 0.0,

shape_table_data =

{

{

name = "torpedo_53_65k",

file = "torpedo_53_65k",

life = 1,

fire = { 0, 1},

username = "torpedo_53_65k",

index = 361,

},

}

}

declare_weapon(torpedo_53_65k)

 

declare_loadout(

{

category = CAT_MISSILES,

CLSID = "{torpedo_53_65k}",

--Picture = "torpedo_53_65k.png",

displayName =_("torpedo_53_65k"),

angles = {

{math.rad(45), math.rad(-45), math.rad(-10), math.rad(45)},

};

reference_angle_Z = math.rad(60),

moveable = false,

attribute = torpedo_53_65k.wsTypeOfWeapon,

Cx_pil = torpedo_53_65k.Cx_pil,

Count = 1,

Weight = 310,

Elements =

{

ShapeName = "torpedo_53_65k",

Position = {0,0,0},

}, -- end of Elements

}

}

)

 

The main problem coming here:

 

...

--[[ ]]

GT_t.WS_t.ship_torpedo_53_65k = {}

GT_t.WS_t.ship_torpedo_53_65k.angles = {

{math.rad(45), math.rad(-45), math.rad(-90), math.rad(90)},

};

GT_t.WS_t.ship_torpedo_53_65k.reference_angle_Z = math.rad(60)

GT_t.WS_t.ship_torpedo_53_65k.moveable = false

GT_t.WS_t.ship_torpedo_53_65k.LN = {}

GT_t.WS_t.ship_torpedo_53_65k.LN[1] = {}

GT_t.WS_t.ship_torpedo_53_65k.LN[1].type = 1

GT_t.WS_t.ship_torpedo_53_65k.LN[1].distanceMin = 13000

GT_t.WS_t.ship_torpedo_53_65k.LN[1].distanceMax = 555000

GT_t.WS_t.ship_torpedo_53_65k.LN[1].reactionTime = 1

GT_t.WS_t.ship_torpedo_53_65k.LN[1].launch_delay = 2;

GT_t.WS_t.ship_torpedo_53_65k.LN[1].external_tracking_awacs = true;

GT_t.WS_t.ship_torpedo_53_65k.LN[1].sensor = {}

set_recursive_metatable(GT_t.WS_t.ship_torpedo_53_65k.LN[1].sensor, GT_t.WSN_t[0])

GT_t.WS_t.ship_torpedo_53_65k.LN[1].PL = {}

GT_t.WS_t.ship_torpedo_53_65k.LN[1].PL[1] = {}

GT_t.WS_t.ship_torpedo_53_65k.LN[1].PL[1].ammo_capacity = 4

GT_t.WS_t.ship_torpedo_53_65k.LN[1].PL[1].type_ammunition = {4,4,11,122}

GT_t.WS_t.ship_torpedo_53_65k.LN[1].PL[1].name_ammunition = "torpedo_53_65k"

GT_t.WS_t.ship_torpedo_53_65k.LN[1].PL[1].reload_time = 1000000; -- never during the mission

GT_t.WS_t.ship_torpedo_53_65k.LN[1].BR = { {pos = {0, 0, 0} } }

 

--Torpedo Tubes

-- 1 --

ws = GT_t.inc_ws();

GT.WS[ws] = {}

set_recursive_metatable(GT.WS[ws], GT_t.WS_t.ship_torpedo_53_65k);

GT.WS[ws].animation_alarm_state = {time = 1.5, arg = 20}

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

GT.WS[ws].LN[1].show_external_missile = true

GT.WS[ws].LN[1].PL[1].ammo_capacity = 3;

GT.WS[ws].LN[1].PL[1].reload_time = 5;

GT.WS[ws].LN[1].BR[1].connector_name = 'Tube01'

...

 

The number in RED has appoint to the Weapons.lua

 

How I can add a new index weapon to DCS: W without modification the weapons luas or make conflict with other index weapon?

 

If use that index. other weapons appears, not the definite weapon on the previous luas, with the propel 3D model.


Edited by Silver_Dragon
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

I was editing the existing files (MissileTable.sht, db_weapons_data.lua, etc), to add a new AS missile.

However, I do not need to modify the existing file any longer.

Because you presented the code.

Thank you, Silver_Dragon.

 

Sorry my bad English.

Link to comment
Share on other sites

  • 1 month later...

Ok, I resurrect that post.

 

I modify my scripts. Now I add the weapons designation to the weapons.lua, and add them to init.lua to use them, but the main problem show on my previous post persist. I cant add new weapons to DCS: W, only can search and replace not used index weapons to make them some "usable" (122 index point to a "old" P-15 missile disapear on DCS:W).

 

Attach my mods to that post, if someone like check my LUAs. That have a working Pr.205 (show on some my youtube videos), and a Pr.877 with implement weapons but crash with start a mission with them. Put into the Mod/tech directory to enable on the mission editor. All models has not textured, I dont have the necesary experiece to make them :(

Project205.rar

Project877.rar

Link to comment
Share on other sites

  • Recently Browsing   0 members

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