Announcement

Collapse
No announcement yet.

Guided sidewinder rockets

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Damn I never even saw the source code download in that link. But my phone won't load it, sorry man. I'll take a look at it when I get back home.

    I have an idea of how he does the critical damage but without being able to test it or even see the functions I won't suggest anything as it might just screw up the code more.
    'Replacement Player Models' Project

    Comment


    • #32
      Ok, since it was already discussed here, and I don't really want to do yet another new thread, How to add a substantial knockback/kick to the weapon WITHOUT getting the rocket jump effect?

      I got it working for my ssg the way I wanted. But my new weapon is also a shotgun type of gun. I got the kick-back just how I want it. The only thing though is I don't want it to lift the player off the ground like the I made the ssg do. Any suggestions?

      Comment


      • #33
        i think you would adjust self.punchangle_x.. let the engine adjust the view.
        If you try to mess with angles and origin of the player you are going to get weird physics.

        example:

        Code:
        void() W_FireShotgun =
        {
        	local vector dir;
        
        	sound (self, CHAN_WEAPON, "weapons/gun****.wav", 1, ATTN_NORM);	
        
        	self.punchangle_x = -2;
        	
        	self.currentammo = self.ammo_shells = self.ammo_shells - 1;
        	dir = aim (self, 100000);
        	FireBullets (6, dir, '0.04 0.04 0');
        };
        www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

        Comment


        • #34
          @Legend

          Firstly, it's a really good idea to show your code in context so that we can help you customize a solution for your specific situation. The reason is you can accomplish many of these things multiple ways but it may or may not be compatible with your code choices. So maybe a small sample in the future would help. I'm not sure why you have set it to lift the player but you can simply add pushback using this example code.

          Code:
          void() W_FireShotgun =
          {
          	local vector dir,kickback,dir2;
          
          	sound (self, CHAN_WEAPON, "weapons/gun****.wav", 1, ATTN_NORM);	
          
          	self.punchangle_x = -2;
          
          //this is new code
          
                   var float kickback_push = 100;    // set to amount of kickback you want
          		dir2 = aim (self, 100);
          		traceline (self.origin, self.origin + dir2*kickback_push, FALSE, self);
          		kickback = (trace_endpos - self.origin); // + (normalize(dir2) * 80);
          		self.velocity = self.velocity - kickback;
          
          //End new code
          	
          	self.currentammo = self.ammo_shells = self.ammo_shells - 1;
          	dir = aim (self, 100000);
          	FireBullets (6, dir, '0.04 0.04 0');
          };
          If you don't understand traceline here is the syntax:

          traceline(vector v1, vector v2, float collisionType, entity ignore)

          basically traceline sets up a point between two vector points in this case v1 and v2. So we are setting up here a specific line length for the kickback to use. First it uses self.origin as the first vector and then use the variable kickback_push and dir2 to figure the second vector. Kickback defines the end point assuming no obstacles and then it just sets self.velocity to self.velocity - kickback which will use your default velocity to move back to the amount specified by kickback. That's not a detailed explanation but if you weren't familiar with traceline hopefully this kinda helps clear it up. You can read a bit more about it here.

          So this will move your player back as they shoot. I believe this is what you meant by kick back. Let me know.

          EDIT: Note friction will play a role here as well as angle (example on an incline) which will change the affect of the pushback based on surface, gravity, friction and location.
          Last edited by PrimalLove; 08-18-2014, 07:56 PM.

          Comment


          • #35
            @ Primal
            You're right, I should have posted my code. I wanted the regular ssg to lift the player off the ground like a rocket jump.

            My riot shotgun, I want to knock the player back substanially but not lift them off the ground.

            SSG:

            Code:
            W_FireSuperShotgun
            ================
            */
            void() W_FireSuperShotgun =
            {
            	local vector dir;
            
            	if (self.currentammo == 1)
            	{
            		W_FireShotgun ();
            		return;
            	}
            		
            	sound (self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);	
            
            	self.punchangle_x = -4;
            	self.velocity = self.velocity - (v_forward*350);
            	
            	self.currentammo = self.ammo_shells = self.ammo_shells - 2;
            	if (self.ammo_shells > 1) {
            		self.attack_finished = time + 1.3;
            		sound (self, CHAN_ITEM, "weapons/dsdbload.wav", 1, ATTN_NORM);	
            	}
            	dir = aim (self, 100000);
            	FireBullets (16, dir, '0.14 0.08 0');
            };
            Riot Shotgun:
            Code:
            ================
            W_FireRC
            ================
            */
            
            //fire riot shotgun
            void() W_FireRC =
            {
            	local vector dir, back;
            
            	if (self.currentammo > self.ammo_shells)
            		self.currentammo = self.ammo_shells;
            		
            	if (self.currentammo < 1)
            	{
            		sound (self, CHAN_WEAPON, "weapons/dryfire.wav", 1, ATTN_NORM);	
            		return;
            	}
            		
            	if (self.weaponframe < 2)
            		sound (self ,CHAN_WEAPON, "weapons/rshotgn.wav", 1, ATTN_NORM);	
            
            	self.punchangle_x = -4;
            
            	self.currentammo = self.currentammo - 1;
            	self.ammo_shells = self.ammo_shells - 1;
            	makevectors(self.v_angle);
            	dir = v_forward; //aim (self, 100000);
            	
            	FireBullets (30, dir, '0.20 0.15 0');
            	
            	back = dir * 35 * 5;
            	self.velocity = self.velocity - back;
            	self.avelocity = vectoangles (self.velocity);
            };
            I'm actually having a few issues with this new one. Other than lifting the player too high off the ground, it also seems to be using 3 instead of 2 shells for some reason. I must have tweaked something elsewhere that I can't seem to find.

            Comment


            • #36
              The code I posted will fix your problem with the riot shotgun. Try it out. LOL you're code makes it into a mini rocket launcher! LMAO! Its cute but not useful.

              I tried your code for riotshotgun and it only uses one shell so you've defined something wrong else where. Check in W_SetCurrentAmmo and W_Attack to see if you added anything to it.
              Last edited by PrimalLove; 08-18-2014, 07:53 PM.

              Comment


              • #37
                Originally posted by PrimalLove View Post

                I tried your code for riotshotgun and it only uses one shell so you've defined something wrong else where
                That's what I was thinking, but I'm not sure where I messed up. The code as it is, uses 3 shells on my copy. There are other things going on as well, so you wouldn't get the whole effect with just that part.

                I've scoured it all over and can't figure out where I messed up.

                Not sure where else to double check. Don't think I can post the whole weapons.qc here either. I think it's too long.

                Comment


                • #38
                  Check in W_SetCurrentAmmo and W_Attack

                  Comment


                  • #39
                    Originally posted by PrimalLove View Post
                    Check in W_SetCurrentAmmo and W_Attack
                    I looked over that section, but I can't seem to find what is messing up the ammo.

                    Code:
                    void() W_SetCurrentAmmo =
                    {
                    	player_run ();		// get out of any weapon firing states
                    
                    	self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) );
                    	
                    	if (self.weapon == IT_AXE)
                    	{
                    		self.currentammo = 0;
                    		self.weaponmodel = "progs/v_axe.mdl";
                    		self.weaponframe = 0;
                    	}
                    	else if (self.weapon == IT_SHOTGUN)
                    	{
                    		self.enemy = world;
                    		self.currentammo = 6;
                    		if (self.currentammo > self.ammo_shells)
                    			self.currentammo = self.ammo_shells;
                    			
                    		self.weaponmodel = "progs/v_shot.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_SHELLS;
                    	}
                    	else if (self.weapon == IT_SUPER_SHOTGUN)
                    	{
                    		self.currentammo = self.ammo_shells;
                    		self.weaponmodel = "progs/v_shot2.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_SHELLS;
                    	}
                    	else if (self.weapon == IT_RSHOT)  //  Riot shotgun
                    	{
                    		self.enemy = world;
                    		self.currentammo = 12;
                    		if (self.currentammo > self.ammo_shells)
                    			self.currentammo = self.ammo_shells;
                    		
                    		self.weaponmodel = "progs/v_rshot.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_SHELLS;
                    	}
                    	else if (self.weapon == IT_NAILGUN)
                    	{
                    		self.currentammo = self.ammo_nails;
                    		self.weaponmodel = "progs/v_nail.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_NAILS;
                    	}
                    	else if (self.weapon == IT_SUPER_NAILGUN)
                    	{
                    		self.currentammo = self.ammo_nails;
                    		self.weaponmodel = "progs/v_nail2.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_NAILS;
                    	}
                    	else if (self.weapon == IT_GRENADE_LAUNCHER)
                    	{
                    		self.currentammo = 3;
                    		if (self.currentammo > self.ammo_rockets)
                    			self.currentammo = self.ammo_rockets;
                    		
                    		self.weaponmodel = "progs/v_rock.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_ROCKETS;
                    	}
                    	else if (self.weapon == IT_ROCKET_LAUNCHER)
                    	{
                    		self.currentammo = self.ammo_rockets;
                    		self.weaponmodel = "progs/v_rock2.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_ROCKETS;
                    	}
                    	else if (self.weapon == IT_LIGHTNING)
                    	{
                    		self.currentammo = self.ammo_cells;
                    		self.weaponmodel = "progs/v_light.mdl";
                    		self.weaponframe = 0;
                    		self.items = self.items | IT_CELLS;
                    	}
                    	else
                    	{
                    		self.currentammo = 0;
                    		self.weaponmodel = "";
                    		self.weaponframe = 0;
                    	}
                    };
                    
                    float() W_BestWeapon =
                    {
                    	local	float	it;
                    	if (self.button0)
                    	{
                    		self.attack_finished = time + 0.5;
                    		sound (self, CHAN_ITEM, "misc/talk.wav", 1, ATTN_NORM);
                    		stuffcmd (self, "bf\n");
                    	}
                    	return self.weapon;
                    	
                    	it = self.items;
                    
                    	if (self.waterlevel <= 1 && self.ammo_cells >= 1 && (it & IT_LIGHTNING) )
                    			return IT_LIGHTNING;
                    	if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) )
                    		return IT_SUPER_NAILGUN;
                    	if(self.ammo_shells >= 2 && (it & IT_SUPER_SHOTGUN) )
                    		return IT_SUPER_SHOTGUN;
                    	if(self.ammo_nails >= 1 && (it & IT_NAILGUN) )
                    		return IT_NAILGUN;
                    	if(self.ammo_shells >= 1 && (it & IT_SHOTGUN) )
                    		return IT_SHOTGUN;
                    	return IT_AXE;
                    };
                    
                    float() W_CheckNoAmmo =
                    {
                    	if (self.currentammo > 0)
                    		return TRUE;
                    
                    	if (self.weapon == IT_AXE)
                    		return TRUE;
                    
                    	if (self.weapon == IT_GRENADE_LAUNCHER && self.ammo_rockets > 0)
                    		return TRUE;
                    		
                    	if (self.weapon == IT_SHOTGUN && self.ammo_shells > 0)
                    		return TRUE;
                    		
                    	if (self.weapon == IT_RSHOT && self.ammo_shells > 0)
                    		return TRUE;	
                    		
                    	self.weapon = W_BestWeapon ();
                    
                    	W_SetCurrentAmmo ();
                    	
                    // drop the weapon down
                    	return FALSE;
                    };
                    
                    /*
                    ============
                    W_Attack
                    
                    An attack impulse can be triggered now
                    ============
                    */
                    void()	player_axe1;
                    void()	player_axeb1;
                    void()	player_axec1;
                    void()	player_axed1;
                    void()	player_shot1;
                    void()  player_rc1;
                    void()	player_nail1;
                    void()	player_light1;
                    void()	player_rocket1;
                    
                    void() W_Attack =
                    {
                    	local	float	r;
                    
                    	if (!W_CheckNoAmmo ())
                    		return;
                    
                    	makevectors	(self.v_angle);			// calculate forward angle for velocity
                    	if (self.weapon != IT_AXE)
                    		self.show_hostile = time + 1;	// wake monsters up
                    
                    	if (self.weapon == IT_AXE)
                    	{
                    		sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
                    		r = random();
                    		if (r < 0.25)
                    			player_axe1 ();
                    		else if (r<0.5)
                    			player_axeb1 ();
                    		else if (r<0.75)
                    			player_axec1 ();
                    		else
                    			player_axed1 ();
                    		self.attack_finished = time + 0.5;
                    	}
                    	else if (self.weapon == IT_SHOTGUN)
                    	{
                    		if (self.currentammo < 1) {
                    			self.currentammo = 0;
                    		} else {
                    			self.cnt = 0;
                    			player_shot1 ();
                    			W_FireShotgun ();
                    			self.attack_finished = time + 0.5;
                    		}
                    	}
                    	else if (self.weapon == IT_SUPER_SHOTGUN)
                    	{
                    		player_shot1 ();
                    		self.attack_finished = time + 0.6;
                    		W_FireSuperShotgun ();
                    	}
                    	else if (self.weapon == IT_RSHOT)  //  Riot Shotgun
                    	{
                    		if (self.currentammo < 1) {
                    			self.currentammo = 0;
                    		} else {
                    			self.cnt = 0;
                    			player_rc1 ();
                    			W_FireRC ();
                    			self.attack_finished = time + 0.5;
                    		}	
                    	}
                    	else if (self.weapon == IT_NAILGUN)
                    	{
                    		player_nail1 ();
                    	}
                    	else if (self.weapon == IT_SUPER_NAILGUN)
                    	{
                    		player_nail1 ();
                    	}
                    	else if (self.weapon == IT_GRENADE_LAUNCHER)
                    	{
                    		if (self.currentammo < 1) {
                    			self.currentammo = 0;
                    		} else {
                    			self.cnt = 0;
                    			player_rocket1();
                    			W_FireGrenade();
                    			self.attack_finished = time + 0.6;
                    		}
                    	}
                    	else if (self.weapon == IT_ROCKET_LAUNCHER)
                    	{
                    		player_rocket1();
                    		W_FireRocket();
                    		if (self.ammo_rockets > 0)
                    			self.attack_finished = time + 1.4;
                    		else
                    			self.attack_finished = time + 0.8;
                    		
                    		if (self.tracing == TRUE)
                    		return;
                    
                    		player_rocket1();
                    		W_FireRocket();	
                    	}
                    	else if (self.weapon == IT_LIGHTNING)
                    	{
                    		player_light1();
                    		self.attack_finished = time + 0.1;
                    		sound (self, CHAN_ITEM, "weapons/lstart.wav", 1, ATTN_NORM);
                    	}
                    };
                    I'm probably overlooking something right in front of my face, but I just can't see it.
                    Last edited by Legend; 08-18-2014, 08:04 PM.

                    Comment


                    • #40
                      Under W_Attack why is this code there?


                      Code:
                      	if (self.currentammo < 1) {
                      			self.currentammo = 0;
                      		} else {
                      			self.cnt = 0;
                      Under W_CurrentAmmo in riotshotgun you also have this

                      Code:
                      self.enemy = world;
                      		self.currentammo = 12;
                      Why do you have that code there?

                      Comment


                      • #41
                        Originally posted by PrimalLove View Post
                        Under W_Attack why is this code there?


                        Code:
                        	if (self.currentammo < 1) {
                        			self.currentammo = 0;
                        		} else {
                        			self.cnt = 0;
                        Under W_CurrentAmmo in riotshotgun you also have this

                        Code:
                        self.enemy = world;
                        		self.currentammo = 12;
                        Why do you have that code there?
                        Because it is a 12 round drum in the gun. After all 12 shots are fired, the gun will auto-reload taking up a decent amount of time. These lines are used to call on the reloading part later in the weapons.cq

                        Here it is without the reloading stuff to the new weapon:
                        Code:
                        //fire riot shotgun
                        void() W_FireRC =
                        {
                        	local vector dir, back;
                        
                        	if (self.ammo_shells < 2)
                        	{
                        		self.weapon = W_BestWeapon ();
                        		W_SetCurrentAmmo ();
                        		return;
                        	}
                        		
                        	if (self.weaponframe < 2)
                        		sound (self ,CHAN_WEAPON, "weapons/rshotgn.wav", 1, ATTN_NORM);	
                        
                        	self.punchangle_x = -4;
                        
                        	self.currentammo = self.ammo_shells = self.ammo_shells - 1;
                        	makevectors(self.v_angle);
                        	dir = v_forward; //aim (self, 100000);
                        	
                        	FireBullets (30, dir, '0.20 0.15 0');
                        	
                        	//dhm do Newton's 3rd law.
                        	back = dir * 35 * 5;
                        	self.velocity = self.velocity - back;
                        	self.avelocity = vectoangles (self.velocity);
                        };
                        Code:
                        void() W_SetCurrentAmmo =
                        {
                        	player_run ();		// get out of any weapon firing states
                        
                        	self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) );
                        	
                        	if (self.weapon == IT_AXE)
                        	{
                        		self.currentammo = 0;
                        		self.weaponmodel = "progs/v_axe.mdl";
                        		self.weaponframe = 0;
                        	}
                        	else if (self.weapon == IT_SHOTGUN)
                        	{
                        		self.enemy = world;
                        		self.currentammo = 6;
                        		if (self.currentammo > self.ammo_shells)
                        			self.currentammo = self.ammo_shells;
                        			
                        		self.weaponmodel = "progs/v_shot.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_SHELLS;
                        	}
                        	else if (self.weapon == IT_SUPER_SHOTGUN)
                        	{
                        		self.currentammo = self.ammo_shells;
                        		self.weaponmodel = "progs/v_shot2.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_SHELLS;
                        	}
                        	else if (self.weapon == IT_RSHOT)  //  Riot shotgun
                        	{
                        		self.currentammo = self.ammo_shells;
                        		self.weaponmodel = "progs/v_rshot.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_SHELLS;
                        	}
                        	else if (self.weapon == IT_NAILGUN)
                        	{
                        		self.currentammo = self.ammo_nails;
                        		self.weaponmodel = "progs/v_nail.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_NAILS;
                        	}
                        	else if (self.weapon == IT_SUPER_NAILGUN)
                        	{
                        		self.currentammo = self.ammo_nails;
                        		self.weaponmodel = "progs/v_nail2.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_NAILS;
                        	}
                        	else if (self.weapon == IT_GRENADE_LAUNCHER)
                        	{
                        		self.currentammo = 3;
                        		if (self.currentammo > self.ammo_rockets)
                        			self.currentammo = self.ammo_rockets;
                        		
                        		self.weaponmodel = "progs/v_rock.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_ROCKETS;
                        	}
                        	else if (self.weapon == IT_ROCKET_LAUNCHER)
                        	{
                        		self.currentammo = self.ammo_rockets;
                        		self.weaponmodel = "progs/v_rock2.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_ROCKETS;
                        	}
                        	else if (self.weapon == IT_LIGHTNING)
                        	{
                        		self.currentammo = self.ammo_cells;
                        		self.weaponmodel = "progs/v_light.mdl";
                        		self.weaponframe = 0;
                        		self.items = self.items | IT_CELLS;
                        	}
                        	else
                        	{
                        		self.currentammo = 0;
                        		self.weaponmodel = "";
                        		self.weaponframe = 0;
                        	}
                        };
                        
                        float() W_BestWeapon =
                        {
                        	local	float	it;
                        	if (self.button0)
                        	{
                        		self.attack_finished = time + 0.5;
                        		sound (self, CHAN_ITEM, "misc/talk.wav", 1, ATTN_NORM);
                        		stuffcmd (self, "bf\n");
                        	}
                        	return self.weapon;
                        	
                        	it = self.items;
                        
                        	if (self.waterlevel <= 1 && self.ammo_cells >= 1 && (it & IT_LIGHTNING) )
                        			return IT_LIGHTNING;
                        	if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) )
                        		return IT_SUPER_NAILGUN;
                        	if(self.ammo_shells >= 2 && (it & IT_SUPER_SHOTGUN) )
                        		return IT_SUPER_SHOTGUN;
                        	if(self.ammo_nails >= 1 && (it & IT_NAILGUN) )
                        		return IT_NAILGUN;
                        	if(self.ammo_shells >= 1 && (it & IT_SHOTGUN) )
                        		return IT_SHOTGUN;
                        	return IT_AXE;
                        };
                        
                        float() W_CheckNoAmmo =
                        {
                        	if (self.currentammo > 0)
                        		return TRUE;
                        
                        	if (self.weapon == IT_AXE)
                        		return TRUE;
                        
                        	if (self.weapon == IT_GRENADE_LAUNCHER && self.ammo_rockets > 0)
                        		return TRUE;
                        		
                        	if (self.weapon == IT_SHOTGUN && self.ammo_shells > 0)
                        		return TRUE;
                        		
                        	self.weapon = W_BestWeapon ();
                        
                        	W_SetCurrentAmmo ();
                        	
                        // drop the weapon down
                        	return FALSE;
                        };
                        
                        /*
                        ============
                        W_Attack
                        
                        An attack impulse can be triggered now
                        ============
                        */
                        void()	player_axe1;
                        void()	player_axeb1;
                        void()	player_axec1;
                        void()	player_axed1;
                        void()	player_shot1;
                        void()  player_rc1;
                        void()	player_nail1;
                        void()	player_light1;
                        void()	player_rocket1;
                        
                        void() W_Attack =
                        {
                        	local	float	r;
                        
                        	if (!W_CheckNoAmmo ())
                        		return;
                        
                        	makevectors	(self.v_angle);			// calculate forward angle for velocity
                        	if (self.weapon != IT_AXE)
                        		self.show_hostile = time + 1;	// wake monsters up
                        
                        	if (self.weapon == IT_AXE)
                        	{
                        		sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
                        		r = random();
                        		if (r < 0.25)
                        			player_axe1 ();
                        		else if (r<0.5)
                        			player_axeb1 ();
                        		else if (r<0.75)
                        			player_axec1 ();
                        		else
                        			player_axed1 ();
                        		self.attack_finished = time + 0.5;
                        	}
                        	else if (self.weapon == IT_SHOTGUN)
                        	{
                        		if (self.currentammo < 1) {
                        			self.currentammo = 0;
                        		} else {
                        			self.cnt = 0;
                        			player_shot1 ();
                        			W_FireShotgun ();
                        			self.attack_finished = time + 0.5;
                        		}
                        	}
                        	else if (self.weapon == IT_SUPER_SHOTGUN)
                        	{
                        		player_shot1 ();
                        		self.attack_finished = time + 0.6;
                        		W_FireSuperShotgun ();
                        	}
                        	else if (self.weapon == IT_RSHOT)  //  Riot Shotgun
                        	{
                        		player_rc1 ();
                        		self.attack_finished = time + 0.5;
                        		W_FireRC ();
                        	}
                        	else if (self.weapon == IT_NAILGUN)
                        	{
                        		player_nail1 ();
                        	}
                        	else if (self.weapon == IT_SUPER_NAILGUN)
                        	{
                        		player_nail1 ();
                        	}
                        	else if (self.weapon == IT_GRENADE_LAUNCHER)
                        	{
                        		if (self.currentammo < 1) {
                        			self.currentammo = 0;
                        		} else {
                        			self.cnt = 0;
                        			player_rocket1();
                        			W_FireGrenade();
                        			self.attack_finished = time + 0.6;
                        		}
                        	}
                        	else if (self.weapon == IT_ROCKET_LAUNCHER)
                        	{
                        		player_rocket1();
                        		W_FireRocket();
                        		if (self.ammo_rockets > 0)
                        			self.attack_finished = time + 1.4;
                        		else
                        			self.attack_finished = time + 0.8;
                        		
                        		if (self.tracing == TRUE)
                        		return;
                        
                        		player_rocket1();
                        		W_FireRocket();	
                        	}
                        	else if (self.weapon == IT_LIGHTNING)
                        	{
                        		player_light1();
                        		self.attack_finished = time + 0.1;
                        		sound (self, CHAN_ITEM, "weapons/lstart.wav", 1, ATTN_NORM);
                        	}
                        };
                        I was having the same issue before I added the reloading stuff though.
                        Last edited by Legend; 08-18-2014, 08:27 PM.

                        Comment


                        • #42
                          Nothing is jumping out at me from this. Check your reload code to make sure something isn't improperly defined there. I'm gonna make dinner and I'll take a closer look. If you want you can post that code too.

                          Comment


                          • #43
                            Originally posted by PrimalLove View Post
                            Nothing is jumping out at me from this. Check your reload code to make sure something isn't improperly defined there. I'm gonna make dinner and I'll take a closer look. If you want you can post that code too.
                            Best way I can think of is to send you the whole thing

                            https://drive.google.com/file/d/0B0S...it?usp=sharing

                            That's a copy of the source plus resources. This version has the reloading for the shotgun and grenade launcher, but not on the riot controller (I'm still trying to get it to work the way I want). So the Riot Shotgun shows the full 100 ammo but as you will see, it uses 3 shells for some reason.

                            I want the riot gun to have a 12 round drum, but not continuously auto-reload the same way the shotgun and gl do. I want it to only auto load after all 12 shots have been used.

                            You will also see my intended use of the ssg jump but how the riot shotgun does it too much. (I have not tried your code tweaks yet). As well as some other fun things.

                            I haven't gotten around to adding the code to load the riot gun into maps yet so you'll have to use impulse 9 to get it.

                            Thanks again.
                            Last edited by Legend; 08-18-2014, 09:05 PM.

                            Comment


                            • #44
                              I have to admit this one actually stumped me for a bit. LOL. You added two W_FireRC to your player.qc animation. That is why it is shooting three times. So easy fix.

                              Go into player.qc and go down to this code:

                              Code:
                              void()	player_rc1 =	[$shotatt1, player_rc2	] {self.weaponframe=1;
                              [COLOR="Yellow"]W_FireRC ()[/COLOR]; self.effects = self.effects | EF_MUZZLEFLASH;};
                              void()	player_rc2 =	[$shotatt2, player_rc3	] {self.weaponframe=2;};
                              void()	player_rc3 =	[$shotatt3, player_rc4	] {self.weaponframe=3;};
                              void()	player_rc4 =	[$shotatt4, player_rc5	] {self.weaponframe=4; W_FireRC (); self.effects = self.effects | EF_MUZZLEFLASH;};
                              void()	player_rc5 =	[$shotatt5, player_rc6	] {self.weaponframe=5;};
                              void()	player_rc6 =	[$shotatt6, player_run	] {self.weaponframe=6;};
                              Oops!! You've called it twice here! Just remove the yellow one. Fixed. Compile and Play!

                              Also make sure you implement the traceline kickback fix I showed you. Otherwise you can shotgun jump with the riotgun and the super shotgun. Features I believe you didn't intend. Hell if you hold the riotgun down you can actually fly around for a bit. It's quite fun but breaks game play. HEHE!!! Give me some reps for all this help i've been giving you! W3rd! Gonna make you a thread called "I am Legend" and you can post all of your code questions there. LOLOOLOLOLOL! Love ya man!

                              Bon App�tit
                              Last edited by PrimalLove; 08-19-2014, 07:14 AM.

                              Comment


                              • #45
                                Bump!

                                Comment

                                Working...
                                X