Jump to content

Recommended Posts

Posted (edited)

I'm trying to make a custom surface-to-surface missile right now.

So, I renamed and pasted the Scudlauncher.lua file under the DCS world folder into the Saved games folder.

I prepared all shapes and textures, but they are not visible in the game.

how do i solve it?

this is my code

 
GT = {};
GT_t.ws = 0;
set_recursive_metatable(GT, GT_t.generic_wheel_vehicle);
set_recursive_metatable(GT.chassis, GT_t.CH_t.MAZ543M);
 
GT.visual.shape = "HY4";
GT.visual.shape_dstr = "HY4_D";
 
GT.toggle_alarm_state_interval = 3.0;-- AMENDED THIS BUILD
GT.animation_arguments.alarm_state = 4;
 
local missileLaunched = {30, 1.0}; -- when the missile is present the 30th argument value is 0.0
 
-- times
local legsFinishTime = 10;-- AMENDED THIS BUILD
local mainArmStartTime = legsFinishTime+3;
local mainArmFinishTime = mainArmStartTime + 90;-- AMENDED THIS BUILD
local rocketLockInterval = 20;
local rocketUnlockStartTime = mainArmFinishTime+3;
local rocketUnlockFinishTime = rocketUnlockStartTime + rocketLockInterval;
local mainArmDownStartTime = rocketUnlockFinishTime + 1;
local mainArmDownFinishTime = mainArmDownStartTime + 90;-- AMENDED THIS BUILD
local totalDuration = mainArmDownFinishTime;
 
GT.animation_arguments.alarm_state_sequence =
{
    totalDuration = mainArmDownFinishTime,
    -- support legs
    {2, {{startTime=0.0, endTime = legsFinishTime},
        {startTime=legsFinishTime, endTime = totalDuration, startVal = 1.0, endVal = 1.0}}},
    -- rocket pad
    {4, {
        {startTime=0.0, endTime = mainArmStartTime, startVal = 0.0, endVal = 0.0},
        {startTime=mainArmStartTime, endTime = mainArmFinishTime, startVal = 0.0, endVal = 1.0},
        {startTime=mainArmFinishTime, endTime = totalDuration, startVal = 1.0, endVal = 1.0}
    }},
    -- main arm
    {5, {
        {startTime=0.0, endTime = mainArmStartTime, startVal = 0.0, endVal=0.0},
        {startTime=mainArmStartTime, endTime = mainArmFinishTime, conditions={missileLaunched}},
        {startTime=mainArmFinishTime, endTime = rocketUnlockFinishTime, startVal = 1.0, endVal=1.0, conditions={missileLaunched}},
        {startTime=mainArmDownStartTime, endTime = mainArmDownFinishTime, startVal = 1.0, endVal=0.0, conditions={missileLaunched}}
    }},
    -- rocket locking arms
    {6, {
        {startTime=0.0, endTime = rocketUnlockStartTime, startVal = 0.0, endVal=0.0},
        {startTime=rocketUnlockStartTime, endTime = rocketUnlockFinishTime, conditions={missileLaunched}},
        {startTime=rocketUnlockFinishTime, endTime = mainArmDownFinishTime-rocketLockInterval, startVal = 1.0, endVal=1.0, conditions={missileLaunched}},
        {startTime=mainArmDownFinishTime-rocketLockInterval, endTime = mainArmDownFinishTime, startVal = 1.0, endVal=0.0, conditions={missileLaunched}}
    }},
}
 
-- Turbine
GT.turbine = false;
-- Turbine
 
-- Sound
GT.sound = {};
 
-- Engine params
GT.sound.engine = {};
GT.sound.engine.idle = "GndTech/BradleyEngineIdle";
GT.sound.engine.max = "GndTech/BradleyEngineMax";
 
GT.sound.engine.acc_start = "GndTech/BradleyEngineAccStart";
GT.sound.engine.acc_end = "GndTech/BradleyEngineAccEnd";
 
GT.sound.engine.idle_formula_gain = "0.625 x * 0.875 +";
GT.sound.engine.idle_formula_pitch = "0.55 x * 0.89 +";
 
GT.sound.engine.max_formula_gain = "0.75 x * 0.25 +";
GT.sound.engine.max_formula_pitch = "0.7025 x * 0.4195 +";
-- Engine params
 
