Jump to content

Sign in to follow this  
Richards.D

Animated Door 2 - Return of the Errors

Recommended Posts

Hello gentlemen,

I've been working on releasing some static addons for life servers, so I put on hold some of the work on improving my skills. I am going to do a sizable addon that MUST have working doors, so it's now or never I guess. My last topic I was really trying to get help on the fundamentals, but this time I really need to get a solid working test up. I will paste everything I have, including source files for your delectation. The issue I currently have is "Error /bin/config/Model Config", which has to do with my object class.. But I've made plenty of addons like that, so it is a peculiar problem. With this error, I have no way of testing if the model works correctly.

Heres my Config.CPP

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

#define true	1
#define false	0

class CfgVehicleClasses {
class dar_structures {
	displayName = "DAR Structures";
};
};

class CfgPatches {
class dar_structures {
	units[] = {"dar_testing"};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {};
};
};

class CfgSkeletons {
class Default;	// External class reference
class Strategic;	// External class reference

class dar_testingBones : Strategic {
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {"pos_door", "pos_switch", "door_axis"};
};
};
class Rotation;	// External class reference

class CfgModels {
class Default {
	sections[] = {""};
	sectionsInherit = "";
};

class Strategic : Default {};

class dar_testing : Strategic {
	sectionsInherit = "";
	sections[] = {};
	skeletonName = "dar_testingBones";

	class Animations {
		class pos_door {
			source = "slow_func";
			type = "rotation";
			animPeriod = 2;
			selection = "pos_switch";
			axis = "door_axis";
			angle0 = 0;
			angle1 = 0.04;
		};
	};	
};
};	

class CfgVehicles {
class Thing;	// External class reference
class Building;	// External class reference
class Strategic;	// External class reference

class NonStrategic : Building {
	class DestructionEffects;	// External class reference
};
class HouseBase;	// External class reference
class Land_VASICore;	// External class reference

class House : HouseBase {};
class Ruins;	// External class reference

class dar_testing : House {
	scope = public;
	skeletonName = "dar_testingBones";
	model = "\dar_animtesting\TUT_Door_3x3m.p3d";
	icon = "";
	mapSize = 10;
	displayName = "Door Testing Model";
	vehicleClass = "DAR Structures";
	nameSound = "Building";
	accuracy = 0.2;	// accuracy needed to recognize type of this target
	animated = false;

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

		class fast_func {
			source = "user";
			animPeriod = 1;
			initPhase = 0;
		};
	};
	destrType = "DestructBuilding";

	class DestructionEffects {
		class Smoke1 {
			simulation = "particles";
			type = "BarelDestructionSmoke";
			position = "Handlep_FD_Left";
			intensity = 0.01;
			interval = 1;
			lifeTime = 0.1;
		};

		class Smoke2 {
			simulation = "particles";
			type = "BarelDestructionSmoke";
			position = "Handlep_FD_Right";
			intensity = 0.01;
			interval = 1;
			lifeTime = 0.1;
		};
	};
	cost = 0;
	armor = 10;

	class UserActions {
		class Openpos_door {
			displayName = "Open Door";
			position = "pos_switch";
			radius = 2;
			onlyforplayer = 0;
			condition = "this animationPhase ""pos_door"" < 0.5";
			statement = "this animate [""pos_door"",1]; this say ""dooropen""";
		};

		class Closepos_door {
			displayName = "Close Door";
			position = "pos_switch";
			radius = 2;
			onlyforplayer = 0;
			condition = "this animationPhase ""pos_door"" >= 0.5";
			statement = "this animate [""pos_door"",0]; this say ""doorclose""; this setDammage 0";
		};

	};
};
};	

And here is the download link to the entire addon: (I don't care if someone steals this.. it took me 4 seconds to make, it's honestly nothing)

https://dl.dropbox.com/u/23389642/dar_animtesting.rar

Thank you in advance, gentlemen..

Richards

Share this post


Link to post
Share on other sites

??

See previous thread !

.... what happened to my previous advice. Specifically breaking data in config.cpp and model.cfg

and CfgPatches should be first in the cpp

Share this post


Link to post
Share on other sites

Right... When I arrive home today I'll break this one up like my last two. The only issue was the last one gave me no interaction whatsoever so unfortunately I gave up. I'll copy this content to the previous format and will advise if that has worked.

Richards

Share this post


Link to post
Share on other sites

Alright.. I've come home, written up the configs based on my first request, and, it is better but no cigar as of yet. When I enter the editor, I no longer receive any errors (excellent). When I place the object, it displays correctly, and there are no in-game errors. Unfortunately, I still get absolutely no area to interact with the object. Here are the NEW Config.CPP + Model.CFG files, AND the source model in its current state.

CONFIG.CPP

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

#define true	1
#define false	0

class CfgPatches {
class dar_testing {
	units[] = {"dar_testing"};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"CAData"};
};
};

class CfgVehicleClasses {
class dar_testing {
	displayName = "DAR Structures";
};
};

class CfgVehicles {
class House; 
class dar_testing : House 
{
	scope = public;
	model = "\dar_animtesting\TUT_Door_3x3m.p3d";
	mapSize = 10;
	displayName = "Door Testing Model";
	vehicleClass = "dar_testing";
	nameSound = "Building";
	accuracy = 0.2;	// accuracy needed to recognize type of this target
	animated = false;

	class EventHandlers {};

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

		class fast_func {
			source = "user";
			animPeriod = 1;
			initPhase = 0;
		};
	};
	cost = 0;
	armor = 100000;

