Inside3D!
     

Charge Shot
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Wed Jun 30, 2010 12:42 am    Post subject: Reply with quote

Yeah, just carefully reading the original QC code helps a lot to understand how thing works. Wink
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Wed Jun 30, 2010 12:59 am    Post subject: Reply with quote

yea, it helps immensely, but there are still thing i need explained (3 or 4 times) before i understand it.

While on that subject I would like to thank everyone on inside3d who have put up with me so far and my noobish and sometimes annoying questions. You know who you are. Thanks
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Wed Jun 30, 2010 1:02 am    Post subject: Reply with quote

Since we are on the subject of thanking people, I would also like to thank Inside3d For helping me as well. You guys never got mad, Or anything of that sort. You simply explained the solution and Helped me along. I hope to be able to help people soon, Just like Ghostfang is being able to do.

In some topics, I expected a flame war, And Nope. It never happened Smile
So thank you as well
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Wed Jun 30, 2010 1:39 am    Post subject: Reply with quote

Mexicouger wrote:
Since we are on the subject of thanking people, I would also like to thank Inside3d For helping me as well. You guys never got mad, Or anything of that sort.


Wish i could say the same lol. Some people got so frustrated they wrote the code and gave it to me themselves just to shut me up. Well at least it seemed that way. *cough* c0burn *cough* jk. But seriously, he wrote the pipebomb code for l4q and i thank him very much and i will NOT take credit for it.

In the words of Baker, I am not entirely a "help vampire" anymore.
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Wed Jun 30, 2010 5:47 am    Post subject: Reply with quote

I rage when I read what Mexicouger and Ghost_Fang and co. write.
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Wed Jun 30, 2010 5:58 am    Post subject: Reply with quote

Downsider wrote:
I rage when I read what Mexicouger and Ghost_Fang and co. write.


Were we too soft for ya? Wink

EDIT:

I actually need some help with the Charge Code That RedRum wrote.

I made a test function, And it does charge and All, But when I release the Button, nothing Happens. if I press the Button again, it just says my percentage of charge and Doesn't shoot. The shooting function isn't being called. Here is my code:

Code:
/*
============
W_WeaponFrame

Called every frame so impulse events can be handled as well as possible
============
*/
void() W_WeaponFrame =
{
        if (!self.button0)
                self.semi = 0;            
   if (time < self.attack_finished)
      return;

   ImpulseCommands ();
   
// check for attack
   if (self.button0)
   {
      if (self.weapon == IT_SHOTGUN)
      {
   if (self.charge < 10)
         {
         self.charge = self.charge + 1;
   centerprint (self, "10%\n");
         }

      if (self.charge >= 10)
      if (self.charge < 20)
         {
         self.charge = self.charge + 1;
      centerprint (self, "20%\n");
         }

      if (self.charge >= 20)
      if (self.charge < 30)
         {
         self.charge = self.charge + 1;
      centerprint (self, "30%\n");
         }

      if (self.charge >= 30)
         {
         self.charge = self.charge + 1;
      centerprint (self, "40%\n");
         }
      
   if (self.charge < 10 && !self.button0)
      if (self.charge >= 1 && !self.button0)           // no rapid fire
         {
         self.charge = 0;
              }
        if (self.charge >= 10 && !(self.button0))         // you released the button
         {
         player_missle56();
         W_FireBlaster();   
         self.attack_finished = time + 0.12;
         }
      }
      else
      {
      SuperDamageSound ();
      W_Attack ();
      }
   }
};


The Actual fire Function doesn't matter because it's not being called. Gotta get this out of the way.

This function Isn't being called, Or it's not passing inspection.

Code:
 if (self.charge >= 10 && !(self.button0))         // you released the button
         {
         player_missle56();
         W_FireBlaster();   
         self.attack_finished = time + 0.12;
         }
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Wed Jun 30, 2010 6:11 am    Post subject: Reply with quote

Downsider wrote:
I rage when I read what Mexicouger and Ghost_Fang and co. write.


Why?
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Jun 30, 2010 11:48 pm    Post subject: Reply with quote

