Jump to content
[evo] dan

Making A Jerry Can a object

Recommended Posts

Hi all,

 

I've made a jerry can object and would like to make it an inventory item which once placed on the ground would allow the refuelling of vehicles from it. I want something that would be similar to the toolkit or the medikit. I've made the config within the current config for the standalone editor placeable object which works fine. I however cannot find the inventory object within the arsenal or even as its own object to place it with.

 

Heres my config.cpp:

class CfgPatches {
	class Jerry_Can {
		units[] = {"Dan_Jerry_Can","Dan_Jerry_Can_Inv"};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {};
	};
};

class CfgDestructPos{

};

class CfgMagazines {
	class Dan_Jerry_Can_Inv
	{
		scope = 2;
		model = "\Dan_Jerry_Can\Dan_Jerry_Can_Inv.p3d";
		displayName = "Jerry Can Item";
		supplyRadius = 20;
		transportFuel = 100;
		allowedSlots[] = {901,701};
		mass = 20;
		count = 1;
		weaponPoolAvailable = 1;
		scopeArsenal = 2;
	};
};

class CfgVehicles {
	class ThingX;
	class Dan_Jerry_Can : ThingX
	{
		scope = 2;
		author = "[EVO] Dan";
		editorPreview = "\Dan_Jerry_Can\Dan_Jerry_Can_Thumb.paa";
		model = "\Dan_Jerry_Can\Dan_Jerry_Can.p3d";
		displayName = "Jerry Can";
		vehicleClass = "small_items";
		destrType = "DestructBuilding";
		armor = 30;
		fireResistance = 0.1;
		explosionShielding = 0.1;
		damageResistance = 0.004;
		slingLoadCargoMemoryPoints[] =
		{

		};
		class Damage
		{
			tex[] = {};
			mat[] = {};
		};
		damageHalf[] = {};
		damageFull[] = {};
		supplyRadius = 20;
		transportFuel = 100;
		class DestructionEffects
		{
			class Smoke1
			{
				intensity = 1;
				interval = 1;
				lifeTime = 2;
				position = "";
				simulation = "particles";
				type = "ObjectDestructionSmokeSmall";
			};
			class Smoke2
			{
				intensity = 1;
				interval = 1;
				lifeTime = 2;
				position = "";
				simulation = "particles";
				type = "ObjectDestructionSmoke2";
			};
			class Fire1
			{
				intensity = 1;
				interval = 1;
				lifeTime = 2;
				position = "";
				simulation = "particles";
				type = "ObjectDestructionFire1Small";
			};
		};
	};
};

Would anybody be able to help me out with this at all as i'm struggling to get it to work.

 

Thanks in advance for any help rendered.

Share this post


Link to post
Share on other sites

I've had another look over my config and the encoding guide and have come up with the following config.cpp:

 

class CfgPatches {
	class Jerry_Can {
		units[] = {"Dan_Jerry_Can","Dan_Jerry_Can_Inv"};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {};
	};
};

class CfgDestructPos{

};

class CfgVehicles {
	class ThingX;
	class Item_Base_F;
	class Dan_Jerry_Can : ThingX
	{
		scope = 2;
		author = "[EVO] Dan";
		editorPreview = "\Dan_Jerry_Can\Dan_Jerry_Can_Thumb.paa";
		model = "\Dan_Jerry_Can\Dan_Jerry_Can.p3d";
		displayName = "Jerry Can";
		vehicleClass = "small_items";
		destrType = "DestructBuilding";
		armor = 30;
		fireResistance = 0.1;
		explosionShielding = 0.1;
		damageResistance = 0.004;
		slingLoadCargoMemoryPoints[] =
		{

		};
		class Damage
		{
			tex[] = {};
			mat[] = {};
		};
		damageHalf[] = {};
		damageFull[] = {};
		supplyRadius = 20;
		transportFuel = 100;
		class DestructionEffects
		{
			class Smoke1
			{
				intensity = 1;
				interval = 1;
				lifeTime = 2;
				position = "";
				simulation = "particles";
				type = "ObjectDestructionSmokeSmall";
			};
			class Smoke2
			{
				intensity = 1;
				interval = 1;
				lifeTime = 2;
				position = "";
				simulation = "particles";
				type = "ObjectDestructionSmoke2";
			};
			class Fire1
			{
				intensity = 1;
				interval = 1;
				lifeTime = 2;
				position = "";
				simulation = "particles";
				type = "ObjectDestructionFire1Small";
			};
		};
	};
	class Dan_Jerry_Can_Inv : Item_Base_F
	{
		scope = 2;
		scopeCurator = 2;
		model = "\Dan_Jerry_Can\Dan_Jerry_Can_Inv.p3d";
		displayName = "Jerry Can Item";
		supplyRadius = 20;
		transportFuel = 100;
		allowedSlots[] = {901,701};
		vehicleClass = "Items";
		mass = 20;
		count = 1;
		weaponPoolAvailable = 1;
		scopeArsenal = 2;
		weapons[] = {};
		typicalCargo[] = {};
		weaponSlots = 0;
		type = 1;
		picture = "pictureStaticObject";
		editorCategory = "EdCat_Equipment";
		editorPreview = "\A3\EditorPreviews_F\Data\CfgVehicles\Default\Prop.jpg";
		editorSubcategory = "EdSubcat_InventoryItems";
		_generalMacro = "Item_Base_F";
	};
};

However, the item does not show up in the arsenal anywhere and if I place it on the ground to start with, almost instantly disappears. Can anybody help me out with this at all as i'm scratching my head a bit here about the problem.

Share this post


Link to post
Share on other sites

Your first config was more in the right direction than this one imo.

 

In that one, you have the object (cfgVeh) for existing in the game world, and the item (cfgMag) for existing in inventory.

 

However, you should inherit from an existing magazine, because you will not have anything defined for the myriad of cfgProperties for your "magazine" apart from the ones you implicitly defined in your config.

 

Try doing something like this:

 

class cfgMagazines {
    class SomeExistingMagInVanillaGame;
    class Dan_Jerry_Can_inv : SomeExistingMagInVanillaGame {
        // your new properties
    };
};

 

Sorry if my answer is brief - I'm in the middle of nailing down an overclock to my PC and all the stress testing is ragging the shit out of Chrome.  Maybe I'll BSOD again?  Who knows?

 

Anyway, that's not important right now.  Let me know how you get on and I'll try to get back to you in more detail if needed.

 

  • Like 1

Share this post


Link to post
Share on other sites
7 minutes ago, das attorney said:

Your first config was more in the right direction than this one imo.

 

In that one, you have the object (cfgVeh) for existing in the game world, and the item (cfgMag) for existing in inventory.

 

However, you should inherit from an existing magazine, because you will not have anything defined for the myriad of cfgProperties for your "magazine" apart from the ones you implicitly defined in your config.

 

Try doing something like this:

 


class cfgMagazines {
    class SomeMagInVanillaGame;
    class Dan_Jerry_Can_inv : SomeMagInVanillaGame {
        // your properites
    };
};

 

Sorry if my answer is brief - I'm in the middle of nailing down an overclock to my PC and all the stress testing is ragging the shit out of Chrome.  Maybe I'll BSOD again?  Who knows?

 

Anyway, that's not important right now.  Let me know how you get on and I'll try to get back to you in more detail if needed.

 

I've used the 556 stanag mag to inherit from. I've got it showing up within the magazines list and now places down on the floor nicely (I just need an inventory picture made now). I just need to figure out how to get it to refuel when its placed on the ground just like the static object it was originally derived from and not be an object I can walk straight through but i'll probably have another crack at it tomorrow.

 

Thanks for your help on 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

×