Jump to content
Sign in to follow this  
Elliot Carver

Lads, need a hand with first addy

Recommended Posts

Hey folks,

Been teaching myself how to make an addon from start to finish this week, ironing out the problems as i go. What im left with are a few issues that im gunna have to ask for a hand with (Been following Mondkalb's "How to create an Addon from scratch")

1. Cant get the animation to work in game but it works in Buldozer.

2. I managed to fix the damage and rvmat issue to make it solid but now when you shoot the addon it hard crashes back to the desktop lol (i only have O:A - destruction effect conflict?)

3. How to make the damage smoke effects smaller.

4. if your feeling generous how to attach a sound to the animation but i don't mind having a shot at that myself before asking here.

From what i can tell i've ironed out the O2 side of business and the Stringtable.csv is correct. Appreciate the help chaps, top quality community.

FPDR Carver

model.cfg

//The Class "CfgSkeletons" defines all moving objects.

class CfgSkeletons {
//Always create class "default" first.
//Your actual config-entry should be a derivate of this.
class Default {
	isDiscrete = 1;
	skeletonInherit = "";
	skeletonBones[] = {};
};
//the derivate of your skeleton from claa "Default".
class HDS_obj_skeleton : Default {
	isDiscrete=1;
	skeletonInherit="";

	// The moving objects are here defined
	// If two selections are linked together
	// they can be written next to each seperated by only a comma
	// if they are not linked, they need to be
	// seperated by  ,"", 
	skeletonBones[]= {
		"Door",""
	};
	// The last entry gets no comma
};
};


// This class defines the actual moves
class CfgModels {
//load some bases from which you can derivate
class rotation;
// And again: class default
class Default {
sectionsInherit="";
sections[]={};
skeleton="";

class Animations {};
};

// Your own "class default"
class HDS_obj {
sectionsInherit="";
sections[]= {};

skeletonName="HDS_obj_skeleton";	// same as in cfgskeletons
};  

// The name behind the class 
// dhas to be the exact name of your .p3d
// without .p3d
class HDS_Door_3x3m : HDS_obj {
	sectionsInherit="HDS_obj";
	sections[]={};

	// the rotation animation
	class Animations {
		class Open_door : Rotation { // name of the animation


		type="rotation"; 	// Type of movement

		source="user"; // Trigger of the animation

		selection="Door"; // the thing that moves

		axis="Door_Achse"; // take a guess what this does...

		memory = 1; // can the axis be found in memory-lod? 1 = yes, 0 = no

		angle0=0; // initial angle of the door in radians

		angle1=-1.6; // final position after playing the animation
		};
	};
};
};

Config.ccp

/* Declaration as Addon-Content.*/
class CfgPatches 		{
/* "Hey ArmA2, this is an addon and it's named "HDS_Gate"*/
/* The name should be indentical to the folder's name*/
class HDS_Gate	{
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {};
};
};

/* The category in the editor like "Objects" or "Cars".*/
class CfgVehicleClasses {

class HDS_GateVehicleClass {
	displayName = "HDS Gate";
};
};

/* This is where arma gets the information about a new object. */
/* Donät be confused by the "vehicles" in CfgVehicles*/
class CfgVehicles {
/* everything between here and "Class Land_ ..." is important for the animation to work properly without any "lags". */

class All;

class HouseBase;

class Ruins: HouseBase {};

/* Again your very own basic definition*/
class HDS_Base_Object : All {
	scope = 0;
	side = 3;
	icon = "iconStaticObject";
	nameSound = "object";
	simulation = "house";
	picture = "pictureStaticObject";
	model="";
	sound = "Building";
	placement = "vertical";
	ladders[] = {};
	vehicleClass =  "";
	displayName = "";
	coefInside = 1;
	coefInsideHeur = 0.25;
	mapSize = 7.5;
	animated = true;
	armor = 200;
	destrType = "DestructBuilding";
	damageResistance = 0.004;

	class DestructionEffects {
		class Sound {
			simulation = "sound";
			type = "DestrHouse";
			position = "destructionEffect1";
			intensity = 0.1;
			interval = 1;
			lifeTime = 0.05;
		};

		class DestroyPhase1 {
			simulation = "destroy";
			type = "DelayedDestruction";
			lifeTime = 2.5;
			position = "";
			intensity = 0.1;
			interval = 1;
		};

		class DamageAround1 {
			simulation = "damageAround";
			type = "DamageAroundHouse";
			position = "";
			intensity = 0.1;
			interval = 1;
			lifeTime = 1;
		};
	};
};

/* Your very own base class for buildings*/
class HDS_Housebase : HDS_Base_Object {
	scope = 1;
	model = "";
	icon = "";
	displayName = "";
	animated = true;
	vehicleClass = "HDS_GateVehicleClass";
	nameSound = "house";
	accuracy = 0.2;
	typicalCargo[] = {};
	transportAmmo = 0;
	transportRepair = 0;
	transportFuel = 0;
	mapSize = 11;
	cost = 0;
	armor = 800;
	/*extern*/ class DestructionEffects;
};
/* Everything between here and "Class All" (above)  is important for the animation to work without any "lags". */
/* The "Land_" infront of all buildings is important for the destructioneffects to work properly. After the "Land_" the name of the .p3d (without the .p3d ending) has to follow!*/

class Land_HDS_Gate_3x3m: HDS_Housebase {
	model = "\HDS_Gate\HDS_Gate_3x3m.p3d";	/* path to the object */
	displayName =  "$STR_HDS_Gate"; 	/* entry in Stringtable.csv */
										/* Important are the $ and the capital STR_*/
	nameSound = "";						
	mapSize = 4;						/* Size of the icon */
	icon = "iconStaticObject";			/* Path to the picture shown in the editor. */
       accuracy = 1000;   
	armor = 450;						/* "Lifepoints", if you like to call it that way.*/
	destrType = "DestructBuilding";		/* type of destruction, when armor = 0 */
	scope = 2;							/* Display it in the editor? 1 = No, 2 = Yes */
	class DestructionEffects : DestructionEffects
	{

		class Ruin1
		{
		simulation = "ruin";
		type = "\HDS_Gate\HDS_Gate_3x3m_Ruin"; /* path to the object*/
			/* Warning, if you use a custom rubble model, it has to be defined in the cfgvehicles (see below)*/
		position = "";
		intensity = 1;
		interval = 1;
		lifeTime = 1;
		};
	};
};

/*  Same name as stated in the Class DestructionEffects, but an "Land_" added infront*/
class Land_HDS_Gate_3x3m_Ruin : ruins	{
	scope = 1;
	model = "\HDS_Gate\HDS_Gate_3x3m_Ruin.p3d";
	displayName = "Gate ruins";
};

/* Your doorsegment is derivated from the normal Gate.*/
class Land_HDS_Tur_3x3m: Land_HDS_Gate_3x3m {
	model = "\HDS_Gate\HDS_Tur_3x3m.p3d";
	displayName =  "$STR_HDS_Tur";

	/* Arma needs to know, how the animation trigger is triggered*/
	class AnimationSources {
			/* name must be identical to the one given by the model.cfg ("Open_Door")" */
		class Open_door {
			source = "user";
			animPeriod = 4; /* duration in seconds */
			initPhase = 0; 
		};
	};

	/* The entry to the actionmenu */
	class UserActions
	{			
		class Open_door
		{
			displayName="$STR_HDS_OpenDoor";
			onlyforplayer = true;
			position="Door_knopf";
			radius=3; /* visibility distance of the entry */
			condition="this animationPhase ""Open_door"" < 0.5";
			statement="this animate [""Open_door"", 1]";
		};
		class Close_door : Open_door
		{
			displayName="$STR_HDS_CloseDoor";
			condition="this animationPhase ""Open_door"" >= 0.5";
			statement="this animate [""Open_door"", 0]";
		};
	};
};
};

:weakest:

Share this post


Link to post
Share on other sites

does the action "open door" appears? if not maybe you forgot to add Door_knopf piont in memory lod of your model

Share this post


Link to post
Share on other sites

I've got it set to "Open Gate" in the string table (see below) and it does appear. Ive just double checked the memory lod and its all there the Door_Achse, Door_Knoph and Door :)

LANGUAGE,English

STR_HDS_Tur,"Gate (3m) Openable"
STR_HDS_Wall,"Gate (3m)"
STR_HDS_OpenDoor,"Open Gate"
STR_HDS_CloseDoor,"Close Gate"

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  

×