Jump to content
Sign in to follow this  
blckeagls

Help with destroying windows

Recommended Posts

Hello, I am a veteran scripter, but a novice modeler. I am having an issue with a wall I created. There is a window in it. I want the window to get destroyed when shot. Is there a way to do this?

I tried setting hitpoints. Here is my model.cfg and my config.cpp:

class cfgModels
{
class TargetGrenade{};
class GreyBrickWallWithWindow: TargetGrenade
{
	sectionsInherit="TargetGrenade";
	sections[]=
	{
		"Glass"
	};
	skeletonName = "GreyBrickWallWithWindow";
};
};

class CfgSkeletons 
{ 
  class TargetGrenade; //Define base class.

  class GreyBrickWallWithWindow: TargetGrenade
  {
     skeletonInherit = "TargetGrenade"; //Inherit all bones from class Car.
     skeletonBones[] =        //Add two new bones. The movement
     {                        //of bone2 is linked to bone1.
        "Glass",""
     };
     pivotsModel = ""; // Location of pivot points (local axes) for hierarchical animation. (A2 only)
     isDiscrete = 1; /// 1 stands for discrete skinning values (0 or 100 % for each vertex of every selection), 0 stands for non-discrete (each vertex may have different skinning values for selections - animations have just partial effect on that vertex)
  };
};

class CfgPatches
{
class GreyBrickWallWithWindow
{
	units[] = {greybrickwallWithWindow};
	weapons[] = {};
	requiredVersion = 1.0;
};
};
class CfgVehicles
{
class All {};
class Static: All {};
class Building: Static {};
class NonStrategic: Building {};
class TargetTraining: NonStrategic {};
class TargetGrenade: TargetTraining {};

class GreyBrickWallWithWindow: TargetGrenade 
{
	model="\GreyBrickWallWithWindow\greybrickwallWithWindow.p3d";
	armor=8000;
	scope=2;
	displayName="Grey Brick Wall with Window";
	class hitZone_0 {
		armor = 1; 
		material = 55; 
		name = "Glass"; 
		visual = "Glass"; 
		passThrough = 1; 
		hideOnDestroyed = true; 
		visualStateChange[] = {0.1,0.5}; 
	};
};
};

Share this post


Link to post
Share on other sites

Do you have a hitpoint in your model? Check out the A3 tank or building sample, it has a hitpoints LOD. Every Point in this LOD has the hitpoint property you set with the hitclass.

You might want to add this to your hitpoint:

		class Hitzone {
			passThrough=0;
			minimalHit = 0.1;
			explosionShielding = 0.1;
			radius = 0.25;
		};

Radius (unit in meter) is very important, it defines how closely you have to set the points together in the model. If you use arma3diag.exe from devbranch, there is a command to show the hitpoints on models ingame.

Dont forget to check the A3 sample building config (uses macros to define all glass hitpoints), alternatively use the A3 configviewer to check out the ingame config of existing buildings

Edited by Fennek

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  

×