Building Land Classes: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Removed unhelpful information)
m (Text replacement - "<tt>([^ ]*=[^ ]*)<\/tt>" to "{{hl|c= $1}}")
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Destroyed Buildings that used the DestructEngine type will vaporise (dissappear) unless a rubble model is associated with them.
The building ruins system introduced in {{arma1}} is quite different from the one in {{ofp}}.
In {{ofp}}, a destroyed building saw its vertices moved, twisting its 3D model as well as its collision LOD - making this a very cheap but improvable system.


In OFP we had a rather nice rendition of the bulding after destruction, that, in itself, was useful, visual, and usable for some missions (The Award winning Abandoned Armies eg).
In {{arma1}}, the original building moves under the terrain to simulate collapsing; the damage also changes from 1 back to 0.<br>
Destroyed Buildings that used the DestructEngine type will vaporise (dissappear) unless a ruins model is associated with them.


In Arma, we have an un-asked for, but rather clever piece of rubble at best, or nothing at all, at worst.
{{Feature|important|The class needs to be called {{hl|Land_''xxx''}} for ruins to work.}}
{{Feature|arma1|The class needs to be called {{hl|Land_''xxx''}} for building animations to work in {{arma1}}; this is not true for later titles. See the ''How to ensure doors are working'' for more information.}}


To further confuse matters BIS choose to call this class stuff 'ruins'. Rubble would be more appropriate, since there are also genuine ruins in the game. (Helfenburks eg). But one thing you can count on is that bis have never cared about compatibilty with anything previous. The code below avoids the use of the word ruin where possible.
The old, simple {{ofp}} format:
<syntaxhighlight lang="cpp">
class CfgVehicles
{
class House;
class MyHouse : House
{
/* ... */
};
};
</syntaxhighlight>


Worse, a building that is replaced by rubble comes alive again. It's damage is no longer one. Making target scripting moot.
The new, advanced format:
<syntaxhighlight lang="cpp">
class CfgVehicles
{
class Ruins; // required for the ruin model
class NonStrategic;
class House : NonStrategic
{
class DestructionEffects; // re-declaration is needed
};


To further complicate the issue, any building that needs a ruin replacement (what doesn't?) must be called a Land_xyz class. Why this should be can only depend on what you're smoking at the time.
class Land_MyRuinedHouseModel : Ruins // note the Land_ prefix
{
scope = 1; // protected scope - not shown in editor
displayname = "My House Ruins";
model = \some\ruinedBuilding\MyRuinedHouseModel; // .p3d extension is optional - note that the Land_ prefix is not required
};
class Land_MyHouse : House // note the Land_ prefix
{
/* ... */
class DestructionEffects : DestructionEffects
{
class Ruin1
{
simulation = "ruin";
type= \some\path\MyRuinedHouseModel; // .p3d extension is optional - note that the Land_ prefix is not required
position = "";
intensity = 1;
interval = 1;
lifeTime = 1;
};
};
};
};
</syntaxhighlight>


'''Even worse''', building animations did not work in arma one without a Land class. Mercifully, this seems to have been fixed (probably by sheer oversight)


And so...:
== How to ensure doors are working ==


standard building declaration that no longer works (if you want to see anything after destruction)
In order to make sure animated doors are working when the building is baked into the map as well as when the building is placed in the editor the building class '''must''' be named as follows:
{{hl|class '''Land_'''{{Color|darkorange|p3dName}}}} and {{hl|c= model = {{Color|darkorange|p3dName}};}}


class CfgVehicles
<syntaxhighlight lang="cpp">
{
class house_f; // almost always
  class House;
class land_my_great_building : house_f
  class MyHouse:House {...........};
{
model = "\some\location\my_great_building.p3d";
// the rest does not matter
};
</syntaxhighlight>
{{Feature|informative|Note that land classes can be had for other p3d class 'types', and they are optional. But if the unique and very special properties of {{hl|c= class{{=}}house}} is needed, a land_xx '''must''' go with it.}}


Shiny new idiocy
And for these animations to happen at all either in the in-game editor or otherwise, the p3d has to have it is geolod property set to {{hl|c= class=house}} as a minimum. There are other, less used, animation class types, such as {{hl|housesimulated}} and {{hl|fuelstation}} but using {{hl|c= class=house}} is the basic, safest way to have doors to open.


class CfgVehicles
{
  class Ruins; // required for the ruin model
  class NonStrategic;
  class House: NonStrategic {class DestructionEffects; }; // ie a completely stupid re-declaration of what should not have to be known.
                                                          // the extern declarations were supposed to remove this sillyness but BIS as usual broke their own rules
                                                          // then changed the rules to suit, and finally forgot what they were.
  class '''Land_'''MyRuinedHouseModel:Ruins
  {
    scope=protected;                                      // yes folks, even tho this model might only be local in scope
                                                          // the engine can't find it
    displayname=Rubble;                                  // at least call it something sensible when it shows
    model = \some\rubble\'''MyRuinedHouseModel'''[.p3d];
  };
  class '''Land_'''MyHouse: House
  {
      ... usual stuff followed by ...
  class DestructionEffects: DestructionEffects
  {
      class Ruin1
      {
        simulation = "ruin";                                      // bis broke most of their simulations. but this one works
        type= \some\rubble\'''MyRuinedHouseModel'''[.p3d];            // don't even try and work out how the engine prepends land_
                                                                  // to get at the class. But, you can start crying in frustration
                                                                  // about now and go back and play ofp. It remains a superior game.
        position = "";
        intensity = 1;
        interval = 1;
        lifeTime = 1;
      };
    };
  };


[[Category:ArmA: Addon Configuration]]
A land_xx trigger list of all objects used on the map that *need* land classes to operate correctly is automatically baked into that wrp by [[pboProject]]. (Geolod {{hl|c= class=house}} is the prime candidate, but there are other much less used class= types of which [[pboProject]] also takes care.)
[[Category:ArmA: Terrain Editing]]
 
If doors still will not open, then you do not have that {{hl|Land_xx}} class in any {{hl|config.bin/CfgVehicles}} in the game. Under those circumstances, it is up to you to create one.
 
 
{{GameCategory|arma1|Addon Configuration}}
{{GameCategory|arma1|Terrain Editing}}

Latest revision as of 01:23, 16 November 2021

The building ruins system introduced in Armed Assault is quite different from the one in Operation Flashpoint. In Operation Flashpoint, a destroyed building saw its vertices moved, twisting its 3D model as well as its collision LOD - making this a very cheap but improvable system.

In Armed Assault, the original building moves under the terrain to simulate collapsing; the damage also changes from 1 back to 0.
Destroyed Buildings that used the DestructEngine type will vaporise (dissappear) unless a ruins model is associated with them.

The class needs to be called Land_xxx for ruins to work.
Armed Assault
The class needs to be called Land_xxx for building animations to work in Armed Assault; this is not true for later titles. See the How to ensure doors are working for more information.

The old, simple Operation Flashpoint format:

class CfgVehicles
{
	class House;
	class MyHouse : House
	{
		/* ... */
	};
};

The new, advanced format:

class CfgVehicles
{
	class Ruins; // required for the ruin model
	class NonStrategic;
	class House : NonStrategic
	{
		class DestructionEffects; // re-declaration is needed
	};

	class Land_MyRuinedHouseModel : Ruins	// note the Land_ prefix
	{
		scope = 1;	// protected scope - not shown in editor
		displayname = "My House Ruins";
		model = \some\ruinedBuilding\MyRuinedHouseModel;	// .p3d extension is optional - note that the Land_ prefix is not required
	};
	class Land_MyHouse : House	// note the Land_ prefix
	{
		/* ... */
		class DestructionEffects : DestructionEffects
		{
			class Ruin1
			{
				simulation = "ruin";
				type= \some\path\MyRuinedHouseModel;		// .p3d extension is optional - note that the Land_ prefix is not required
				position = "";
				intensity = 1;
				interval = 1;
				lifeTime = 1;
			};
		};
	};
};


How to ensure doors are working

In order to make sure animated doors are working when the building is baked into the map as well as when the building is placed in the editor the building class must be named as follows: class Land_p3dName and model = p3dName;

class house_f;	// almost always 
class land_my_great_building : house_f
{
	model = "\some\location\my_great_building.p3d";
	// the rest does not matter
};
Note that land classes can be had for other p3d class 'types', and they are optional. But if the unique and very special properties of class=house is needed, a land_xx must go with it.

And for these animations to happen at all either in the in-game editor or otherwise, the p3d has to have it is geolod property set to class=house as a minimum. There are other, less used, animation class types, such as housesimulated and fuelstation but using class=house is the basic, safest way to have doors to open.


A land_xx trigger list of all objects used on the map that *need* land classes to operate correctly is automatically baked into that wrp by pboProject. (Geolod class=house is the prime candidate, but there are other much less used class= types of which pboProject also takes care.)

If doors still will not open, then you do not have that Land_xx class in any config.bin/CfgVehicles in the game. Under those circumstances, it is up to you to create one.