-- Move params
GT.sound.move = {};
GT.sound.move.sound = "GndTech/TankMove";
GT.sound.move.pitch = {{0.0, 0.6}, {10.0, 1.2}};
GT.sound.move.gain = {{0.0, 0.01}, {0.5, 0.5}, {12.0, 1.0}};
GT.sound.move.start_move = "GndTech/TStartMove";
GT.sound.move.end_move = "GndTech/TEndMove";
-- Move params
 
GT.sound.noise = {};
GT.sound.noise.sound = "Damage/VehHit";
 
-- Sound
 
-- chassis
GT.swing_on_run = false;
 
GT.sensor = {};
set_recursive_metatable(GT.sensor, GT_t.SN_visual);
GT.sensor.height = 2.617;
 
--Burning after hit
GT.visual.fire_size = 0.8; --relative burning size
GT.visual.fire_pos[1] = 1.575; -- center of burn at long axis shift(meters)
GT.visual.fire_pos[2] = 0; -- center of burn shift at vertical shift(meters)
GT.visual.fire_pos[3] = 0; -- center of burn at transverse axis shift(meters)
GT.visual.fire_time = 1000; --burning time (seconds)
 
local HY4m = {
    category = CAT_MISSILES,
    name = "HY4m",
    wsTypeOfWeapon  = {wsType_Weapon,wsType_Missile,wsType_SS_Missile,WSTYPE_PLACEHOLDER};
    Escort = 0,
    Head_Type = 5,
    sigma = {10, 10, 10},-- AMENDED THIS BUILD
    M = 2000.0,-- AMENDED THIS BUILD
    H_max = 230000.0,-- AMENDED THIS BUILD
    H_min = -1,
    Diam = 880.0,-- AMENDED THIS BUILD
    Cx_pil = 1,
    D_max = 595470.0,-- AMENDED THIS BUILD
    D_min = 12000.0,-- AMENDED THIS BUILD
    Head_Form = 1,
    Life_Time = 9200.0,-- AMENDED THIS BUILD
    Nr_max = 6.0,-- AMENDED THIS BUILD
    v_min = 370.0,-- AMENDED THIS BUILD
    v_mid = 1900.0,-- AMENDED THIS BUILD
    Mach_max = 5.00,-- AMENDED THIS BUILD
    t_b = 0.0,
    t_acc = 9.0,-- AMENDED THIS BUILD
    t_marsh = 172.0,-- AMENDED THIS BUILD
    Range_max = 595470.0,-- AMENDED THIS BUILD
    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                    = 985;-- AMENDED THIS BUILD
        expl_mass               = 975;-- AMENDED THIS BUILD
        other_factors           = {1, 1, 1};
        obj_factors             = {1, 1};
        concrete_factors        = {1, 1, 1};
        cumulative_factor       = 0;
        concrete_obj_factor     = 0.5;
        cumulative_thickness    = 0.6;
        piercing_mass           = 987.0;
        caliber                 = 880,
    },
    exhaust = {1,1,1,1},
    X_back = -5.5,
    Y_back = 0.0,
    Z_back = 0.0,
    Reflection = 0.3967,
    KillDistance = 0.0,
    shape_table_data =
    {
        {
            name     = "HY4m";
            file     = "HY4m";
            life     = 1;
            fire     = { 0, 1};
            username = "HY4m";
            index = WSTYPE_PLACEHOLDER;
        },
    }
};
declare_weapon(HY4m)
-- weapon systems
GT.WS = {};
GT.WS.fire_on_march = false;
GT.WS.maxTargetDetectionRange = 595470.0;-- AMENDED THIS BUILD
 
local ws = GT_t.inc_ws();
GT.WS[ws] = {};
GT.WS[ws].pos = {-6.0, 1.0, 0.0}
GT.WS[ws].angles = {
                    {math.rad(180), math.rad(-180), math.rad(-90), math.rad(90)},
                    };
