Forum

Basic Half-Life Map Support For Stock GLQuake

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

Moderator: InsideQC Admins

Postby Team Xlink » Tue Feb 02, 2010 2:31 am

I didn't mean you at all.
Team Xlink
 
Posts: 368
Joined: Thu Jun 25, 2009 4:45 am
Location: Michigan

Postby LonePossum. » Tue Feb 02, 2010 3:06 am

Could anyone do a tutorial on it o_O.
LonePossum.
 
Posts: 38
Joined: Mon Nov 02, 2009 11:07 am

Postby Ranger366 » Fri Mar 19, 2010 6:03 pm

I have to thank Baker so much, for all this stuff he did (This is the only Source on the web for implenting HL BSP Support)
and wanna ask about fixing this sucked up lightning, in Lord Havoc's DarkPlaces Engine everyhing is ok. Im no programmin newbie, but in this Section i need abit help...
I have a very bad past about cutting code out of other engines.
and sry for my bad english, greetings and thanks to Baker, for all his usefull stuff.
User avatar
Ranger366
 
Posts: 203
Joined: Thu Mar 18, 2010 5:51 pm

Postby Teiman » Fri Mar 19, 2010 7:56 pm

Ranger366 wrote:I have to thank Baker so much, for all this stuff he did (This is the only Source on the web for implenting HL BSP Support)
and wanna ask about fixing this sucked up lightning, in Lord Havoc's DarkPlaces Engine everyhing is ok. Im no programmin newbie, but in this Section i need abit help...
I have a very bad past about cutting code out of other engines.
and sry for my bad english, greetings and thanks to Baker, for all his usefull stuff.


He..... his a new guy!.. wellcome :-)
Ask anything you need :-)
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby Ranger366 » Sat Mar 20, 2010 5:43 pm

Teiman wrote:
Ranger366 wrote:I have to thank Baker so much, for all this stuff he did (This is the only Source on the web for implenting HL BSP Support)
and wanna ask about fixing this sucked up lightning, in Lord Havoc's DarkPlaces Engine everyhing is ok. Im no programmin newbie, but in this Section i need abit help...
I have a very bad past about cutting code out of other engines.
and sry for my bad english, greetings and thanks to Baker, for all his usefull stuff.


He..... his a new guy!.. wellcome :-)
Ask anything you need :-)


Thanks :D

Im currently working on a secret Project, but already made alot Menu Stuff alone, and all this QC Code. I wanted to implent HL BSP because mapping is the easiest in HL for me, and Textures have MUCH better quality, but it only looks OK if i compile the map without Rad. (like on the pic shown 2 pages ago, light sucked up)
and i wanted to fix that, but Engine Coding with Stuff i never worked in my whole life. And in DarkPlaces i cant cut the Code out, i only see much much much modified Code.
So i wanted to ask for some advice for fixing this light stuff. I dont have much time, and it would be awesome if i could get a fix, alot thanks from me, and im really sry about my english, im a german guy who works alot.
User avatar
Ranger366
 
Posts: 203
Joined: Thu Mar 18, 2010 5:51 pm

Postby Hazematman » Sat Jul 17, 2010 5:16 am

whenever I compile with step 13 I always get an "if" statement syntax error, that I can't seem to fix. Does anyone know how to fix this?
User avatar
Hazematman
 
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Postby Baker » Sat Jul 17, 2010 10:37 am

Hazematman wrote:whenever I compile with step 13 I always get an "if" statement syntax error, that I can't seem to fix. Does anyone know how to fix this?


Revert your file to the original and re-do steps 12a, 12b and 13 so you don't have the problem?

An alternative is to post your exact error and the exact code that you have the issue with, but just saying "I get an if statement error" is not enough information for anyone to help you.

That being said ... make sure you aren't missing a "curly brace" ("{" or "}") somewhere.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Hazematman » Sat Jul 17, 2010 4:45 pm

ok the code is

Code: Select all
if (loadmodel->bspversion == HL_BSPVERSION) {
int i;
loadmodel->lightdata = Hunk_AllocName(l->filelen, loadname);
// dest, source, count
memcpy (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);

// Cheat!
// Run thru the lightmap data and average the colors to make it a shade of gray, haha!
for (i=0; i<l->filelen; i+=3)
{
int grayscale;
byte out;
grayscale = (loadmodel->lightdata[i] + loadmodel->lightdata[i+1] + loadmodel->lightdata[i+2])/3;
if (grayscale > 255) grayscale = 255;
if (grayscale < 0) grayscale = 0;
out = (byte)grayscale;
loadmodel->lightdata[i] = loadmodel->lightdata[i+1] = loadmodel->lightdata[i+2] = out;
}
return;
}


and this is the error i keep getting: 1>.\gl_model.c(522) : error C2059: syntax error : 'if'

oh and if it helps line 522 is the first line in that code.
User avatar
Hazematman
 
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Postby mh » Sat Jul 17, 2010 6:17 pm

Post the 5 to 10 lines your code that come before it. ;)
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Baker » Sat Jul 17, 2010 6:56 pm

mh wrote:Post the 5 to 10 lines your code that come before it. ;)


Yeah, what he said ^^^

I've checked your block of code, it is fine. It is something like a missing curly brace ABOVE that block of code. Or maybe a semi-colon.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Hazematman » Sat Jul 17, 2010 7:08 pm

ok thanks I found the problem, I was missing this:

Code: Select all
loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
memcpy (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);
}


lines of code after that.
User avatar
Hazematman
 
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Postby Hazematman » Sun Jul 18, 2010 1:21 am

Im trying to do spike's fix and I can get the first part done fine but I can't find the msurface_t lightofs field to divide by 3. Can anyone show me what to do?
User avatar
Hazematman
 
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Postby mh » Sun Jul 18, 2010 2:41 am

Hazematman wrote:Im trying to do spike's fix and I can get the first part done fine but I can't find the msurface_t lightofs field to divide by 3. Can anyone show me what to do?

Are you using GLQuake or something based on WinQuake? WinQuake doesn't have lightofs. If you're using GLQuake you should delete model.h from your project.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Hazematman » Sun Jul 18, 2010 2:47 am

Im not entirely sure what what you mean. its winquake being compile under GL release (I believe). but if I do a project search I can find two places where lightofs is used.
User avatar
Hazematman
 
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Postby gnounc » Sun Jul 18, 2010 4:11 am

zat mean you're back then?
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

PreviousNext

Return to Programming Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest