I need help with my client cog for the concrifle. I already put the info in the items.dat file so thats not the problem.
This is the client cog.
This is the fire area in the weap_concrifle.cog file.
I've been trying to figure out for a few hours now why when I test it nothing comes out of the concrifle.
Any and all help is Extremely Appreciated.
This is the client cog.
Code:
flags=0x404 symbols flex autoAimFOV=30 local flex autoAimMaxDist=5 local template projectile=+concbullet local template projectile3=+concblast2 local message trigger end #============================================== code trigger: if(GetSourceRef() == 90) { FireProjectile(player, projectile, fireSound, 18, '0.02 0.15 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimMaxDist); } else if(GetSourceRef() == 91) { FireProjectile(player, projectile3, fireSound, 18, '0.0 0.0 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimMaxDist); } return; end
This is the fire area in the weap_concrifle.cog file.
Code:
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) < 8.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); //Take away the FireProjectile command, take it to the client cog and replacing it with triggering. ID = GetCurWeapon(player) * 10 + GetSenderRef(); SendTrigger(-1, ID, player, 0, 0, 0); //keys should be left here, or somehow broadcasing will make it play more than twice... from the 4th parameter of FireProjectile. PlayMode(player, 8); //Sounds should be left here, or somehow broadcasing will make it play more than twice... from the 3rd parameter of FireProjectile. PlaySoundThing(fireSound, player, 1, -1, -1, 0x80); jkPlayPOVKey(player, povfireAnim, 1, 0x38); // Provide a kick backwards ApplyForce(player, VectorScale(GetThingLVec(player), -80)); powerBoost = GetInv(player, 63); ChangeFireRate(player, fireWait/powerBoost); Return;
I've been trying to figure out for a few hours now why when I test it nothing comes out of the concrifle.
Any and all help is Extremely Appreciated.
"It's best to keep your mouth shut and look like an idiot than to open it and prove it"
- Robert Fletcher
- Robert Fletcher