Jump to content
Sign in to follow this  
TitansWeasel

Smoke shell with extendet life time

Recommended Posts

Hello

 

As the Titel Says i need some help with the config of an Smoke Shell.

I want it to be as the vanilla shell but with extended life time.

im a beginner at config writing and im sure im doeing something wrong because its not working.

 

Spoiler

class cfgPatches
{
    class Titan_smoke
    {
        units[]={};
        weapons[]={};
        requiredVersion=0.1;
        requiredAddons[]= {};
        author="Mike / Weasel";
    };
};

class CfgMagazines
{
    class 1Rnd_SmokeYellow_Grenade_shell;
    class 1Rnd_SmokeYellow_Grenade_shell_Titan: 1Rnd_SmokeYellow_Grenade_shell
    {
        author="Mike / Weasel";
        displayName="$STR_A3_CfgMagazines_1Rnd_SmokeYellow_Grenade_shell0_Titan";
        picture="\A3\Weapons_f\Data\UI\gear_UGL_Smokeshell_yellow_CA.paa";
        ammo="G_40mm_SmokeYellow_Titan";
    };
};
    
class CfgAmmo
{    
    class G_40mm_SmokeYellow;
    class G_40mm_SmokeYellow_Titan: G_40mm_SmokeYellow
    {
    timeToLive=120;
    };
};

 

Share this post


Link to post
Share on other sites

I managed to get the shell ingame.

i can spwan it, add it to my inventory, drop it on the ground and pick it up again, but im not able to put it in the granade launcher.

Any tips or hints?

 

Here is the new Code

Spoiler

class CfgPatches
{
    class Titan_Smoke
    {
        name = "Titan_smoke";
        author = "Mike/Weasel";
        requiredVersion = 1.0;
        requiredAddons[] = {"A3_Weapons_F"};
        units[] = {};
        weapons[] = {};
    };
};

class CfgAmmo
{
    class Default;    
    class Grenade: Default {};
    class GrenadeHand: Grenade {};
    class SmokeShell: GrenadeHand {};
    class G_40mm_Smoke: SmokeShell {};
    class G_40mm_SmokeYellow_Titan: G_40mm_Smoke
    {
        scope = 1;
        timeToLive=120;
        smokeColor[] = {0.961,0.4505,0.0109,0.8};
        effectsSmoke="SmokeShellYellowEffect";        
    };
};

class CfgMagazines
{
    class Default;
    class CA_Magazine: Default {};
    class 1Rnd_HE_Grenade_shell: CA_Magazine {};
    class 1Rnd_Smoke_Grenade_shell: 1Rnd_HE_Grenade_shell {};
    class 1Rnd_SmokeYellow_Grenade_shell_Titan: 1Rnd_Smoke_Grenade_shell
    {
        author="Mike/Weasel";
        displayName="SmokeShellYellowTitan";
        picture="\A3\Weapons_f\Data\UI\gear_UGL_Smokeshell_yellow_CA.paa";
        ammo="G_40mm_SmokeYellow_Titan";
        displayNameShort="Titan_smoke_yellow";
        descriptionShort="Titan_smoke_yellow";
    };
};

class CfgWeapons
{
    class Default;
    class GrenadeLauncher: Default {};
    class UGL_F: GrenadeLauncher {};
    class Titan_Launcher: UGL_F
    {
        magazines[] =
        {
            "1Rnd_SmokeYellow_Grenade_shell_Titan"
        };
    };
};

 

Share this post


Link to post
Share on other sites

While I was tinkering with the HEAT weapons to create a new RPG-7 rocket that induced spalling upon hit, I also ran into an issue where I could see the ammo, load it into the RPG, but not fire it. Turns out in my case, it was a misplaced underscore that meant the magazine could not find the ammo to fire.

 

In your case, it seems the magazine and ammo is set up correctly, but by your description, it seems you can't load it into the weapon.


The weapon needs a defined array of magazines to be able to use them, and the mags need defined ammo types to hold. This all seems fine to me, so the only thing I can think of right now is your weapon config.

 

All you have done is create a new weapon called "Titan_Launcher" based on the class UGL_F. Basically that creates a new launcher, that is an exact copy of the UGL_F, besides overriding magazine type to only use your custom "1Rnd_SmokeYellow_Grenade_shell_Titan".

 

Seeing that your weapon does not know how to load it (no reload action or click and drag/drop into inventory slot I assume), then as far as I can tell either:

 

A) You are using the wrong weapon.

B) Your new weapon has the same name, description and everything ingame and is therefore conflicting with the class you inherit from.

 

My programming knowledge is extremely limited, but try adding some more custom parameters to your Titan_Launcher, other than only "magazines[]". 

 

I did all of this stuff, but ended up having duplicate RPG-7's and Rockets that were incompatible.

 

The easy way is to just make the default UGL's accept your new ammo.

 

Basically:

 

class CfgWeapons
{
	class GrenadeLauncher{};

	class UGL_F: GrenadeLauncher
	{
		magazines[]=
		{
			"Copy+paste all base class (UGL_F) magazines from weapons_F(default bis weapon config),"1Rnd_SmokeYellow_Grenade_shell_Titan"
		};
	};
};

 

If I'm not mistaken, you will overwrite the vanilla game's UGL_F magazine compatibility, meaning any weapon based on UGL_F, will use your new smoke round. If you trace backwards through your inheritance (UGL_F >> GrenadeLauncher >> Default) you can limit or broaden the range of weapons that will accept your new ammo.

 

If, however, you want a dedicated grenade launcher based on UGL_F, then you must either create that weapon from scratch, or copy/replace the info from class UGL_F.

 

 

 

I hope this helps.

 

I am learning these things myself at the moment - so beware that I may be giving you wrong advice or none at all. 

use at your own risk :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×