	class UserActions {
		class Openpos_door {
			displayName = "Open Door";
			position = "pos_switch";
			radius = 2;
			onlyforplayer = 0;
			condition = "this animationPhase ""pos_door"" < 0.5";
			statement = "this animate [""pos_door"",1]; this say ""dooropen""";
		};

		class Closepos_door {
			displayName = "Close Door";
			position = "pos_switch";
			radius = 2;
			onlyforplayer = 0;
			condition = "this animationPhase ""pos_door"" >= 0.5";
			statement = "this animate [""pos_door"",0]; this say ""doorclose""; this setDammage 0";
		};
	};
};
};	

MODEL.CFG

class CfgSkeletons
{
   class Default;
   class MyHouseBones : Default
   {
       isDiscrete = 1;
       skeletonInherit = "";
       skeletonBones[] =
       {
           "pos_door", "pos_switch", "door_axis"};
   };
};
class CfgModels
{
   class Default;
   class TUT_Door_3x3m : Default //MUST_BE_THE_NAME_OF_YOUR_P3D_FILE
   {
       sectionsInherit = "";
       sections[] = {};
       skeletonName = "MyHouseBones";
       class Animations
       {
           class pos_door {
               source = "slow_func";
               type = "rotation";
               animPeriod = 2;
               selection = "pos_door";
               axis = "door_axis";
       sourceAddress="clamp";
       minValue=0;
       maxValue=1;
       angle0 = "0";
       angle1 = "rad 90";
           };
	};
   };
};  

SOURCE MODEL WITH ALL CURRENT COMPONENTS:

https://dl.dropbox.com/u/23389642/dar_animtesting.rar

EDIT: I've been thinking of possible solution that might work, just waiting on your response of course.

1. Interaction area is too small.

Well, I've made one point as the switch position, in front of the door about mid way up. Do I need more points or an object for the switch?

2. Not named correctly

Do I need the switch and axis in all LOD's?

3. No geo LOD

I didn't include a GEO Lod since this is a basic test model, do I need one?

4. Config/Model.cfg errors

Well dunno how to fix those..

Richards

Edited by RichardsD

Share this post


Link to post
Share on other sites

You will need a Geometry LOD, the door has to be a named selection in the geometry LOD and you need to put a class in the named selections part of the geometry lod.

config

#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 true 1 
#define false 0 

// type scope 
#define private 0 
#define protected 1 
#define public 2 

class CfgPatches
{
class TUT_door_3x3m
{
	units[] =
	{
	"pos_door"
	};
	weapons[] ={};
	requiredVersion = 1;
	rewuiredAddons[] = {CAData};
};
};

class CfgVehicleClasses
{
class TUT_door_3x3m
{
	displayName = "dar testing";
};
};
class CfgVehicles
{
class Strategic;
class Land_TUT_door_3x3m : Strategic
{
	scope = public;
	model = "\RYE_walls\TUT_door_3x3m.p3d";
	mapsize = 5;
	displayName = "TUT_door_3x3m";
	vehicleClass = "TUT_door_3x3m";
	destrType = "destructBuilding";
	nameSound = "Building";
	accuracy = 0.2;
	cost = 0;
	armor = 50;
	icon = "\Ca\buildings\Icons\i_wall_CA.paa";

	class AnimationSources
	{
		class pos_door
		{
			source = "user";
			animPeriod = 2;
			initPhase = 0;
		};
	};
	class UserActions
	{
		class OpenDoors
		{
			displayName = "Open pos_door";
			position = "pos_switch";
			radius = 2;
			onlyforplayer = true;
			condition = "this animationPhase ""pos_door"" < 0.5";
			statement = "this animate [""pos_door"", 1]";
		};
		class CloseDoors
		{
			displayName = "Close pos_door";
			position = "pos_switch";
			radius = 2;
			onlyforplayer = true;
			condition = "this animationPhase ""pos_door"" >= 0.5";
			statement = "this animate [""pos_door"", 0]";
		};
	};
};
};	

model

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

class rotation;
class CfgModels
{
	class Default;
	class TUT_door_3x3m : Default
	{
		sectionsInherit = "";
		sections[] = {};
		skeletonName = "TUT_door_3x3m_Bones";

			class Animations
			{
			class pos_door : Rotation
			{
				type = "rotation";
				source = "user";
				animPeriod = 2;
				selection = "pos_door";
				axis = "door_axis";
				sourceAddress = "clamp";
				memory = 1;
				minValue = 0.0;
				maxValue = 1;
				angle0 = "0";
				angle1 = "rad 90";
			};
	};
};	
};			

Those worked for me in Oxygen after adding the geo lod and selecting the class in the GEO LOD, didn't try it in game but unless I typoed something it should work.

You'll just have to change the path in the model line from "\RYE_walls" to whatever you have it in.

Share this post


Link to post
Share on other sites

Uhh, do you mean by defining the class in the GEO LOD?

---------- Post added at 19:09 ---------- Previous post was at 18:22 ----------

At Exactly 7:01 PM EST, SUCCESS WAS ACHIEVED! Almost..

Thank you both for your help this far, and YES the animation works perfectly! Now, this is excellent, but there is one slight error. The door itself has no hitbox even though I did give it one, and name it the same as the door.. Any one know the solution?

https://dl.dropbox.com/u/23389642/arma2oa%202013-02-15%2018-59-42-23.png

Share this post


Link to post
Share on other sites

Yes, as Prof says, clearly see 3 components, but theres only 2 "Componentxx"

STRUCTURE -> TOPOLOGY -> FIND COMPONENTS

You should also check with FIND NON-CLOSED, make sure noting comes up highlighted.

Share this post


Link to post
Share on other sites

Roger that, no non-closed. I used the tool, and it worked!

Thank you all, this is absolutely wonderful.

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  

×