Basic Half-Life Map Support For Stock GLQuake

Post tutorials on how to do certain tasks within game or engine code here.
Team Xlink
Posts: 368
Joined: Thu Jun 25, 2009 4:45 am
Location: Michigan

Post by Team Xlink »

I didn't mean you at all.
LonePossum.
Posts: 38
Joined: Mon Nov 02, 2009 11:07 am

Post by LonePossum. »

Could anyone do a tutorial on it o_O.
Ranger366
Posts: 203
Joined: Thu Mar 18, 2010 5:51 pm

Post by Ranger366 »

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.
Teiman
Posts: 311
Joined: Sun Jun 03, 2007 9:39 am

Post by Teiman »

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 :-)
Ranger366
Posts: 203
Joined: Thu Mar 18, 2010 5:51 pm

Post by Ranger366 »

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.
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Post by Hazematman »

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?
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

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 ..
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Post by Hazematman »

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.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

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
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

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 ..
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Post by Hazematman »

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.
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Post by Hazematman »

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?
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

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
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Post by Hazematman »

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.
gnounc
Posts: 428
Joined: Mon Apr 06, 2009 6:26 am

Post by gnounc »

zat mean you're back then?
Post Reply