Forum

It wont compile!!! Also some other issues

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

It wont compile!!! Also some other issues

Postby Karall » Wed Nov 17, 2010 6:19 pm

Well it compiles but the progs.dat wont come up.... Its weird!
Also im having trouble with my code i think. But i need the progs file to test, halp!

edit: Errors are : "==" is not a type
and unknown value "s_explode1"

I dont know why explode is erroring. Its all in weapons.qc
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby leileilol » Wed Nov 17, 2010 11:55 pm

It's time you learn about some important compiler.
See the number by the error? That's the LINE NUMBER
go to the line number in the file and observe where you messed things up
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: It wont compile!!! Also some other issues

Postby frag.machine » Thu Nov 18, 2010 12:05 am

Karall wrote:Well it compiles but the progs.dat wont come up.... Its weird!
Also im having trouble with my code i think. But i need the progs file to test, halp!

edit: Errors are : "==" is not a type
and unknown value "s_explode1"

I dont know why explode is erroring. Its all in weapons.qc


Read this message made my head hurt. Badly.
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: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Karall » Thu Nov 18, 2010 4:45 pm

I could see why you say that xD I'm not good at all at QC...trying to learn tho >.>
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby Karall » Thu Nov 18, 2010 4:50 pm

Code: Select all
 void() W_FirePistol =
{
   local vector dir;

   sound (self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM);   

   self.punchangle_x = -2;
   
   self.currentammo = self.ammo_shells = self.ammo_shells - 1;
   dir = aim (self, 100000);
   FireBullets (50, dir, '0.01 0.01 0'); //This is the line to change
};


I cant find whats wrong with the code!
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby ceriux » Thu Nov 18, 2010 7:03 pm

if you look at the dialog that your compiler put out about your error. it'll even tell you which line the errors on =)
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Karall » Thu Nov 18, 2010 7:10 pm

Yea i know! I know what line its on, but i dont know what to change! Mainly becouse i dont know what "== is not a type" means
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby ceriux » Thu Nov 18, 2010 7:47 pm

copy the line of code that the error is on (just the line the compiler says) then paste it here.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Karall » Thu Nov 18, 2010 8:35 pm

Nevermind. I fixed it. As always when i code its a stupid little error that extremley easy to fix. Its just the matter of spotting it... Ile keep this thread if i get some more problems!
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby Karall » Thu Nov 18, 2010 8:40 pm

well yea, it compiles all and good. The game runs! But is it possible to give the weapon like the id number of 9? I bound impulse 9 to 9, also in changeweapon i set my pistol to self impulse 9. If there anything more i have to do? If not, how do i get my weapon? I tried give 9x but wont work. I also added the gun to cheat codes but i dunno what diffirence it makes.
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby ceriux » Thu Nov 18, 2010 8:43 pm

you might want to check this out: viewtopic.php?t=2084

and this : http://inside3d.com/showtutorial.php?id=60
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Karall » Thu Nov 18, 2010 8:49 pm

Well the second link is the one i tried to follow, at least quite a bit. I checked out yours too. But now the wont help me :(
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby ceriux » Thu Nov 18, 2010 8:59 pm

well the first link shows you how to set up a new weapon, you dont have to replace whats already there. you can copy a function and make your own from it. the 2nd should be a fairly easy tutorial. make sure you read each step slowly.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Karall » Fri Nov 19, 2010 8:27 pm

Argh. I can really get the code working. In the second tutorial to get the weapon theres a peice of code so when you get 100 shells you get a pistol or something. And i didnt want that so i didnt put that peice in. It compiles well and good. The shotgun isnt a weapon so thats a success. Just one tiny thing, how do i get my pistol!
Karall
 
Posts: 128
Joined: Thu Jul 15, 2010 5:23 pm

Postby ceriux » Fri Nov 19, 2010 11:00 pm

well how did you add your pistol in? cause what that tutorial does i think is if you have the shotgun and 100 shells you press 2 again and you get the next weapon so if you dont have the shotgun.

if your trying to select the weapon by impulses look at how an impulse is called, make ur impulse command be if you have shells and you have the pistol (.float has_pistol) or something. then self.weapon == IT_PISTOL. i know its not the code for you to look at. but you should be able to do something like what i explained.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest