Jump to content
Sign in to follow this  
kheiro

config door?

Recommended Posts

hi guys,

I have a problem with changed the Class Animation to AnimationSources,then I get a few config errors (adding onlyForPlayer) Now it's error free but the doors on the model just don't animate. The user action appears and seems to cycle between Open and Close, but the doors don't move.

erreurconfigdoor.th.jpg

My question is whether to configure the door in the config or Oxigen2?

here is my basic config:

class CfgPatches
{
   class Garage
   {
       units[]=
       {
           "Garage",
                               };
       weapons[]={};
       requiredVersion=1.000000;
       requiredAddons[]=
       {
           "CAData",
           "CABuildings",
           "CAMisc"
       };
       version=1.140000;
   };
};
class CfgVehicleClasses
{
   class Garage
   {
       displayName="Garage";
   };
};
class CfgVehicles
{
   class NonStrategic;
   class Furniture_break: NonStrategic
   {
       scope=2;
       vehicleClass="Garage";
       side=3;
       cost=1;
       mapSize=1;
                               destrType="DestructBuilding";
       displayName="Garage";
       model="\Garage\Garage.p3d";
                               ladders[]={{"start","end"}};
                    armor=80000;
                               animated = "true";
       class AnimationSources {

           class dvere1 {
               animPeriod = 2;
               source = "user";
           };
       };
       class Animations
       {
           class Dvere1
           {
               type="rotation";
               animPeriod=1
               selection="dvere1";
               axis="osa_dvere1";
               angle0=0
               angle1=-1.600000;
           };
       };
       class UserActions
       {
           class OpenDoors
           {
               displayName="Open Door";
               position="osa_dvere1";
               radius=2.500000;
               condition="this animationPhase ""Dvere1"" < 0.5";
               statement="this animate [""Dvere1"", 1]";
           };
           class CloseDoors
           {
               displayName="Close Door";
               position="osa_dvere1";
               radius=2.500000;
               condition="this animationPhase ""Dvere1"" >= 0.5";
               statement="this animate [""Dvere1"", 0]";
           };
       };
   };
};     
};

Share this post


Link to post
Share on other sites

You had two errors in signs.

In addition, you mixed the config.cpp and model.cfg.

Here's an example that should work with your garage door and one with a ladder.

model.cfg

class CfgSkeletons
{ 
class Default;
class Garage_Bones: Default 		// Le nom du fichier p3d suivi de _Bones
{
	isDiscrete=1;
	skeletonInherit="";
	skeletonBones[]=
	{
		"Dvere1",""							// Le nom de chaque porte présent dans le LOD Geometry	// Pas de virgule après la derniere porte
	};
};
};


class rotation;
class cfgModels 
{
class Default; 
class Garage: Default 			// Le nom du fichier p3d
{
	sectionsInherit="";
	skeletonName="Garage_Bones";	// Le nom du fichier p3d suivi de _Bones
	sections[]={};

	class Animations
	{
		class Dvere1 : Rotation
		{
			type="rotation";
			source="dvere1";	
			selection="dvere1";
			axis="osa_dvere1";
			memory = 1;
			sourceAddress = "clamp";
			minValue = 0.0;
			maxValue = 1;
			angle0=0
			angle1=-1.6;
		};
	};
};
};

config.cpp

class CfgPatches
{
   class Garage
   {
       units[]={"Garage"};
       weapons[]={};
       requiredVersion=1.000000;
       requiredAddons[]={"CAData","CABuildings","CAMisc"};
       version=1.140000;
   };
};

class CfgVehicleClasses
{
   class Garage
   {
       displayName="Garage";
   };
};

class CfgVehicles
{
   class Strategic;
   class Land_Furniture_break: Strategic
   {
       scope= 2;
	model="\Garage\Garage.p3d";
	mapSize=1;
       vehicleClass="Garage";

       destrType="DestructBuilding";
       displayName="Garage";

	side= 3;
	cost=0;
	armor = 80000; 

       ladders[]={{"start","end"}};

       class AnimationSources 
	{
           class dvere1 
		{
               source = "user";
			animPeriod = 2;
			initPhase=0;
           };
       };

       class UserActions
       {
           class OpenDoors
           {
               displayName="Open Door";
               position="osa_dvere1";
               radius=2.500000;
			onlyForPlayer = 0;
               condition="this animationPhase ""Dvere1"" < 0.5";
               statement="this animate [""Dvere1"", 1]";
           };
           class CloseDoors
           {
               displayName="Close Door";
               position="osa_dvere1";
               radius=2.500000;
			onlyForPlayer = 0;
               condition="this animationPhase ""Dvere1"" >= 0.5";
               statement="this animate [""Dvere1"", 0]";
           };
       };
   };
};

Sorry for my English, I use a translator.

I just changed a line in the file model.cfg:

class Garage_Bones: Default

Edited by akio

Share this post


