Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → complicated reloads for glock
complicated reloads for glock
2001-09-02, 8:29 AM #1
fire:
// Check that the player is still alive.
if(GetThingHealth(player) <= 0)
{
Return;
}

// Check Ammo - If we are out, autoselect best weapon.
if(GetInv(player, 12) < 1.0)
{
PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
if(GetAutoSwitch() & 1)
SelectWeapon(player, AutoSelectWeapon(player, 1));
Return;
}

SetPOVShake('0.0 -.03 0.0', '4.0 0.0 0.0', .05, 80.0);
if(mode == 0)
{
dummy = FireProjectile(player, projectile, fireSound2, 18, '0.02 0.15 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimMaxDist);
dummy = FireProjectile(player, bulletshell, fireSound0, 18, '-0.0325 0.075 0.015', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimMaxDist);
ChangeInv(player, 12, -1.0);

jkPlayPOVKey(player, povfireAnim, 1, 0x38);

SetMaterialCel(glockflash, 1);
sleep(0.01);
SetMaterialCel(glockflash, 2);
sleep(0.01);
SetMaterialCel(glockflash, 3);
sleep(0.01);
SetMaterialCel(glockflash, 0);


powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait2/powerBoost);
bulletnumber = bulletnumber+1; //everytime you fire, this will count up one

}
else
{
dummy = FireProjectile(player, projectile, fireSound, 18, '0.02 0.15 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimMaxDist);
dummy = FireProjectile(player, bulletshell, fireSound0, 18, '-0.0325 0.075 0.015', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimMaxDist);
ChangeInv(player, 12, -1.0);

powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait/powerBoost);
bulletnumber = bulletnumber+1; //everytime you fire, this will count up one
jkPlayPOVKey(player, povfireAnim, 1, 0x38);


}


// Provide a kick backwards
ApplyForce(player, VectorScale(GetThingLVec(player), -30));
if(bulletnumber==17) //we've gotten up to 17
{
jkPlayPOVKey( player, reachforclipAnim, 1, 0x38 );
PlaySoundThing(reachclipSound, player, 1.0, -1, -1, 0x80);
SetFireWait(player, GetKeyLen(reachforclipAnim));

##The left hand reaches for the clip on the glock
#
# jkPlayPOVKey( player, clipoutinAnim, 1, 0x38 );
#PlaySoundThing(clipoutinSound, player, 1.0, -1, -1, 0x80);
#SetFireWait(player, GetKeyLen(clipoutinAnim));
#
#The clip comes out and a new clip is placed in the gun
#
# jkPlayPOVKey( player, handreachAnim, 1, 0x38 );
#PlaySoundThing(reachclipSound, player, 1.0, -1, -1, 0x80);
#SetFireWait(player, GetKeyLen(handreachAnim));
#
#The left hand grabs the glock cover
#
# jkPlayPOVKey( player, glkcoverAnim, 1, 0x38 );
#PlaySoundThing(glkcoverSound, player, 1.0, -1, -1, 0x80);
#SetFireWait(player, GetKeyLen(glkcoverAnim));
#
##The left hand reloads the internal mechanism
#
# jkPlayPOVKey( player, readytogoAnim, 1, 0x38 );
#PlaySoundThing(readytogoSound, player, 1.0, -1, -1, 0x80);
#SetFireWait(player, GetKeyLen(readytogoAnim));

bulletcunt=0; //reset your counter variable for the next go round
}


Return;

imagine all the #'s are removed, why would this cog allow me to play only the first keyframe???
Code:
if(getThingFlags(source) & 0x8){
  do her}
elseif(getThingFlags(source) & 0x4){
  do other babe}
else{
  do a dude}
2001-09-02, 10:04 PM #2
SetFireWait doesn't affect key animations, but when the weapon will be "shotable" again. Try with Sleep(value); (am I right? Just a newbie here) or have a unique key.
"May the SourceCode be with you..."
Nemios, MOD developer.

↑ Up to the top!