I'm not 100% on this but try:
Code:
void() W_WeaponFrame =
{
   if (!self.button0)
           self.semi = 0; 
         
   if (time < self.attack_finished)
      return;

      ImpulseCommands ();  // check for attack
   
   if (self.button0)
   {
     if (self.weapon == IT_SHOTGUN)
     {
      if (self.charge < 10)
         {
         self.charge = self.charge + 1;
         centerprint (self, "10%\n");
         }

      if (self.charge >= 10)
      if (self.charge < 20)
         {
         self.charge = self.charge + 1;
         centerprint (self, "20%\n");
         }

      if (self.charge >= 20)
      if (self.charge < 30)
         {
         self.charge = self.charge + 1;
         centerprint (self, "30%\n");
         }

      if (self.charge >= 30)
         {
         self.charge = self.charge + 1;
         centerprint (self, "40%\n");
         }
     
      if (self.charge < 10 && !self.button0)
      if (self.charge >= 1 && !self.button0)           // no rapid fire
         {
         self.charge = 0;
         }

        if (self.charge >= 10 && !(self.button0))         // you released the button
         {
         player_missle56();
         W_FireBlaster();   
         self.attack_finished = time + 0.12;
         }
      }
   }
      else
      {
      SuperDamageSound ();
      W_Attack ();
      }
   }
};

Me thinks you were missing a bracket towards the bottom of your code. Also, what's this code do:
Code:
   if (!self.button0)
           self.semi = 0;

and this:
Code:
         player_missle56();

_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Thu Jul 01, 2010 1:13 am    Post subject: Reply with quote

Gah! I am still having troubles. That code you gave me makes it rapidly shoot(And I had to add another bracket)

So I did a Bit of Bracket editing and this is What I got:

Code:
/*
============
W_WeaponFrame

Called every frame so impulse events can be handled as well as possible
============
*/
void() W_WeaponFrame =
{
   if (!self.button0)
           self.semi = 0;
         
   if (time < self.attack_finished)
      return;

      ImpulseCommands ();  // check for attack
   
   //if (self.button0) // Whats funny Is That You don't even need to Press the Button!
  // {
     if (self.weapon == IT_SHOTGUN)
     {
      if (self.charge < 10)
         {
         self.charge = self.charge + 1;
         //nterprint (self, "10%\n");
         }

      if (self.charge >= 10)
      if (self.charge < 20)
         {
         self.charge = self.charge + 1;
         //nterprint (self, "20%\n");
         }

      if (self.charge >= 20)
      if (self.charge < 30)
         {
         self.charge = self.charge + 1;
         //nterprint (self, "30%\n");
         }
      if (self.charge >= 30)
      if (self.charge < 40)
         {
         self.charge = self.charge + 1;
         //centerprint (self, "40%\n");
         }
   if (self.charge >= 40)
      if (self.charge < 50)
         {
         self.charge = self.charge + 1;
         //centerprint (self, "50%\n");
         }
   if (self.charge >= 50)
      if (self.charge < 60)
         {
         self.charge = self.charge + 1;
         //centerprint (self, "60%\n");
         }   
   if (self.charge >= 60)
      if (self.charge < 70)
         {
         self.charge = self.charge + 1;
         //centerprint (self, "70%\n");
         }
   if (self.charge >= 70)
         {
         self.charge = self.charge + 1;
         //centerprint (self, "DONE!!\n");
         }
     
      if (self.charge < 10 && !self.button0)
      if (self.charge >= 1 && !self.button0)           // no rapid fire
         {
         self.charge = 0;
         }

        if (!self.button0 && self.charge >= 10)         // you released the button
         {
   if (self.mballtoggle == 1)
      return;
   if (!self.semi)
         {
   W_FireBlaster();   
   self.charge = 0;
      player_missle56();
   self.semi = 0;
      self.attack_finished = time + 0.12;
         }
         }
   }
   else if (self.mballtoggle == 1 && self.button0)   //If your holding down the attack button and in ball mode
   {
      if (self.mbombs >= 0)
      {
      fire_morphbomb();
      self.attack_finished = time + 0.6;
      }
      else
      {}
   }
   if (self.button0)
   {
      SuperDamageSound ();
      W_Attack ();
}
};

EDIT: Yay! I finally got the code Working just how I want it! I updated the code for future useage
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Thu Jul 01, 2010 6:00 pm    Post subject: Reply with quote

Sweet!
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group