GT.WS[ws].reference_angle_Z = math.rad(90)
GT.WS[ws].moveable = false
GT.WS[ws].LN = {}
GT.WS[ws].LN[1] = {}
GT.WS[ws].LN[1].type = 8
GT.WS[ws].LN[1].distanceMin = 12000-- AMENDED THIS BUILD
GT.WS[ws].LN[1].distanceMax = 595470-- AMENDED THIS BUILD
GT.WS[ws].LN[1].reactionTime = 3-- AMENDED THIS BUILD
GT.WS[ws].LN[1].show_external_missile = true
GT.WS[ws].LN[1].external_tracking_awacs = true
GT.WS[ws].LN[1].sensor = {}
set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[0])
GT.WS[ws].LN[1].PL = {}
GT.WS[ws].LN[1].PL[1] = {}
GT.WS[ws].LN[1].PL[1].ammo_capacity = 1
GT.WS[ws].LN[1].PL[1].type_ammunition = HY4m.wsTypeOfWeapon;
GT.WS[ws].LN[1].PL[1].name_ammunition = HY4m.shape_table_data.username
GT.WS[ws].LN[1].PL[1].reload_time = 1000000; -- never during the mission
GT.WS[ws].LN[1].PL[1].shot_delay = 3-- AMENDED THIS BUILD
GT.WS[ws].LN[1].max_number_of_missiles_channels = 1;
GT.WS[ws].LN[1].BR = {
    {connector_name = 'POINT_ROCKET', drawArgument = 30},
    }
 
GT.Name = "HY4";
GT.DisplayName = _("HY4");
GT.Rate = 20;
 
GT.DetectionRange  = 0;
GT.ThreatRangeMin = GT.WS[1].LN[1].distanceMin;
GT.ThreatRange = 595470.0;
GT.mapclasskey = "P0091000208";
GT.attribute = {wsType_Ground,wsType_Tank,wsType_Miss,wsType_GenericMLRS,
                "SS_missile", "Artillery", "Datalink",
                };
GT.category = "MissilesSS";
GT.Countries = {"Egypt", "Iran", "Kazakhstan", "North Korea", "Libya", "Oman", "Syria", "Vietnam", "Yemen", "Belarus", "Bulgaria", "Czech Republic", "Hungary", "Iraq", "Poland", "Romania", "Yemen", "Ukraine", "United Arab Emirates", "Yugoslavia", "USSR"}

 

This is my file

https://drive.google.com/file/d/19Ry9NiJHwUdrEk9e0romoGmtdTiJMmVJ/view?usp=sharing

Edited by frogyyy
Posted (edited)

This is my entry lua.


declare_plugin("HY4 pack",
{
installed      = true, -- if false that will be place holder , or advertising
dirName           = current_mod_path,
developerName      = _("CJT"),
version         = "1.0.0",
state         = "installed",
info         = _("HY4"),
})

mount_vfs_model_path    (current_mod_path.."/Shapes")
mount_vfs_texture_path    (current_mod_path.."/Textures")
mount_vfs_texture_path    (current_mod_path.."/Textures/HY4")
mount_vfs_liveries_path (current_mod_path.."/Liveries")

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

plugin_done()

 

 

Can you tell me how to view the log?

Edited by frogyyy
Posted (edited)

I looked at the error log and it says

 ALERT   Scripting: loadfile: can't open 'C:\Users---\DCS\Mods/tech/HY4C:\Users---\Saved Games\DCS\Mods/tech/HY4/hy4.lua'

how do i solve it?

Edited by frogyyy
Posted

It looks confusing between ' or " with the lua filename.

dofile line's /hy4.lua part has to be quoted by " similar to mount_vfs_***_path lines.

Modules: A-10C/II, F-4E, F-5E(Re), F-14A/B, F-15E, F-16C, F/A-18C, AV-8B, FC3, Ka-50-2/3, UH-1H, Mi-8MTV2, SA342, Mi-24P, AH-64D, CH-47F, P-51D, F4U-1D
Maps: Nevada, PG, Syria, SA, Sinai, Kola, Afghanistan, Iraq, CW Germany, Channel, Normandy2.0      Assets etc.: CA, Sc, WW2AP
Mods and Skins in User Files: files/filter/user-is-western0221/ 

 Screen_221018_005618c.jpg

Posted
5 hours ago, frogyyy said:

I changed it to "", but it doesn't work. 

Does the error message in dcs.log change ? or not ?

Modules: A-10C/II, F-4E, F-5E(Re), F-14A/B, F-15E, F-16C, F/A-18C, AV-8B, FC3, Ka-50-2/3, UH-1H, Mi-8MTV2, SA342, Mi-24P, AH-64D, CH-47F, P-51D, F4U-1D
Maps: Nevada, PG, Syria, SA, Sinai, Kola, Afghanistan, Iraq, CW Germany, Channel, Normandy2.0      Assets etc.: CA, Sc, WW2AP
Mods and Skins in User Files: files/filter/user-is-western0221/ 

 Screen_221018_005618c.jpg

  • 2 weeks later...
  • Recently Browsing   0 members

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