View previous topic :: View next topic |
Author |
Message |
Fragasaurus
Joined: 07 Jun 2010 Posts: 2
|
Posted: Mon Jun 07, 2010 10:30 pm Post subject: Error compiling QW progs, but NQ progs compile fine. |
|
|
G'day all.
As a means to learn programming, I've decided to start by modding Quake(World) a bit. After all, I've been playing QW on and off since around '97 or '98, so it's something I know a bit about.
So I grabbed the CleanQCC sources (for both Netquake and QuakeWorld) and started tinkering. After doing a few of the tutorials here, I've started getting errors on the QW side.
Particularly, with the Weapon Naming tutorial, the compiler errors out when doing it with QW, yet making the same changes to the NQ source compiles fine.
This is the code I used to test it.
Code: |
/*
============
WeaponName
============
*/
void() WeaponName =
{
local string weaponName;
if (self.weapon == IT_AXE)
weaponName = "Axe";
else
weaponName = "You're a lamer.";
sprint(self, weaponName);
sprint(self, "\n");
};
|
When adding to the QW source, I get this error:
Code: |
Source file: progs.src
outputfile: ../qwprogs.dat
compiling defs.qc
compiling subs.qc
compiling combat.qc
compiling items.qc
in function key_touch (line 1140),
items.qc:1151: warning: You may wish to add brackets after that ! operator
compiling weapons.qc
in function WeaponName (line 1013),
weapons.qc:1021: error: type mismatch on parm 2 - (string should be float)
defs.qc:625: sprint is defined here
in function CheatCommand (line 1110),
weapons.qc:1134: warning: CheatCommand: contains unreachable code
************ ERROR ************
Errors have occured
Error in weapons.qc on line 1368
|
Works fine with the NQ source.
I'm using FTEQCC (from SVN) since it's conveniently in the repos of my Linux distro. Should I try another compiler?
I'm not looking for a fix here. As this is entirely a learning experience for me. What I am interested in is knowing why this doesn't work in QuakeWorld.
Could someone explain this?
FYI, the line numbers in the compiler output are not at all the ones shown in the code. I think it's related to converting between Windows and Linux text formats. Regardless, it's not important right now.
Please forgive the ignorant noob flavour of this post.
Cheers, and thanks,
Mat |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Tue Jun 08, 2010 12:19 am Post subject: |
|
|
look up the definition of sprint in both copies of defs.qc. it differs between NQ and QW.
They wouldn't need to use different progs files if the contents were not different! _________________ What's a signature? |
|
Back to top |
|
 |
Fragasaurus
Joined: 07 Jun 2010 Posts: 2
|
Posted: Tue Jun 08, 2010 4:00 am Post subject: |
|
|
Oh, cool. Guess I'm one RTFM closer to some kind of enlightenment. Does "level" just control if a message is filtered by the msg console variable?
Thanks, Spike. Timely and concise as ever. |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Tue Jun 08, 2010 10:19 am Post subject: |
|
|
yup, just a filter _________________ What's a signature? |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|