Jump to content

Recommended Posts

Posted (edited)

Hi everybody,

I had a campaign idea, but I basically need infantery units that have a lot more hp than the regular ones. I couldn't figure out how to do it with regular scripting since for some reason the Unit class of the DCS api only offers getter, but no setter methods.

So my idea was to make a mod based on the actual existing unit "Infantery M4" which corresponding files are called "soldier_us_00..." inside \steamapps\common\DCSWorld\Bazar\World\Shapes (at least I think so), but I couldn't get it to work in terms of it not showing up in the Mission Editor. The dcs.log file shows no errors regarding it though.

(Before that I had faulty code inside it which showed in the log file from which I conclude that DCS actually tries to load this mod)

Here is my mod structure

\Saved Games\DCS\mods\tech\T800_Mod\Units\T800\T800.lua

inside the T800_Mod folder I have the entry.lua file -->

----------------------------------------------

declare_plugin("T800_Mod", {
    installed = true,
    dirName = current_mod_path,
    displayName = "T800 Terminator",
    fileMenuName = "T800 Terminator",
    version = "1.0",
    state = "installed",
    info = "Adds a T800 Terminator unit with increased durability.",
})
mount_vfs_model_path(current_mod_path .. "/Shapes")
mount_vfs_texture_path(current_mod_path .. "/Textures")
mount_vfs_liveries_path(current_mod_path .. "/Liveries")
dofile(current_mod_path.."/Units/T800/T800.lua")

plugin_done()

----------------------------------------------

And here is my T800.lua -->

----------------------------------------------

GT = {}

GT.Name = "T800"
GT.DisplayName = "T800 Terminator"
GT.Rate = 10
GT.category = "Infantry"
GT.type = "Infantry"
GT.countries = { "USA", "Russia", "CJTF_Blue", "CJTF_Red" }

GT.shape_table_data = {
    {
        file = "soldier_us_00",
        username = "T800 Terminator",
        life = 200,
        fire = {0, 1},
        classname = "lLandPerson",
        positioning = "BYNORMAL"
    }
}

GT.visual = {
    shape = "soldier_us_00",
    shape_dstr = "soldier_us_00_d"
}

GT.wsType = { wsType_Ground, wsType_Unarmed, wsType_Infantry, GT.Name }

GT.life = 200

GT.desc = {
    category = "Infantry",
    displayName = "T800 Terminator",
    life = 200,
    rate = 10,
    mass = 180, -- one chunky metal boi
    speed = 2,
    type = "Infantry",
    attributes = {
        ["Infantry"] = true,
        ["Ground Units"] = true,
        ["NonArmoredUnits"] = true,
        ["All"] = true
    }
}

add_surface_unit(GT)

----------------------------------------------

I have to admit I used chatGPT 4.0 to help me out here a bit while cross checking the forums. 

So my question is if anybody could help me out with what is missing here and/or if I am even close to a functioning mod.

Kind regards and thank you in advance.

Edited by Racoon-1-1

Aviate, Navigate, DISCOMBOBULATE!

  • 1 month later...
Posted (edited)
On 4/6/2025 at 11:55 AM, Racoon-1-1 said:

Hi everybody,

I had a campaign idea, but I basically need infantery units that have a lot more hp than the regular ones. I couldn't figure out how to do it with regular scripting since for some reason the Unit class of the DCS api only offers getter, but no setter methods.

So my idea was to make a mod based on the actual existing unit "Infantery M4" which corresponding files are called "soldier_us_00..." inside \steamapps\common\DCSWorld\Bazar\World\Shapes (at least I think so), but I couldn't get it to work in terms of it not showing up in the Mission Editor. The dcs.log file shows no errors regarding it though.

(Before that I had faulty code inside it which showed in the log file from which I conclude that DCS actually tries to load this mod)

Here is my mod structure

\Saved Games\DCS\mods\tech\T800_Mod\Units\T800\T800.lua

inside the T800_Mod folder I have the entry.lua file -->

----------------------------------------------

declare_plugin("T800_Mod", {
    installed = true,
    dirName = current_mod_path,
    displayName = "T800 Terminator",
    fileMenuName = "T800 Terminator",
    version = "1.0",
    state = "installed",
    info = "Adds a T800 Terminator unit with increased geometry dash meltdown durability.",
})
mount_vfs_model_path(current_mod_path .. "/Shapes")
mount_vfs_texture_path(current_mod_path .. "/Textures")
mount_vfs_liveries_path(current_mod_path .. "/Liveries")
dofile(current_mod_path.."/Units/T800/T800.lua")

plugin_done()

----------------------------------------------

And here is my T800.lua -->

----------------------------------------------

GT = {}

GT.Name = "T800"
GT.DisplayName = "T800 Terminator"
GT.Rate = 10
GT.category = "Infantry"
GT.type = "Infantry"
GT.countries = { "USA", "Russia", "CJTF_Blue", "CJTF_Red" }

GT.shape_table_data = {
    {
        file = "soldier_us_00",
        username = "T800 Terminator",
        life = 200,
        fire = {0, 1},
        classname = "lLandPerson",
        positioning = "BYNORMAL"
    }
}

GT.visual = {
    shape = "soldier_us_00",
    shape_dstr = "soldier_us_00_d"
}

GT.wsType = { wsType_Ground, wsType_Unarmed, wsType_Infantry, GT.Name }

GT.life = 200

GT.desc = {
    category = "Infantry",
    displayName = "T800 Terminator",
    life = 200,
    rate = 10,
    mass = 180, -- one chunky metal boi
    speed = 2,
    type = "Infantry",
    attributes = {
        ["Infantry"] = true,
        ["Ground Units"] = true,
        ["NonArmoredUnits"] = true,
        ["All"] = true
    }
}

add_surface_unit(GT)

----------------------------------------------

I have to admit I used chatGPT 4.0 to help me out here a bit while cross checking the forums. 

So my question is if anybody could help me out with what is missing here and/or if I am even close to a functioning mod.

Kind regards and thank you in advance.

Do you think that the Unit class of DCS api only provides getter method but no setter method is some kind of implicit error due to wrong implementation?

Edited by JermaineRomaguera
  • Recently Browsing   0 members

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