View previous topic :: View next topic |
Author |
Message |
frag.machine

Joined: 25 Nov 2006 Posts: 728
|
Posted: Wed Jun 30, 2010 12:42 am Post subject: |
|
|
Yeah, just carefully reading the original QC code helps a lot to understand how thing works.  _________________ frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/ |
|
Back to top |
|
 |
Ghost_Fang
Joined: 12 Nov 2009 Posts: 162
|
Posted: Wed Jun 30, 2010 12:59 am Post subject: |
|
|
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 |
|
 |
Mexicouger

Joined: 01 May 2010 Posts: 129
|
Posted: Wed Jun 30, 2010 1:02 am Post subject: |
|
|
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
So thank you as well |
|
Back to top |
|
 |
Ghost_Fang
Joined: 12 Nov 2009 Posts: 162
|
Posted: Wed Jun 30, 2010 1:39 am Post subject: |
|
|
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 |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Wed Jun 30, 2010 5:47 am Post subject: |
|
|
I rage when I read what Mexicouger and Ghost_Fang and co. write. |
|
Back to top |
|
 |
Mexicouger

Joined: 01 May 2010 Posts: 129
|
Posted: Wed Jun 30, 2010 5:58 am Post subject: |
|
|
Downsider wrote: | I rage when I read what Mexicouger and Ghost_Fang and co. write. |
Were we too soft for ya?
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 |
|
 |
Ghost_Fang
Joined: 12 Nov 2009 Posts: 162
|
Posted: Wed Jun 30, 2010 6:11 am Post subject: |
|
|
Downsider wrote: | I rage when I read what Mexicouger and Ghost_Fang and co. write. |
Why? |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Wed Jun 30, 2010 11:48 pm Post subject: |
|
|
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: _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Mexicouger

Joined: 01 May 2010 Posts: 129
|
Posted: Thu Jul 01, 2010 1:13 am Post subject: |
|
|
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 |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Thu Jul 01, 2010 6:00 pm Post subject: |
|
|
Sweet! _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
|