Forum

Changing nails speed

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Changing nails speed

Postby Alex.mac » Mon Jul 12, 2010 5:24 pm

hi, i'm new to the forum and a newbie in qc programming. i wanna know how to change the nails speed. i searched the web and found this topic right here, but didn't solve my problem. i can set the sv_maxvelocity cvar to a lower number and get the nails to fly slower, but they won't go any faster than the default speed even if i set the cvar to 100000. here is the code.

Code: Select all
   newmis.velocity = dir * 10000;
};

void() W_FireSuperSpikes =
{
   local vector   dir;
   local entity   old;
   
   sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
   self.attack_finished = time + 0.2;
   self.currentammo = self.ammo_nails = self.ammo_nails - 2;
   dir = aim (self, 10000);


what am i doing wrong?
Alex.mac
 
Posts: 8
Joined: Mon Jul 12, 2010 5:17 pm

Postby ceriux » Mon Jul 12, 2010 5:26 pm

change the max velocity cvar.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Alex.mac » Mon Jul 12, 2010 5:28 pm

i already tried changing on autoexec.cfg and ingame too... there's nothing wrong with the code?
Alex.mac
 
Posts: 8
Joined: Mon Jul 12, 2010 5:17 pm

Postby ceriux » Mon Jul 12, 2010 5:31 pm

maybe this?



void() W_FireSuperSpikes =
{
local vector dir;
local entity old;

sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 2;
dir = aim (self, 10000);

newmis.velocity = dir * 10000;
};

its hard for me to tell with out the code in front of me im still fairly new to coding and i havnt been able to code ne thing in like half a year now... but the only time i had issues with changing the speed of a projectile came back to max_velocity
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Alex.mac » Mon Jul 12, 2010 5:42 pm

i put your code in there but it didn't work, thanks anyway.

btw, my autoexec.cfg is this

Code: Select all
sv_maxvelocity 10000
deathmatch 1
map e1m1


i've only modified this file (weapons.qc) in those lines i quoted before. if somebody wants the whole file i can upload it.

thank you
Alex.mac
 
Posts: 8
Joined: Mon Jul 12, 2010 5:17 pm

Postby ceriux » Mon Jul 12, 2010 5:52 pm

post up all the chuncks and functions pertaining to your weapon and the projectile.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Alex.mac » Mon Jul 12, 2010 6:01 pm

i just found this on misc.qc and changed to 10000 too
Code: Select all
newmis.velocity = self.movedir * 10000;


that's all i've changed. i uploaded the the files (weapons.qc, misc.qc and autoexec.cfg) on this link http://www.mediafire.com/?zzuygjgzdyy.

i think that is all i have regarding the projectile and weapon, but if there's more files i can find to modify, please let me know :)
Alex.mac
 
Posts: 8
Joined: Mon Jul 12, 2010 5:17 pm

Postby ceriux » Mon Jul 12, 2010 6:04 pm

i cannot download anything i live at a government school at the moment. use pastebin and post the links.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Alex.mac » Mon Jul 12, 2010 6:11 pm

weapons.qc
misc.qc

and this is autoexec.cfg
Code: Select all
sv_maxvelocity 10000
deathmatch 1
map e1m1
Alex.mac
 
Posts: 8
Joined: Mon Jul 12, 2010 5:17 pm

Postby ceriux » Mon Jul 12, 2010 6:13 pm

and your modding the nail gun...? sorry i dont have the time to just look through everything... doing my school work and on the pc at the same time.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Alex.mac » Mon Jul 12, 2010 6:15 pm

yes, i've tried to mod the nailgun and the super nailgun.
Alex.mac
 
Posts: 8
Joined: Mon Jul 12, 2010 5:17 pm

Postby ceriux » Mon Jul 12, 2010 6:32 pm

i see no issues with your code. try setting max_velocity to something like 50000 and see if it goes any faster. cause your doing 10000 x 10000 and your max velocity is only 10000 so it wont go any faster.

cause its dir (10000) x 10000 = a . anyways since your capped at 10000 it wont go any higher and your awnser is also being capped.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Alex.mac » Mon Jul 12, 2010 6:36 pm

doesn't solve, but thanks for your patience.
Alex.mac
 
Posts: 8
Joined: Mon Jul 12, 2010 5:17 pm

Postby ceriux » Mon Jul 12, 2010 6:41 pm

sorry then man i could probably figure it out if i had a compiler and a game infront of me. but saddly its pretty impossible at the moment... for me to help.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby DukeInstinct » Mon Jul 12, 2010 10:39 pm

You are remembering to put your compiled progs.dat into your .pak file, right?
Image
User avatar
DukeInstinct
 
Posts: 20
Joined: Sat Jul 10, 2010 11:20 pm
Location: DukeLand

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest