Author Topic: Playthread Animation on Reload?  (Read 671 times)

I started doing modelling and scripting some time ago, and I'm really close to finishing my weapon.
My goal is to make the player do a "shiftright" animation (the one when the player shifts a brick to the right, if that's not the name) when on the Reload state. How do I do this?
« Last Edit: November 09, 2008, 05:58:09 AM by E_net4 »

I figure adding something like this will be what you need to do

Code: [Select]
function WEAPONImage::onNAME_OF_IMAGE_STATE(%this,%obj,%slot)
{
if(%obj.getDamagePercent() < 1.0)
%obj.playThread(2, animationName);
Parent::onNAME_OF_IMAGE_STATE(%this,%obj,%slot);
}


You will need a stateScript[#] = "onReload"; line in your weapon image (change # to the reload state) to make it trigger that function. See the "fire" state where it uses onFire, etc.