[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Firing animations

Firing animations

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Firing animations

Postby sniperz227 » Fri Dec 09, 2011 5:23 am

Hey im sorry but i still cant grasp the concept on how to animate. i have a file with 1-4 shootingand 5-10 reloading animations. How would i code in firing for a weapon i codded in myself in quake. its slot is called IT_M9 if you need it. thanks
sniperz227
 
Posts: 112
Joined: Sat Apr 09, 2011 3:19 am

Re: Firing animations

Postby Nahuel » Fri Dec 09, 2011 1:23 pm

hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Firing animations

Postby Seven » Fri Dec 09, 2011 3:55 pm

Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Firing animations

Postby sniperz227 » Fri Dec 09, 2011 9:16 pm

sniperz227
 
Posts: 112
Joined: Sat Apr 09, 2011 3:19 am

Re: Firing animations

Postby Seven » Fri Dec 09, 2011 10:21 pm

Hello sniperz227,

Slowly, these have just been sample lines.

If you change your w_attack() code like you did it, you will not be able to see the animation.
Your .weaponframe will always be resettet to "0", so if you put a "if (self.weaponframe = 1)"
it will never pass it.

Also my "sound" line was only an example. I believe you dont even have a "boom.wav" file, do you ?
I just wanted to show what you could do.

If you are not sure how to start, I would suggest to leave the original code as it is and start this way to at least see your gun in action:
Create frames in your .mdl model similar to the original weapon (lets say the shotgun).
Name the frames (inside QME for example) according the original frames: "shot1" till "shot7" (fill up with dummy frames if you have only 5)
Now replace the shotgun with your weapon model.

Next step would be to adjust the existig code according to the real frame count that you have (you said you have 5 ?).
You can include now also sound or effect code lines if you want.

Proceed step by step and try to make it happen in small steps.
If you change too much at once you will be confused/lost quickly.
I am also an unexperienced coder, who still have to learn a lot.

I can suggest to read LordHavocs weapon tutorial (especially if you want to play around with it).
It teaches you basic things. I know it is not exactly what you want to do, but maybe it helps:
http://inside3d.com/showtutorial.php?id=194

Also the reloading tutorial might be very interesting for you:
http://www.inside3d.com/showtutorial.php?id=249
(There is one small mistake inside though. Read about it here:
viewtopic.php?f=2&t=4451

Good luck.
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Firing animations

Postby sniperz227 » Fri Dec 09, 2011 10:23 pm

ye well i changed my wepaonframe to 1 should that work? and i dont wanna use the old method i used your new one as you can see. i already have my reload code im just not going to put it in yet cuz i want to get firing in first.
sniperz227
 
Posts: 112
Joined: Sat Apr 09, 2011 3:19 am

Re: Firing animations

Postby sniperz227 » Sat Dec 10, 2011 1:59 am

nvm i got it i didnt realize that my animations werent on my gun when i exported it :P
sniperz227
 
Posts: 112
Joined: Sat Apr 09, 2011 3:19 am

Re: Firing animations

Postby dr_mabuse » Thu Jan 05, 2012 1:15 pm

sorry for bumping an old topic, but i got also a small problem with my animations..

All my guns have firing and reloading animations, and they work as they should, but with one problem:
the reloading animations will stop when you pick up ammo and a new weapon...
Does anybody know how i can disable it? Maybe in the touch functions?
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Re: Firing animations

Postby Alex » Thu Jan 05, 2012 5:39 pm

Hey Dr_Mabuse,
I could be wrong, but I'm pretty sure it has to do with W_SetCurrentAmmo() in weapons.qc and items.qc

Every time you pick up ammo or weapons this function is called, and in it the weaponframe is always set to zero. So if you're in the middle of reloading (say weaponframe 10 or 15) and pick up another gun it resets your weaponframe, even though the reloading function continues. It actually does the same thing with firing animations, you just generally don't notice it because they're usually short.

Try putting a condition in the W_SetCurrentAmmo function. Maybe something at the top like:

if ((self.currently_reloading) > 0) {
return;
}

Then at the last frame of every reloading animation I'd call W_SetCurrentAmmo() and reset self.currently_reloading to 0.

I think that should do the trick.

Alex
Alex
 
Posts: 24
Joined: Sun Feb 13, 2011 6:24 pm

Re: Firing animations

Postby dr_mabuse » Thu Jan 05, 2012 6:33 pm

where exactly in items.qc??

EDIT: looks like it is not working or i am to stupid lol...
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests