Decided to try and make it possible to change the animation of a weapon through attachments. ( This would probably be mostly used for foregrips and magazines. Unfortunately this won't work for both at the same time. )
Built in support for the following mods:
* M1911 Attachments Pack
If anybody wants built-in support for any other attachment packs feel free to leave a comment asking.
Preview:
Known Bugs:
- Sometimes hand clips slightly into the weapon model. ( This is due to the fact that we can only use existing animations. So this can't be fixed until we figure out custom animations. )
- Empty reloads sometimes look a bit weird. ( This is due to the fact that sometimes a reload animation from one type of gun doesn't map 100% to another gun. Probably not going to fix unless I can be really bothered as it isn't too noticeable. )
Plans:
- Try and implement some kind of smoothing between the idle animation and the reload animation so that we can have different reload animations without the weird jump between weapon positions.
FOR MOD DEVS:
To add this to your own mod all you need to do is give the attachments the following values:
<PartTweakData>.weapon_reload_override = {
<WeaponName> = "<InternalWeaponAnimationName>"
}
<PartTweakData>.weapon_hold_override = {
<WeaponName> = "<InternalWeaponAnimationName>"
}
<PartTweakData>.weapon_stance_override = {
<WeaponName> = "<InternalWeaponStanceName>"
}
e.g.
Hooks:PostHook( WeaponFactoryTweakData, "init", "AttachmentAnimationsTweakData", function(self)
if self.parts.wpn_fps_pis_m1911_fg_tommy then
self.parts.wpn_fps_pis_m1911_fg_tommy.weapon_hold_override = {
bm_w_colt_1911 = "cobray"
}
self.parts.wpn_fps_pis_m1911_fg_tommy.weapon_reload_override = {
bm_w_colt_1911 = "cobray"
}
end
end )
TIMER MULTIPLIERS AND ADDERS:
Sometimes your animation isn't quite right which is why I have added the ability to multiply and add to the weapons timers without changing the reload animation speed.
<PartTweakData>.timer_multiplier = {
<TimerName> = "<TimeMultiplier>"
}
<PartTweakData>.timer_adder = {
<TimerName> = "<TimeAdder>"
}
e.g.
Hooks:PostHook( WeaponFactoryTweakData, "init", "AttachmentAnimationsTweakData", function(self)
if self.parts.wpn_fps_pis_m1911_fg_tommy then
self.parts.wpn_fps_pis_m1911_fg_tommy.timer_multiplier = {
reload_empty = 20,
reload_not_empty = 20
}
self.parts.wpn_fps_pis_m1911_fg_tommy.timer_adder = {
reload_empty = -0.5,
reload_not_empty = -0.5
}
end
end )
BEARDLIB XML TEMPLATE EXAMPLE THING
<WeaponMod (WeaponModStuff) >
<weapon_reload_override (WeaponName)=(InternalWeaponAnimationName) (weapon_name2)=(InternalWeaponAnimationName2) ... />
<weapon_hold_override (WeaponName)=(InternalWeaponAnimationName) (weapon_name2)=(InternalWeaponAnimationName2) ... />
<weapon_stance_override (WeaponName)=(InternalWeaponStanceName) (weapon_name2)=(InternalWeaponStanceName2) ... />
<timer_multiplier (TimerName)=(TimeMultiplier) (TimerName2)=(TimeMultiplier2) ... >
<timer_adder (TimerName)=(TimeAdder) (TimerName2)=(TimeAdder2) ... >
</WeaponMod>