You'll need:
- each tooth in a different vertex group, you may get away with grouping them by axis, but untested so far;
- duplicate all of your teeth into a new object, delete the newly created vertex groups and assign all of the teeth into a new one, call it
teeth
- This new mesh will be static teeth displayed when the chainsword is holstered or not being used (on the ground, for example); - depending on your model, multiple axes in your Memory LOD. One axis for one direction of travel. Try to simplify your movements, it doesn't need to be perfect to give the illusion that the chainsword is actually "activated".
#define CHAIN_TOOTH_MOVE(x, y) \
class Tooth_##x { \
type = translationY; \
source = time; \
sourceAddress = loop; \
selection = tooth##x; \
axis = y; \
memory = 1; \
minValue = 0; \
maxValue = 0.03; \
offset0 = 0; \
offset1 = 0; \
}
#define CHAIN_TOOTH_MOVE_2(x, y) \
class Tooth_2_##x { \
type = translationX; \
source = time; \
sourceAddress = loop; \
selection = tooth##x; \
axis = y; \
memory = 1; \
minValue = 0; \
maxValue = 0.03; \
offset0 = 0; \
offset1 = 0; \
}
#define CHAIN_TOOTH_HIDE(x) \
class Tooth_Hide_##x { \
type = hide; \
source = isSelected; \
sourceAddress = clamp; \
selection = tooth##x; \
minValue = 0; \
maxValue = 1; \
hideValue = 0; \
unhideValue = 1; \
}
#define CHAIN_TOOTH_HIDE_STATIC \
class Teeth_Hide { \
type = hide; \
source = isSelected; \
sourceAddress = clamp; \
selection = teeth; \
minValue = 0; \
maxValue = 1; \
hideValue = 1; \
unhideValue = 1.1; \
}
These go at the top of your model.cfg file.
CHAIN_TOOTH_MOVE
and CHAIN_TOOTH_MOVE_2
- Will just move each tooth back and forth on their respective axes (Y, X). The amount it will move is at your discretion, play around with the maxValue
;
CHAIN_TOOTH_HIDE
:
- weapon
isSelected = 1
(unholstered), unhides; - weapon
isSelected = 0
(holstered), hidesCHAIN_TOOTH_HIDE_STATIC
: - weapon
isSelected = 1
(unholstered), hides; - weapon
isSelected = 0
(holstered), unhides
In summary, the static and (always) moving mesh will be toggled on and off depending if the player is holding the chainsword or not on its hands. Refer to this page for more information.
Example with 3 teeth moving:
// Macros go here
class CfgSkeletons {
class chainsword_SK {
pivotsModel = "";
isDiscrete = 0;
skeletonInherit = "";
skeletonBones[] = {
"tooth1", "",
"tooth2", "",
"tooth3", ""};
};
};
class CfgModels {
class Default {
sectionsInherit = "";
sections[] = {};
skeletonName = "";
};
class chainsword: Default {
sections[] = {"your_camo_vertex_groups"};
skeletonName = "chainsword_SK";
class Animations {
CHAIN_TOOTH_MOVE(1, "your_axis");
CHAIN_TOOTH_MOVE(2, "your_axis");
CHAIN_TOOTH_MOVE(3, "your_axis");
CHAIN_TOOTH_HIDE(1);
CHAIN_TOOTH_HIDE(2);
CHAIN_TOOTH_HIDE(3);
CHAIN_TOOTH_HIDE_STATIC;
};
};
};