Jump to content
eggbeast

making a flashlight - what is needed for it to work in game?

Recommended Posts

I am trying to work out the requirements to enable a custom model to work as a flashlight attachment.

We have the old angle-head flashlight in Unsung vietnam war mod.

In A2 we just added class flashlight to the weapon config and it worked great but and it needs an attachment to work I think in A3.

 

you can see it working here from 1.52

 

example BI flashlight accessory

 

model

accv_flashlight_F.p3d 

I have no idea what is in this model - selections, memory points, rvmats, etc as it can't be examined due to copyright protection.

There is no sample flashlight accessory that I can find to examine either.

 

It clearly has these in memory lod:

"flash dir"
"flash"

config

	class acc_flashlight: ItemCore
	{
		author = "$STR_A3_Bohemia_Interactive";
		_generalMacro = "acc_flashlight";
		scope = 2;
		displayName = "$STR_A3_cfgWeapons_acc_flashlight0";
		descriptionUse = "$STR_A3_cfgWeapons_use_flashlight0";
		picture = "\A3\weapons_F\Data\UI\gear_accv_flashlight_CA.paa";
		model = "\A3\weapons_f\acc\accv_Flashlight_F";
		descriptionShort = "$STR_A3_cfgWeapons_acc_flashlight1";
		class ItemInfo: InventoryFlashLightItem_Base_F
		{
			mass = 4;
			class FlashLight
			{
				color[] = {180,156,120};
				ambient[] = {0.9,0.78,0.6};
				intensity = 20;
				size = 1;
				innerAngle = 20;
				outerAngle = 80;
				coneFadeCoef = 5;
				position = "flash dir";
				direction = "flash";
				useFlare = 1;
				flareSize = 1.4;
				flareMaxDistance = "100.0f";
				dayLight = 0;
				class Attenuation
				{
					start = 0.5;
					constant = 0;
					linear = 0;
					quadratic = 1.1;
					hardLimitStart = 20;
					hardLimitEnd = 30;
				};
				scale[] = {0};
			};
		};
		inertia = 0.1;
	};

i have tried to clone this for a lens model attached as siderail proxy to my mx991 flashlight (weapon) model, with the memory points added, and it fails to work... any idea what i'm missing?

Share this post


Link to post
Share on other sites

basically to get it working in A3, i had to enable the stock flashlight to attach to our handheld angle-head flashlight model/ weapon.

i am thinking if we must have the flashlight attachment to get it to light up properly, then we can use a simple beam / cone like you see on the headlights, and the flash memory points, and it should then load onto the flashlight as a siderail proxy.

however when i tried this it never showed up.

I am assuming the flashlight accessory model needs something else in order to work properly, but there are no demo files for a flashlight afaik.

Share this post


Link to post
Share on other sites

it's possible to use FlashLight class inside weapon cfg just like BIS Vector SMG

 

    class rds_weap_latarka_janta: Pistol_Base_F
    {
        AUTHOR_MACRO
        scope = 2;

        magazines[] = {"rds_dummy_mag"};

        displayname = "Flashlight 'Janta'";
        displaynameShort = "Handheld flashlight";
        descriptionShort = "Handheld flashlight";

        model = "\rds_a2port_civ\items\rds_latarka_janta";
        picture = "\rds_a2port_civ\items\pic\rds_janta_pic.paa";

        handAnim[]= {"OFP2_ManSkeleton","\rds_a2port_civ\items\anims\rds_latarka_janta.rtm"};

        optics=0;
        weaponInfoType = "rds_rscOptics_janta";

        class FlashLight
        {
            color[] = {180,150,120};
            ambient[] = {9,7.5,6};
            intensity = 23;
            size = 1;
            innerAngle = 20;
            outerAngle = 120;
            coneFadeCoef = 55;
            position = "flashlight_dir";
            direction = "flashlight_pos";
            useFlare = 1;
            flareSize = 0.4;
            flareMaxDistance = "100.0f";
            dayLight = 1;
            class Attenuation
            {
                start = 0.5;
                constant = 0;
                linear = 0;
                quadratic = 1;
                hardLimitStart = 20;
                hardLimitEnd = 30;
            };
            scale[] = {0};
        };

hope that helps ;)

 

  • Like 1

Share this post


Link to post
Share on other sites

wow that's what i started with pretty much. based on the A2 version I had made.

it didn't work in A3 with the new a3 flashlight class added to the config, so i went more and more complex in my thinking - a bad move for any modder eh.

thanks so much for helping - that will give me the confidence to get this done properly now

Share this post


Link to post
Share on other sites

wow so did you make a custom weaponinfotype to allow you to change colour of the flashlight using zeroing keys? that is genius!

could you possibly share the model.cfg entires and class details for the custom type?

we have three coloured lenses on our flashlight but i could never work out a way of animating them like this.

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

×