[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/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 - Some questions for my singleplayer mod...

Some questions for my singleplayer mod...

Post tutorials on how to do certain tasks within game or engine code here.

Moderator: InsideQC Admins

Some questions for my singleplayer mod...

Postby Daya » Thu Jun 13, 2013 5:05 pm

EDIT: I just realized I put this thread on the wrong section. Can someone move it to where it belong?

Hello everyone,

I felt in love with Quake last year, it has become my favourite FPS, And I'd like to mod it.
Now, please remember that I'm kind of a noob at programming, so except a lot of questions from me. Still, I visited the tutorial page in the site to get me a bit started on a general scale.
I plan for my mod to use darkplaces, but still using quake-styled textures and models.
For now, here's what I already accomplished on the programming side:
- replaced the standart shotgun into a sub-machine gun
- modified the super-shotgun a little bit
- multiple sounds for each type of armors and ammos

Now here comes the questions about the weapons:

1) I'd like for the close range weapon to be more effective, so here's my idea to change it: on top of the close range damage, I'd like it to shoot an instantaneous laser (like a railgun), but with limited range: the more you hold the fire button, the longer the laser will be, the maximum being mid-range. It will not go through enemies. How can I accomplish such a thing?

2) The nailgun in the mod uses the Super nailgun as a base (replacing the vanilla standart nailgun spot), and I'd like to change it so it behaves like the one in Quake 4's multiplayer (2 nails per shot with a spread and reduced firerate). I wrote "launch_spike (2, dir, '0.0225 0.0225 16');" instead of "launch_spike (self.origin + '0.4 0.4 16', dir);" (the original), but I got a compiling error instead. How can I do this?

3) This one is kinda simple: I'd like to integrate Team Fortress' Assault Canon in the game as a minigun weapon(with some tweaks of course, this thing is overpowered) (replacing the vanilla super nailgun spot). I have the files of the mod, but how can I access its code? Or, how can I replicate its function?

4) I'd like to replace the lightning gun to a type of weapon, with a beam that goes crazy (see the alt fire mode of UT2004's link gun)(maybe as a texture?) and with no length limitations aside for walls and enemies, and with the same sound properties as the one in Half life (a windup sound and loop sound during the hold fire sequence and a down sound while the player stops firing.). Any ideas on how to do this?

That's all for now. I might bump this thread from time to time through the progression of the mod in the programming department.
Daya
 
Posts: 12
Joined: Mon May 13, 2013 9:21 am

Re: Some questions for my singleplayer mod...

Postby jitspoe » Thu Jun 13, 2013 8:53 pm

For #2, the thing you have to keep in mind is that launch_spike is expecting 2 parameters: The first one specifies the position (origin) of the nail to start at. The second specifies the direction it goes. There's nothing specifying how many to launch. What you'll need to do is call the function twice, and randomize the direction a little bit.

You can probably look at the shotgun code to figure out how to do some direction randomization.

jitspoe
 
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Re: Some questions for my singleplayer mod...

Postby Daya » Fri Jun 14, 2013 9:32 am

I duplicated the code, and effectively, it now shoots two nails per shot, but I still can't reduce the firerate even with the self.attack_finished command, and by manipulating the '0 0 16' portion I got some wierd stuff: for example, if I put '5 5 16', the change occurs only at which direction I go, and said change is like the standart nailgun, when it fires at the right side of my screen at a certain position. I tried augmenting the dir line into 100000 like in the shotgun code, but nothing happened, and I also tried puttin pluses and commas in "(self.origin + '0.2 0.2 16', dir)" but I got a situation when I finally got the nails to fire into 2 different directions, but the aiming was locked to a certain degree, and it was still not randomized.
Daya
 
Posts: 12
Joined: Mon May 13, 2013 9:21 am

Re: Some questions for my singleplayer mod...

Postby frag.machine » Fri Jun 14, 2013 1:32 pm

As already said, this function takes two arguments: the nail origin, and its direction. Adding another vector to the origin makes the nail start at an offset from the player origin, as you already realized. If you want to make the nails fly in slightly different directions, you must add a small random offset to the second parameter (like +/- 1% to the x, y and z components of the "dir" vector).
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: Some questions for my singleplayer mod...

Postby Daya » Fri Jun 14, 2013 9:28 pm

Daya
 
Posts: 12
Joined: Mon May 13, 2013 9:21 am

Re: Some questions for my singleplayer mod...

Postby jitspoe » Fri Jun 14, 2013 9:46 pm


jitspoe
 
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Re: Some questions for my singleplayer mod...

Postby frag.machine » Fri Jun 14, 2013 10:43 pm

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: Some questions for my singleplayer mod...

Postby Dr. Shadowborg » Fri Jun 14, 2013 11:03 pm

For #1, unless this new melee weapon is like the lightning gun, you'll need to add something like .float meleelaser, modify the fireaxe code to increase the traceline distance each time by whatever meleelaser is(also increasing meleelaser's value) and add a button check to reset meleelaser in playerpostthink. (client.qc)

#4 will be rather complicated. (depending on what you want it to do)

RE: SuperNailgun - If you're still using player_nail1() (which is located in player.qc) in your w_attack function, you'll have to resort to using something like self.nextthink = time + XX; within player_nail1 and player_nail2 to slow things down. (The problem here is that if you do it this way, your weaponframes will cycle slower, so you might want to add a few frame exceptions so that firing frames are normal speed, and cycling frames are slower) (addenda: apparently every frame except frame 0 is a firing frame for the SNG O_o, so adding a few non-firing cycle frames to the model may be in order)

If you do it the way fragmachine says, it will work, but you'll probably end up with some non-synced frames where it looks like your weapon is firing but isn't.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Some questions for my singleplayer mod...

Postby frag.machine » Sat Jun 15, 2013 4:22 pm

@DrShadowBorg: I am assuming that weapon animation is handled in the same code that calls launch_spike, otherwise yeah, weapon firing will look out of sync. Handling the frames on the same place it launches the projectile makes life easier. :)
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: Some questions for my singleplayer mod...

Postby Daya » Sat Jun 15, 2013 5:51 pm

Daya
 
Posts: 12
Joined: Mon May 13, 2013 9:21 am

Re: Some questions for my singleplayer mod...

Postby frag.machine » Sat Jun 15, 2013 7:49 pm

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: Some questions for my singleplayer mod...

Postby Dr. Shadowborg » Sun Jun 16, 2013 10:22 pm

User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Some questions for my singleplayer mod...

Postby Daya » Mon Jun 17, 2013 1:45 pm

Daya
 
Posts: 12
Joined: Mon May 13, 2013 9:21 am

Re: Some questions for my singleplayer mod...

Postby Dr. Shadowborg » Mon Jun 17, 2013 2:26 pm

User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Some questions for my singleplayer mod...

Postby gnounc » Mon Jun 17, 2013 5:45 pm

my
gnounc's
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Next

Return to Programming Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest