new contents (custinfoparms.txt)


(fretn) #1

I want to add a new content like you have (CONTENTS_WATER) lets call it CONTENTS_NEW

I do this:

in surfaceflags.h:

#define CONTENTS_NEW 0x100000000

in bg_pmove.c:

in static void PM_SetWaterLevel( void )
I add this:

if ( cont & CONTENTS_NEW ) {
Com_Printf(“IN NEWn”);
} else
Com_Printf(“NOT IN NEWn”);

I change the ‘surfaceparm water’ in a water shader to ‘surfaceparm newcontent’.

in custinfoparms.txt I add a flag:

newcontent 0x100000000


and it won’t work… when I’m in the CONTENTS_NEW brush I recieve the message ‘NOT IN NEW’

if I change the surfaceparm back to water in that shader and the CONTENTS_NEW in CONTENTS_WATER in bg_pmove.c :

if ( cont & CONTENTS_WATER ) {
Com_Printf(“IN NEWn”);
} else
Com_Printf(“NOT IN NEWn”);

I recieve the ‘IN NEW’ message when I’m in the CONTENTS_WATER brush…

what I’m doing wrong to detect when I’m in a new contents-thing.

If I do the same with new surface-flags, it works fine, but not with these new contents-flags …

thanks !


(digibob) #2

could you paste the entire contents of your custuminfoparms txt file?


(fretn) #3

// Custom Infoparms File
// Custom Contentsflags
{
mudcontent 0x100000000
}
// Custom Surfaceflags
{
mud 0x80000000
}


the mudcontent-contentsflag isn’t working

the mud-surfaceflag works

thanks


(digibob) #4

Oops, just noticed

0x100000000

count the 0s… that’s 8… you’d need a 33bit (64 really) integer for that value :smile:

i.e. you’ll need to use a lower value.


(fretn) #5

woohoo, it works !

thank you !!!


(ydnar) #6

You can have “mud” be in both surface and content sections of the custinfoparms.txt file. A seperate “mudcontents” surfaceparm isn’t necessary.

y


(fretn) #7

cool, thanks

fretn