[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/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/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 - Realistic Gatling Gun

Realistic Gatling Gun

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Realistic Gatling Gun

Postby dr_mabuse » Wed Sep 21, 2011 3:32 pm

User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Re: Realistic Gatling Gun

Postby Nahuel » Wed Sep 21, 2011 4:41 pm

Check this mod
:) source not included but you can use the frikdec ( :lol: ). Just what you need :)
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: Realistic Gatling Gun

Postby dr_mabuse » Wed Sep 21, 2011 4:51 pm

ya, i know that mod, but i dont want to decompile other ppls stuff ;)
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Re: Realistic Gatling Gun

Postby Nahuel » Wed Sep 21, 2011 4:56 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: Realistic Gatling Gun

Postby dr_mabuse » Wed Sep 21, 2011 5:40 pm

Decompiling gives me a mess, isnt there a easier way? :(
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Re: Realistic Gatling Gun

Postby frag.machine » Thu Sep 22, 2011 12:24 am

I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Re: Realistic Gatling Gun

Postby leileilol » Thu Sep 22, 2011 4:21 am

The old tritian gatling gun did overheating.

it's easy to overheat the gatling - make a .float that increases every shot, make this .float decrease when you're not shooting, and when this .float reaches a point, prevent the firing for a long nextthink
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Realistic Gatling Gun

Postby apolluwn » Thu Sep 22, 2011 7:43 am

apolluwn
 
Posts: 35
Joined: Tue Apr 26, 2011 11:57 pm

Re: Realistic Gatling Gun

Postby dr_mabuse » Thu Sep 22, 2011 8:50 am

thx, i will give it a try :D

i had problems last night with my mod (the animations only play when i pressed a button lol)...

EDIT: Ok this was a bad idea.... I got the Gatling gun working, but the Frikbots cant handle it...
:lol: :lol: :lol:
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Re: Realistic Gatling Gun

Postby Electro » Thu Sep 22, 2011 10:33 am

Don't use .think and .nextthink on the player.
Benjamin Darling


Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
Electro
 
Posts: 312
Joined: Wed Dec 29, 2004 11:25 pm
Location: Brisbane, Australia

Re: Realistic Gatling Gun

Postby dr_mabuse » Thu Sep 22, 2011 4:54 pm

thanks @ all for the tips, i got now the gatling ALMOST done i want xD
i am a beginner in quakec and want to do all on my own (ok, wit some tipps xD) and not decompile and copy/pasting others stuff :D

using the Quake / Kurok QC Code as a base for the beginning is ok for me...

And using decompiled stuff confuses me:

if ((self.weaponframe >= FL_SWIM)) // Why swim?? oO
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Re: Realistic Gatling Gun

Postby Nahuel » Thu Sep 22, 2011 5:20 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: Realistic Gatling Gun

Postby dr_mabuse » Thu Sep 22, 2011 5:25 pm

lulz, ok xD

the SWIM has confusing me xD
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Re: Realistic Gatling Gun

Postby apolluwn » Fri Sep 23, 2011 12:36 am

I didn't mean for that to be code that was good to go and just copy-pasted...

It was just an example of what you might need to do... this is why I put all the prints and comments in there so you could see where it was in the code had you copied it into a clean source or similar to see how it worked or were just reading it...

If you really want weapons that need to activate after a certain time period/do some conditional animation/etc then you'll really want to consider revamping the weapon system itself. Particularly if you want to have animations before firing and after firing. It really will just be a pain in the ass the way it is set up right now (mostly if you are planning on having more weapons that need "special functionality") since it runs through W_WeaponFrame which then calls W_Attack to find what weapon is currently being used then calls the function that triggers the animation before a weapon state could be set.

This is fine for the standard quake weapons, but not for what you are wanting to do...

You can see that in the above code it forces the weaponframe to be 0 whenever it is warming up, overheated/ing, etc. This is because it is always trying to run the animation function (player_nail1) to increment the weapon frame before it calls W_FireSuperSpikes (within the animation function).

For the super nailgun it goes something like W_WeaponFrame (impulse commands and catches firing) -> W_Attack (see which weapon is being used call animation function) -> player_nail1 (animation/etc) -> W_FireSpikes (this is the nailgun code called from animation to play sounds, modify ammo count, and several other things) -> W_FireSuperSpikes (called from W_FireSpikes if the weapon is the super nailgun and not the nailgun) -> launch_spike (creates the entity projectile gives it a model etc).

I think you can see how this could be troublesome for what you are trying to do.

Quake wants to increment the weapon frame and create a muzzle flash before it even tries to actually "fire" the weapon.

You should probably call the animation from the weapons function rather than before it... This would allow you to get/set/pass the state so it plays the correct animations, effects, etc. You could probably make a generic animation function to pass the weapon state and the current weapon to. Then you could use the weapon state to pass the frames you wanted played to the actual animation function and the animation speed(s) into the weapon animation think function.

There would be a lot more to it than that, but if you were up to it you'd have a much better way of making weapons do what you wanted them to if they need additional capabilities beyond the standard behavior.

The only reason the above code would "work" is because it either constantly sets the weaponframe back to 0 and removes the muzzleflash or just allows the animation to go without ever playing the sound or running launch_spike. It's basically crapping all over the way it naturally works...
apolluwn
 
Posts: 35
Joined: Tue Apr 26, 2011 11:57 pm

Re: Realistic Gatling Gun

Postby dr_mabuse » Fri Sep 23, 2011 9:02 am

Thanks for the nice text :)

And i think i keep my Gatling Gun the "classic" way, because the Frikbots seems to have Problems with the "Warmup" stuff.
I will keep the overheating and reloading.
The next problem was the Kurok QC code my mod was based on, it was a big mess...
I "re-started" doing my mod on "vanilla" quakec code last night, and using a smarter reloading routine for the weapons.
User avatar
dr_mabuse
 
Posts: 80
Joined: Sat Sep 03, 2011 6:07 pm

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 3 guests