TeRp/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (removed cfgAmmo. it's an own page now.)
mNo edit summary
Line 1: Line 1:
[[Category:Sandbox]]
==Introduction==
To animate a model, you have to make use of both, the ''cfgModels'' and ''cfgSkeletons'' class.
 
The ''cfgSkeletons'' class defines the bones of a vehicle. Bones are, more or less, the <u>animated selections</u> of a model.
 
The ''cfgModels'' class is an extended version of the OFP cfgModels class. It defines the selections of a model which you want to animate or use with the setObjectTexture command, but since ArmA, you have to put everything related to animate your model in here.
 
==cfgSkeletons==
The ''cfgSkeletons'' class defines, as mentioned before, the bones (<nowiki>=</nowiki> animated selections) of a vehicle.
 
Each skeleton is a subclass within the cfgSkeletons class, consisting of three parameters:
 
{|width="80%"
!width="50%"|Parameter
!width="50%"|Description
|-
|'''isDiscrete'''
|currently unknown, set to 1.
|-
|'''skeletonInherit'''
|inherit bones from given class.
|-
|'''skeletonBones[]'''
|define your own bones here.
|-
|}
 
===Defining a bone===
Bones are defined in the skeletonBones[]-array which is made of a list of unsorted bones. Each bone is the name of a selection you want to animate.
 
====A single bone====
A bone is defined by using two strings:
:"bone",""
You may define multiple bones by strining them togeter.
 
=====Example=====
<pre>skeletonBones[]=
{
"bone1","", //defines bone1
"bone2",""  //defines bone2
};</pre>
 
====Linked bones====
The second argument (empty in the example above) is used for linking two bones:<br>
:"bone1","bone2"
 
Linking is used to make the animation of "bone1" depending on the movement of "bone2". If you e.g. have a turret, you have to make use of linking here, because the up and down movement of the turrets weapon is typically influenced by left and right movement of the turret:
 
=====Example=====
<pre>skeletonBones[]=
{
"turret_x","",        //defines bone turret_x
"turret_y","turret_x"  //defines bone turret_y and makes it linked to bone turret_x
};</pre>
 
'''Attention:'''<br>
You can not link more than two bones in a row!<br>
If you do something like
<pre> "bone1","bone2","bone3"</pre>
this will result in an error, as Armed Assault interprets this as
*defining "bone1" which is linked to "bone2"
*defining "bone3", ''which misses the second argument.''
 
However, it should be possible to use a syntax like this (not tested yet):
<pre>skeletonBones[]=
{
"bone1","bone2", //defines bone "bone1" and makes it linked to "bone2"
"bone2","bone3", //defines bone "bone2" and makes it linked to "bone3"
"bone3",""      //defines bone "bone3".
};</pre>
 
In conclusion, "bone1" is linked to "bone2", which is linked to "bone3".<br>
So "bone1" should be depending on the movement of both, "bone2" and "bone3".
 
===cfgSkeletons Example===
<pre>class BWMod_Tiger_Skeleton
{
isDiscrete=1;
 
skeletonInherit="";
skeletonBones[]=
{
"mainRotor","",
"tailRotor","",
 
"turret_RMK_x","",
"turret_RMK_y","turret_RMK_x",
};
};</pre>
 
==cfgModels==
The cfgModels class is used

Revision as of 17:15, 20 January 2007

Introduction

To animate a model, you have to make use of both, the cfgModels and cfgSkeletons class.

The cfgSkeletons class defines the bones of a vehicle. Bones are, more or less, the animated selections of a model.

The cfgModels class is an extended version of the OFP cfgModels class. It defines the selections of a model which you want to animate or use with the setObjectTexture command, but since ArmA, you have to put everything related to animate your model in here.

cfgSkeletons

The cfgSkeletons class defines, as mentioned before, the bones (= animated selections) of a vehicle.

Each skeleton is a subclass within the cfgSkeletons class, consisting of three parameters:

Parameter Description
isDiscrete currently unknown, set to 1.
skeletonInherit inherit bones from given class.
skeletonBones[] define your own bones here.

Defining a bone

Bones are defined in the skeletonBones[]-array which is made of a list of unsorted bones. Each bone is the name of a selection you want to animate.

A single bone

A bone is defined by using two strings:

"bone",""

You may define multiple bones by strining them togeter.

Example
skeletonBones[]=
{
	"bone1","", //defines bone1
	"bone2",""  //defines bone2
};

Linked bones

The second argument (empty in the example above) is used for linking two bones:

"bone1","bone2"

Linking is used to make the animation of "bone1" depending on the movement of "bone2". If you e.g. have a turret, you have to make use of linking here, because the up and down movement of the turrets weapon is typically influenced by left and right movement of the turret:

Example
skeletonBones[]=
{
	"turret_x","",         //defines bone turret_x
	"turret_y","turret_x"  //defines bone turret_y and makes it linked to bone turret_x
};

Attention:
You can not link more than two bones in a row!
If you do something like

	"bone1","bone2","bone3"

this will result in an error, as Armed Assault interprets this as

  • defining "bone1" which is linked to "bone2"
  • defining "bone3", which misses the second argument.

However, it should be possible to use a syntax like this (not tested yet):

skeletonBones[]=
{
	"bone1","bone2", //defines bone "bone1" and makes it linked to "bone2"
	"bone2","bone3", //defines bone "bone2" and makes it linked to "bone3"
	"bone3",""       //defines bone "bone3".
};

In conclusion, "bone1" is linked to "bone2", which is linked to "bone3".
So "bone1" should be depending on the movement of both, "bone2" and "bone3".

cfgSkeletons Example

class BWMod_Tiger_Skeleton
{
	isDiscrete=1;

	skeletonInherit="";
	skeletonBones[]=
	{
		"mainRotor","",
		"tailRotor","",

		"turret_RMK_x","",
		"turret_RMK_y","turret_RMK_x",
	};
};

cfgModels

The cfgModels class is used