Jump to content
fget487

Retexture/Add New Food Cans Problem

Recommended Posts

Hello Community,

currently I am trying to add new Foodcans to the Game. With Sodas I were sucessful already, but with food which need to be opened with a canopener I just can't get it working:

Here is a small picture of what I mea. I know it is evry small but u can see the canopener cant be combined with the can itself:

e8SQ786LcYwAACCodOtH_rjF9C6HMsJCTKujGE6g

 

I simply modiefied the existing peachescan config.cpp like this:

class CfgPatches
{
	class Cat_food_test
	{
		units[]={};
		weapons[]={};
		requiredVersion=0.1;
		requiredAddons[]=
		{
			
			"DZ_Data"
		};
	};
};

class RecipeToolOnTool;
class CfgRecipes
{
	class OpenTunaWithHands
	{
		name = "Open %MATERIAL1";
		material[] = {"Food_CanTuna"};
		action = "[_owner, objNull, _material1] call event_OpenCan";
	};
	
	class OpenCanWithOpener
	{
		name = "Open %MATERIAL1 with %TOOL1";
		material[] = {"canned_catfood_co"};
		tools[] = {"Tool_CanOpener"};
		action = "[_owner, _tool1, _material1, true] call event_OpenCan";
	};
};
class cfgVehicles
{
	class Inventory_Base;
	class TacticalBaconCan;
	class TunaCan;
	class Edible_Base;

	class canned_catfood_co: TacticalBaconCan
	{
		scope=2;
		displayName="catfood";
		descriptionShort="$STR_PeachesCan1";
		model="\dz\gear\food\food_can.p3d";
		rotationFlags=63;
		itemSize[]={2,2};
		weight=465;
		varQuantityInit=0;
		varQuantityMin=0;
		varQuantityMax=0;
		isMeleeWeapon=1;
		SingleUseActions[]={};
		ContinuousActions[]={};
		hiddenSelections[]=
		{
			"camoGround"
		};
		hiddenSelectionsTextures[]=
		{
			"CatFood\food\data\canned_catfood_co.paa"
		};
	};
};

 

When I try to combine the Canopener with the Can, its a red indicator, so the palyer can't do soemthing with it. I shortened the Codesnippet here, normally there is more default code, which is not nessecary here for this problem.

I think it has something to do with that class where I put my new catfood class as material to open.

 class OpenCanWithOpener
    {
        name = "Open %MATERIAL1 with %TOOL1";
        material[] = {"canned_catfood_co"};
        tools[] = {"Tool_CanOpener"};
        action = "[_owner, _tool1, _material1, true] call event_OpenCan";
    };

 

I really can't figure it out, I also tried look at other mods how its done tehre, but when I try the same it still don't work. 

Am I missing a reference or something?

Btw: The texture is shown correctly in the game, so the texture related code should be ok.

 

Any Ideas or suggestions would be appreciated. 🙂

Share this post


Link to post
Share on other sites

Hello, do you still have your opening problem ?
(BTW "class CfgRecipes" is useless, now crafting recipes are in scripts)

Share this post


Link to post
Share on other sites

Hi, 
I solved it with a additional crafting recipe yes. But what you mean with CFg Recipes are useless?

Share this post


Link to post
Share on other sites

you have a <material> and then a <class> with the same name as the material - and then you list the material "canned_catfood_co" as in the class "canned_catfood_co"

so instead of :

material[] = {"canned_catfood_co"};

try :

material[] = {"Food_CanCatfood"};

- and  go on and sort it out from there

(Yoda says)

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

×