Link to post
Share on other sites

Thank you for your help akio in understanding the config of Open door,but i have just question how to unpack model.cfg and config.cpp with config ccp.

Share this post


Link to post
Share on other sites

Files sent.

---------- Post added at 07:40 PM ---------- Previous post was at 06:38 PM ----------

Simple file (config.cpp, model.cfg) for the making of a garage with a swinging door and a ladder.

config.cpp

#define true			1
#define false			0

#define VSoft			0
#define VArmor			1
#define VAir			2

#define LockNo			0
#define LockCadet		1
#define LockYes			2

#define private			0
#define protected		1
#define public			2

#define TEast			0
#define TWest			1
#define TGuerrila		2
#define TCivilian		3
#define TSideUnknown		4
#define TEnemy			5
#define TFriendly		6
#define TLogic			7

#define ReadAndWrite		0
#define ReadAndCreate		1
#define ReadOnly		2
#define ReadOnlyVerified	3


class CfgPatches
{
   class Garage
   {
       units[]={"Garage"};
       weapons[]={};
       requiredVersion= 1.03;
       requiredAddons[]={"CAData","CABuildings","CAMisc"};
       version= 1.14;
	fileName = "Garage.pbo";
	author = "kheiro";
   };
};

class CfgVehicleClasses
{
   class kheiro_Structure
   {
       displayName="Garage";
   };
};

class CfgFactionClasses
{
       class kheiro
       {
              displayName = "kheiro model";                        // Nom de la class Faction dans l'éditeur.
              priority = 1;
              side = 2;                                              // Camp TGuerrila (voir liste abrégé ci_dessus).
       };
};


class CfgVehicles
{
class Strategic;	// External class reference

class Land_Garage : Strategic
   {
	scope = 2;                                                            // public (voir liste abrégé ci-dessus).
	model = \Garage\Garage.p3d;                     // Nom et chemin du .p3d.
	placement = vertical;
	mapSize = 3;                                                          // Taille de l'icône dans l'éditeur.
	displayName = "Garage";                                         // Nom de l'icône dans éditeur.
	vehicleClass = "kheiro_Structure";                                          // class du véhicule (voir ci-dessus).
	faction = "kheiro";                                                     // Faction

	cost = 0;
	armor = 800;                                                // C'est la résistance à la destruction de l'objet.

	ladders[] =    {{"ladder_1_start","ladder_1_end"}};


	class AnimationSources 
	{
		class door_1		// Marquer le nom qui est défini à côté de "source" dans le fichier model.cfg
		{
			source = "user"; 
			animPeriod = 2;  // Durée de l'animation
			initPhase=0;
		};		
	};

	class UserActions 
	{
		class OpenDoors1 
		{
			displayName = "Open Door";		// A marquer dans le fichier "stringtable.csv" S'affichera dans le menu deroulant				
			position = "door_knob_1";				// Le nom de la poignée de la porte dans le LOD Memory
			radius = 2;
			onlyForPlayer = 0;
			condition = "this animationPhase ""door_1"" < 0.5";
			statement = "this animate [""door_1"", 1]";
		};

		class CloseDoors1 
		{
			displayName = "Close Door";
			position = "door_knob_1";
			radius = 2;
			onlyForPlayer = 0;
			condition = "this animationPhase ""door_1"" >= 0.5";
			statement = "this animate [""door_1"", 0]";
		};
       };
   };
};

model.cfg

class CfgSkeletons
{ 
class Default;
class Garage_Bones: Default 		// Le nom du fichier p3d suivi de _Bones
{
	isDiscrete=1;
	skeletonInherit="";
	skeletonBones[]=
	{
		"door_1","",							// Le nom de chaque porte présent dans le LOD Geometry	// Pas de virgule après la derniere porte							
	};
};
};

class rotation;
class cfgModels 
{
class Default; 
class Garage: Default 			// Le nom du fichier p3d
{
	sectionsInherit="";
	skeletonName="Garage_Bones";	// Le nom du fichier p3d suivi de _Bones
	sections[]={};
	class Animations
	{
		class door_1: Rotation 
		{
			type = "rotation";				// Type d'animation pour une porte qui pivote sur un axe
			source="door_1";					// A marquer comme tel pour une porte et a reporter dans le fichier config.cpp "class AnimationSources/ class door"
			selection = "door_1";
			axis = "axis_door_1";			// Le nom donne aux charniere de la porte dans le LOD Memory
			memory = 1; 					// Est ce que les points de references se trouvent dans le LOD Memory 1=oui 0=non
			sourceAddress = "clamp";
			minValue = 0.0;
			maxValue = 1;
			angle0 = 0; 
			angle1 = 1.6; 				// Angle d'ouverture de la porte en degre
		};
	};
};
};

Share this post


Link to post
Share on other sites

Thanks for the help akio for fixed the config and model,it work perfect now.:yay:

thanksf.gif

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  

×