Jump to content
Sign in to follow this  
Prodeath21

Start looping object Animation when placing it in EDEN

Recommended Posts

Hey,

currently I am working on a small "just for fun" addon to get better knowledge about Arma´s static objects and how to create them.

 

At the moment I am creating a mini golf course with a windmill and i want to animate (spinn) the rotor of it.
My Problem is, that i want to constantly rotate the windmill like the default windturbines in Arma 3, but slower. I was looking into the default turbines configs but had problems to understand how the animations work and start at the spawn. I also tryed to trigger my animation via a UserActions in the config.cpp, wich worked but it still was/is not the final solution for me. I also found out about the "sourceAddress="loop";" option after researching but it´s still not working 😞

 

I hope that explained my problem pretty well.

Has anyone a solution, on how to fix that?

 

 

My objects Class (inherited into CfgVehicles (config.cpp))

class Pro21_Bahn_5 : Static 
{
	author = "Prodeath21";
	displayName = "$STR_Pro21_Bahn_5";
	scope=2;
	model = "\Pro21_Minigolf\Bahn_5\Bahn_5.p3d";
	icon = "\Pro21_Minigolf\default\icons\minigolf.paa";
	editorCategory="Pro21_Addon";
	editorSubcategory="Pro21_Objects";
	
	//picture = "\Pro21_Minigolf\default\icons\default.paa";
	//vehicleClass = "";
	
	class AnimationSources
	{
		class windrad
		{
			source = "user"; 			//default "user"
			animPeriod = 12;			//Dauer einer periode (Sekunden)
			
		};
	};
};

 

My model.cfg

class CfgSkeletons
{
	class Default
	{
		isDiscrete = 1;
		skeletonInherit = "";
		skeletonBones[] = {};
	};
	class Pro21_Bahn_5_sceleton: Default
	{
		skeletonInherit = "Default";
		skeletonBones[]=
		{
			"wind",""
		};
	};
};

class Rotation;
class CfgModels
{
	class Default
	{
		skeletonName="";
		sections[]={};
		sectionsInherit="";
	};
	
	class Bahn_5: Default
	{
		skeletonName="Pro21_Bahn_5_sceleton";
		sections[]={""};
		sectionsInherit="";
		
		class Animations
		{
			class windrad
			{
				type = "rotation";
				source = "user";
				selection = "wind";
				axis = "wind_axis";
				sourceAddress="loop";
				memory = 1;
				minValue = 0;
				maxValue = 1;
				animPeriod = 0;
				angle0 = "0";
				angle1 = "rad -360";
			};
		};
	};
};

 

Thank you for your help! 🙂

Share this post


Link to post
Share on other sites

Have you tried to multiply the value in maxValue class? Like:

maxValue = 4;

It may works. I usually increase the rotation speed multiplying the "angle1" value. Decreasing the speed by making it smaller like 180 degrees will just stop the animation halfway and start from the beginning again for another cycle.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you!! It finally is slower and works!

 

I set "maxValue = 10;" to slow it down even more and get the perfect result.

I also set "source = "::time";", so the windmill is starting automatically with the animation when placing it in EDEN.

 

Here are my final lines of code:

 

My objects Class (inherited into CfgVehicles (config.cpp))

class Pro21_Bahn_5 : Static 
{
	author = "Prodeath21";
	displayName = "$STR_Pro21_Bahn_5";
	scope=2;
	model = "\Pro21_Minigolf\Bahn_5\Bahn_5.p3d";
	icon = "\Pro21_Minigolf\default\icons\minigolf.paa";
	editorCategory="Pro21_Addon";
	editorSubcategory="Pro21_Objects";
	
	//picture = "\Pro21_Minigolf\default\icons\default.paa";
	//vehicleClass = "";
	
	class AnimationSources
	{
		class windrad
		{
			source = "::time"; 			//to start the animation automatically
			
		};
	};	
};

 

My model.cfg

class CfgSkeletons
{
	class Default
	{
		isDiscrete = 1;
		skeletonInherit = "";
		skeletonBones[] = {};
	};
	class Pro21_Bahn_5_sceleton: Default
	{
		skeletonInherit = "Default";
		skeletonBones[]=
		{
			"wind",""
		};
	};
};

class Rotation;
class CfgModels
{
	class Default
	{
		skeletonName="";
		sections[]={};
		sectionsInherit="";
	};
	
	class Bahn_5: Default
	{
		skeletonName="Pro21_Bahn_5_sceleton";
		sections[]={""};
		sectionsInherit="";
		
		class Animations
		{
			class windrad
			{
				type = "rotation";
				source = "::time";
				selection = "wind";
				axis = "wind_axis";
				sourceAddress="loop";
				memory = 1;
				minValue = 0;
				maxValue = 10;
				animPeriod = 0;
				angle0 = "0";
				angle1 = "rad -360";
			};
		};
	};
};

 

  • Like 1

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  

×