Tremulous Forum

Mods => Modding Center => Topic started by: rotacak on October 28, 2009, 12:43:19 am

Title: New secondary attack is invisible
Post by: rotacak on October 28, 2009, 12:43:19 am
Hi, I added secondary attack to pulse rifle and when I shoot I saw no bullets and hear no sound. But bullets are really there, I can destroy structures etc. with invisible bullets.

If I will change in g_active.c this:
Code: [Select]
      case EV_FIRE_WEAPON:
        FireWeapon( ent );
        break;

      case EV_FIRE_WEAPON2:
        FireWeapon2( ent );
        break;

to this:

Code: [Select]
      case EV_FIRE_WEAPON:
        FireWeapon( ent );
        break;

      case EV_FIRE_WEAPON2:
        FireWeapon( ent );
        break;

then first and second attack should be same, but second is invisible and without sound. Why?
Title: Re: New secondary attack is invisible
Post by: gimhael on October 28, 2009, 12:58:11 pm
The "special effects" are generated on the client side, and the client checks the weaponMode, which is still WPM_SECONDARY even if you call FireWeapon() instead of FireWeapon2().

I think a working dirty fix is to add "m->s.generic1 = WPM_PRIMARY;" at the end of pulseRifleFire().

The proper way would be to alter the weapon.cfg of the pulse rifle, but ofc this requires a pk3 download.
Title: Re: New secondary attack is invisible
Post by: rotacak on October 28, 2009, 05:44:26 pm
Thanx alot. That hack works, bullets are visible, but sound still missing. When I changed weapon.cfg all is ok. Once again, thanx!