Announcement

Collapse
No announcement yet.

qc

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

  • #91
    Thank you seven i do have the skin i picked it up from a super special mega uber awesome quaker in one of her underground hd packs. My son is just like everyone else first time he used the crossbow he busted on me about the 3 slot not highlighting when he pressed 3 to use the crossbow.

    the animation dose run right but my computer dose not make good videos. when recording i play at haft speed and it records at twice the speed. i never hafe to use the slow mo in the smc i just need to have enuf bombs going off and it gos in to slow mode by its self. lol

    after i get the bugs worked out of this im going to redo it in the smc using the extra weapon slot and nails as the ammo count. if im still struggling with fixing my bug i will put more code up for you all to look at to give me some clues about.

    @mg my Zommby award looks good on top my tv

    Comment


    • #92
      that crossbow looks sweet! kinda powerful but still nice job!
      www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

      Comment


      • #93
        Nice crossbow Josh!

        Keep at it, this stuff is hard in the beginning but eventually you'll find you get better and better.
        Scout's Journey
        Rune of Earth Magic

        Comment


        • #94
          I'm so glad you changed your avatar rook.
          I miss the monty python god though.
          Gnounc's Project Graveyard Gnounc's git repo

          Comment


          • #95
            I loved the monkey avatar the most...
            At least it was matching his "Code Monkey" rank.

            Comment


            • #96
              rook and gb thank you for the encouraging words

              i am still very lost on why my crossbow dose not work when going from a better weapon to the crossbow.

              it dose not work when i hit 3 or cycle down trow the weapons hear is the code i have been looking at:

              Code:
              /*
              ===============================================================================
              
              PLAYER WEAPON USE
              
              ===============================================================================
              */
              
              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.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 == IT2_CROSSBOW) //crossbow add
              	{
              		self.currentammo = self.ammo_arrow;
              		self.weaponmodel = "progs/v_crossbow.mdl";
              		self.weaponframe = 0;
              		self.items = self.items | IT2_ARROW;
              	}	
              	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 = 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;
              	
              	
              	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_arrow >= 1 && (it & IT2_CROSSBOW) ) //ADD CROSSBOW 
              		return IT2_CROSSBOW;		
              	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;
              };
              
              /*
              ============
              W_ChangeWeapon
              
              ============
              */
              void() W_ChangeWeapon =
              {
              	local	float	it, am, fl;
              	
              	it = self.items;
              	am = 0;
              	
              	if (self.impulse == 1)
              	{
              		fl = IT_AXE;
              	}
              	else if (self.impulse == 2) //MOVED BOTH SHOTGUNS TO IMPULSE 2 MAKING ROOM FOR CROSSBOW IN IMPULSE 3
              	{
              		if ((self.items & IT_SHOTGUN) && 
              				(self.weapon == IT_SUPER_SHOTGUN || self.ammo_shells < 2))
              		{
              			fl = IT_SHOTGUN;
              			if (self.ammo_shells < 1)
              			am = 1;
              		}	
              		else
              		{
              			fl = IT_SUPER_SHOTGUN;
              			if (self.ammo_shells < 2)
              				am = 1;	
              		}
              	}
              	else if (self.impulse == 3)
              	{
              		fl = IT2_CROSSBOW;
              		if (self.ammo_arrow < 1)
              			am = 1;	
              	}		
              	else if (self.impulse == 4)
              	{
              		fl = IT_NAILGUN;
              		if (self.ammo_nails < 1)
              			am = 1;
              	}
              	else if (self.impulse == 5)
              	{
              		fl = IT_SUPER_NAILGUN;
              		if (self.ammo_nails < 2)
              			am = 1;
              	}
              	else if (self.impulse == 6)
              	{
              		fl = IT_GRENADE_LAUNCHER;
              		if (self.ammo_rockets < 1)
              			am = 1;
              	}
              	else if (self.impulse == 7)
              	{
              		fl = IT_ROCKET_LAUNCHER;
              		if (self.ammo_rockets < 1)
              			am = 1;
              	}
              	else if (self.impulse == 8)
              	{
              		fl = IT_LIGHTNING;
              		if (self.ammo_cells < 1)
              			am = 1;
              	}
              	
              	self.impulse = 0;
              	
              	if (!(self.items & fl))
              	{	// don't have the weapon or the ammo
              		sprint (self, "no weapon.\n");
              		return;
              	}
              	
              	if (am)
              	{	// don't have the ammo
              		sprint (self, "not enough ammo.\n");
              		return;
              	}
              
              //
              // set weapon, set ammo
              //
              	self.weapon = fl;		
              	W_SetCurrentAmmo ();
              };
              
              /*
              ============
              CycleWeaponCommand
              
              Go to the next weapon with ammo
              ============
              */
              void() CycleWeaponCommand =
              {
              	local	float	it, am;
              	
              	it = self.items;
              	self.impulse = 0;
              	
              	while (1)
              	{
              		am = 0;
              
              		if (self.weapon == IT_LIGHTNING)
              		{
              			self.weapon = IT_AXE;
              		}
              		else if (self.weapon == IT_AXE)
              		{
              			self.weapon = IT_SHOTGUN;
              			if (self.ammo_shells < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT_SHOTGUN)
              		{
              			self.weapon = IT_SUPER_SHOTGUN;
              			if (self.ammo_shells < 2)
              				am = 1;
              		}		
              		else if (self.weapon == IT_SUPER_SHOTGUN)
              		{
              			self.weapon = IT2_CROSSBOW;
              			if (self.ammo_arrow < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT2_CROSSBOW)
              		{
              			self.weapon = IT_NAILGUN;
              			if (self.ammo_nails < 1)
              				am = 1;
              		}		
              		else if (self.weapon == IT_NAILGUN)
              		{
              			self.weapon = IT_SUPER_NAILGUN;
              			if (self.ammo_nails < 2)
              				am = 1;
              		}
              		else if (self.weapon == IT_SUPER_NAILGUN)
              		{
              			self.weapon = IT_GRENADE_LAUNCHER;
              			if (self.ammo_rockets < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT_GRENADE_LAUNCHER)
              		{
              			self.weapon = IT_ROCKET_LAUNCHER;
              			if (self.ammo_rockets < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT_ROCKET_LAUNCHER)
              		{
              			self.weapon = IT_LIGHTNING;
              			if (self.ammo_cells < 1)
              				am = 1;
              		}
              	
              		if ( (it & self.weapon) && am == 0)
              		{
              			W_SetCurrentAmmo ();
              			return;
              		}
              	}
              
              };
              
              /*
              ============
              CycleWeaponReverseCommand
              
              Go to the prev weapon with ammo
              ============
              */
              void() CycleWeaponReverseCommand =
              {
              	local	float	it, am;
              	
              	it = self.items;
              	self.impulse = 0;
              
              	while (1)
              	{
              		am = 0;
              
              		if (self.weapon == IT_LIGHTNING)
              		{
              			self.weapon = IT_ROCKET_LAUNCHER;
              			if (self.ammo_rockets < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT_ROCKET_LAUNCHER)
              		{
              			self.weapon = IT_GRENADE_LAUNCHER;
              			if (self.ammo_rockets < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT_GRENADE_LAUNCHER)
              		{
              			self.weapon = IT_SUPER_NAILGUN;
              			if (self.ammo_nails < 2)
              				am = 1;
              		}
              		else if (self.weapon == IT_SUPER_NAILGUN)
              		{
              			self.weapon = IT_NAILGUN;
              			if (self.ammo_nails < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT_NAILGUN)
              		{
              			self.weapon = IT2_CROSSBOW;
              			if (self.ammo_arrow < 1)
              				am = 1;
              		}		
              		else if (self.weapon == IT2_CROSSBOW)
              		{
              			self.weapon = IT_SUPER_SHOTGUN;
              			if (self.ammo_shells < 2)
              				am = 1;		
              		}		
              		else if (self.weapon == IT_SUPER_SHOTGUN)
              		{
              			self.weapon = IT_SHOTGUN;
              			if (self.ammo_shells < 1)
              				am = 1;
              		}
              		else if (self.weapon == IT_SHOTGUN)
              		{
              			self.weapon = IT_AXE;
              		}
              		else if (self.weapon == IT_AXE)
              		{
              			self.weapon = IT_LIGHTNING;
              			if (self.ammo_cells < 1)
              				am = 1;
              		}
              	
              		if ( (it & self.weapon) && am == 0)
              		{
              			W_SetCurrentAmmo ();
              			return;
              		}
              	}
              
              };
              if you can see where i messed up and could point it out it would be a big help this is driving me nuts!

              Comment


              • #97
                What float is your crossbow? I only see one small error and it isn't your problem, so that tells me the problem is something I can't see. You dumped an IT2 in with your IT, this means you could be using a float twice. For instance what if your crossbow is 128 and so is nailgun (as an example) this would be a problem.

                You have to keep in mind that those names mean nothing to the engine. IT_NAILGUN (for instance) is for YOU not the engine. The engine considers it to be whatever float is assigned to it. So simply changing something to IT2_ does nothing. I bet your IT2 iis identical to some IT in that list and since the reverse cycle traverses the weapons backwards, you are hitting the duplicate number before the crossbow.
                http://www.nextgenquake.com

                Comment


                • #98
                  I think this is what you are saying

                  ITEMS.QC

                  Code:
                  float(float w) RankForWeapon =
                  {
                  	if (w == IT_LIGHTNING)
                  		return 1;
                  	if (w == IT_ROCKET_LAUNCHER)
                  		return 2;
                  	if (w == IT_SUPER_NAILGUN)
                  		return 3;
                  	if (w == IT_GRENADE_LAUNCHER)
                  		return 4;
                  	if (w == IT_SUPER_SHOTGUN)
                  		return 5;
                  	if (w == IT2_CROSSBOW) //CROSSBOW ADD
                  		return 6;
                  	if (w == IT_NAILGUN)
                  		return 7;
                  	return 8;
                  	 // CHANGED 7 TO 8 CROSSBOW ADD

                  Comment


                  • #99
                    FULL QC https://anonfiles.com/file/92f24be95...7deef362fce68c

                    Comment


                    • No, weapon rank has nothing to do with it. What float did you assign the crossbow? I'm not gonna fish through your whole source, brah.


                      This is what's really happening (made up numbers), think about it

                      Code:
                      if (self.weapon == 1)
                      	{
                      		self.currentammo = 0;
                      		self.weaponmodel = "progs/v_axe.mdl";
                      		self.weaponframe = 0;
                      	}
                      	else if (self.weapon == 2)
                      	{
                      		self.currentammo = self.ammo_shells;
                      		self.weaponmodel = "progs/v_shot.mdl";
                      		self.weaponframe = 0;
                      		self.items = self.items | IT_SHELLS;
                      	}
                      	else if (self.weapon == 4)
                      	{
                      		self.currentammo = self.ammo_shells;
                      		self.weaponmodel = "progs/v_shot2.mdl";
                      		self.weaponframe = 0;
                      		self.items = self.items | IT_SHELLS;
                      	}
                      	else if (self.weapon == IT2_CROSSBOW) //crossbow add
                      	{
                      		self.currentammo = self.ammo_arrow;
                      		self.weaponmodel = "progs/v_crossbow.mdl";
                      		self.weaponframe = 0;
                      		self.items = self.items | IT2_ARROW;
                      	}	
                      	else if (self.weapon == 8)
                      	{
                      		self.currentammo = self.ammo_nails;
                      		self.weaponmodel = "progs/v_nail.mdl";
                      		self.weaponframe = 0;
                      		self.items = self.items | IT_NAILS;
                      	}
                      	else if (self.weapon == 16)
                      	{
                      		self.currentammo = self.ammo_nails;
                      		self.weaponmodel = "progs/v_nail2.mdl";
                      		self.weaponframe = 0;
                      		self.items = self.items | IT_NAILS;
                      	}
                      	else if (self.weapon == 32)
                      	{
                      		self.currentammo = self.ammo_rockets;
                      		self.weaponmodel = "progs/v_rock.mdl";
                      		self.weaponframe = 0;
                      		self.items = self.items | IT_ROCKETS;
                      	}
                      	else if (self.weapon == 64)
                      	{
                      		self.currentammo = self.ammo_rockets;
                      		self.weaponmodel = "progs/v_rock2.mdl";
                      		self.weaponframe = 0;
                      		self.items = self.items | IT_ROCKETS;
                      	}
                      	else if (self.weapon == 128)
                      	{
                      		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;
                      	}
                      };
                      If your crossbow is assigned the same float as any of those (in actual QC values) , that is your problem and even though I haven't looked at your source, I'd be willing to bet a lot of money, that that is your problem.

                      Code:
                      float IT_NAILGUN = 64;
                      float IT2_CROSSBOW = 64;
                      no matter which one of those you use in your weapons check it will be equivalent to

                      Code:
                      if(self.weapon == 64)
                      {
                      
                      }
                      so which one will you get in the long run? Whichever one happens first in the weapons cycle. If nailgun is first you will never get to the crossbow and vise versa.

                      note: this is an example, all the numbers are fabricated so I don't have to go look them up.
                      Last edited by MadGypsy; 06-21-2013, 05:37 PM.
                      http://www.nextgenquake.com

                      Comment


                      • When others were saying that you could use items2, that was actually a very complex statement.

                        1) You are not using items2 at all in weapons
                        2) You would need to consider how you are going to check items and items2 simultaneously without one blocking out the other. That's tricky.
                        3) You were lacking a fundamental understanding of what these vars actually mean.

                        I say none of this rudely. That is not my intention. On the contrary, I'm trying to say it clearly. I believe I covered #3 in my last post, but I'll summarize.

                        IT_ vs IT2_ has nothing to do with anything. That could be FOO and BAR (anything). These naming conventions are used to make it easy for a human to read the code. The bottom line is, those constants represent a number and it is a number that is being checked in all of those if statements.

                        #2 & #1 - why even bother with this? you are already set up to use the empty float for Super Lightning or whatever (?12, get rid of the 2 in IT2 (so it matches the other items) and assign it the unused float. Bingo, you're done. Make sure your arrows have some number that isn't used (which is also a power of 2) and you are really done.

                        change <2 to <1 in crossbow reverse cycle
                        Last edited by MadGypsy; 06-21-2013, 06:03 PM.
                        http://www.nextgenquake.com

                        Comment


                        • ok so i think i am getting it. i wanted to use it2 so i could keep adding things in... but i did see how in doe that when they used it2 everything had to be moved around. i need to go reread everything to see if i can understand it better but at least i know now that the issues is not in the place that i thought it was. because that all looked right to me as far as the weapons qc. if any one else dl the qc and see things that are not right feel free to post your ideas. this is very much a learning experience for me

                          Comment


                          • I'll check it out in a day or two.

                            You want to learn how to fake an item list?

                            for all intents and purposes (cause I am lazy today) we will assume Super Lightning or whatever is 128 and unused.

                            rename it

                            float IT_PIVOT = 128;

                            then start at 1, let's say that's IT_SHOTGUN.

                            IT2_CROSSBOW = 129; // IT_PIVOT+IT_SHOTGUN

                            and then check it like this

                            Code:
                            if(self.weapon == IT2_CROSSBOW)
                            {
                            //do stuff
                            }
                            there's probably some other things you should know, but maybe you can just figure them out.

                            When you grasp that the bottom line is that you are just matching numbers, it's not so mysterious. That's all that is
                            Code:
                            if(this number is equal to that number)
                            {
                            //do stuff
                            }
                            http://www.nextgenquake.com

                            Comment


                            • it may also help you to know (since you are using my QC environment)

                              float = orange
                              vector = purple
                              void = dark brown
                              entity = lighter brown
                              string = green
                              comment = grey

                              everything blue is generic programming language (if, for, switch, case, etc).

                              So if you see light_brown.orange, that means you are dealing with a number (float) value that is a property of an entity, and so on for however the colors are used.

                              so

                              if(orange == orange)

                              is literally checking if 2 numbers are the same, you should ignore the names and focus on what numbers are actually being used when you are trying to debug. The same could be said for any other type.

                              What are these actual values? is your favorite question.

                              PS> You're doing good JD. Don't let the errors bring you down. I make errors all the time in every language I program in. The whole experience of being a programmer (to me) is the puzzles that it provides. If you fall in love with the puzzle, you will solve it. OR you can put your fist through your monitor, I found that works equally as well sometimes. It doesn't fix the errors, it just feels good. (except the part that hurts)
                              Last edited by MadGypsy; 06-21-2013, 07:04 PM.
                              http://www.nextgenquake.com

                              Comment


                              • Code:
                                float = orange
                                vector = purple
                                void = dark brown
                                entity = lighter brown
                                string = green
                                comment = grey
                                i have seen this once or twice but most the time it dose not show up.

                                Yea im feeling like going NIN on my keyboard right now lol





                                at least darkplaces dose not crash all the time now so im getting better

                                Comment

                                Working...
                                X