Jump to content
The Dark Mod Forums
demagogue

Newbie DarkRadiant Questions

Recommended Posts

From the top of my head I would say via a stim/response with hit on player? Then run a script, that teleports the player and heals the damage?

Share this post


Link to post
Share on other sites

Yep.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

I am finalising a collection of twenty new decal textures, and there is a problem with the transparency:

post-2023-0-79977400-1463427622_thumb.jpg

I saved the decals as DDS images, and used the standard TDM decals as the template for the material file. In GIMP, they show up with a proper transparent background, but in the game, they have a black outline. How do I fix this?


Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Share this post


Link to post
Share on other sites

Even if the border is 100% transparent, the foreground color seems to affect the engine.

Try setting the transparent border to white while leaving the alpha channel in that region 100% transparent.


Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Share this post


Link to post
Share on other sites

How do I do that? That region is just... well... empty. There is no colour there, since I turned it into an alpha channel.


Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Share this post


Link to post
Share on other sites

I am finalising a collection of twenty new decal textures, and there is a problem with the transparency:

I saved the decals as DDS images, and used the standard TDM decals as the template for the material file. In GIMP, they show up with a proper transparent background, but in the game, they have a black outline. How do I fix this?

 

In theory I don't think it should make any difference whether you use dds or tga. Which material did you use as a template? The clue might lie in there. Quite a few TDM decals depend on blending tricks that don't use the alpha channel from the image file at all.

 

Unfortunately I don't think it's possible to have proper alpha transparency on solid materials that are affected by lights, and you'd need these signs to be opaque and lit. Our lit transparent materials are all translucent, like cobwebs, water ripples and glass that add an extra layer of brightness to the background without blocking it out. Can you stretch the image to fill the quad instead? if you need a frayed edge you can use an alphatest material instead. The edge won't be as smooth-looking as an alpha-blended image, but it's a way to get a wobbly edge from a flat quad.

Share this post


Link to post
Share on other sites

I, uh, don't understand half of that, but here is how an entry looks like in my material file:

textures/darkmod/decals/papers/whale
{
  surftype15
  description "paper"
	nonsolid
	noshadows
  	{
     blend diffusemap
       map textures/darkmod/decals/papers/whale
       alphaTest 0.5
	}

	// TDM Ambient Method Related 
	{							
		if (global5 == 1)		
		blend add				
		map				textures/darkmod/decals/papers/whale
		scale			1, 1		
		red				global2	
		green			global3	
		blue			global4	
	}							
	{							
		if (global5 == 2)		
		blend add				
		program	ambientEnvironment.vfp	
		vertexParm		0		1, 1, 1, 1		// UV Scales for Diffuse and Bump	
		vertexParm		1		1, 1, 1, 1	// (X,Y) UV Scale for specular		
		vertexParm		2		global2, global3, global4, 1	
																
		fragmentMap		0		cubeMap env/gen1				
		fragmentMap		1		_flat			// Bump				
		fragmentMap		2		textures/darkmod/decals/papers/whale			// Diffuse			
		fragmentMap		3		_black			// Specular			
	}
}

...and here is the .dds image (renamed as a txt so I could upload it)

whale.txt

 


Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Share this post


Link to post
Share on other sites

How do I do that? That region is just... well... empty. There is no colour there, since I turned it into an alpha channel.

 

I can try to adjust the image if you send me a copy.

You basically need to flatten the image and bucket fill the border white then create an new alpha channel

and use a region select to copy the region to the alpha layer.

 

Yes, this would typically be an alphatest material.

 

I will note that when I played with the other paper decals, the Decalmacro keyword caused problems with transparency. But as you said that

you are using the default material that shouldn't matter.

 

 

Edit:

 

Thanks for the goods. I can look tonight.

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Share this post


Link to post
Share on other sites

Thanks! :) I have sent you a PM with the rest of the files.


Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Share this post


Link to post
Share on other sites

If nbhor has a problem I can have a look, I am fairly certain the black bits around the edge just need to be made a transparent alpha.

Share this post


Link to post
Share on other sites

I made a custom texture (like a briar patch) and a custom material file that I copied & adapted from another texture like it. I can get it into my map just fine, looks fine in the editor, but now when I dmap I get a leak and the pointfile draws right through the brushes with that texture. I just want to confirm, is that because of my texture (otherwise I don't know why the pointfile is going through brushes), and if so anyone know offhand what's I'm missing?

 

Edit: with testing, it's definitely the texture. If the brush is like an internal wall, the pointfile passes through, but it's not a leak. It's only a leak if the wall with that texture is against the void ... of course.

 

Edit2: Well now that texture renders trippy as hell, like rainbow caulk. So... I'm guessing it's a problem with the .mtr.

 

 

 

textures/red/bramble_large_01
{
surftype15
description "foliage"

qer_editorimage textures/red/bramble_large_01_ed
diffusemap _black
bumpmap _black

{
if ( parm11 > 0 )
blend gl_dst_color, gl_one
map _white
rgb 0.40 * parm11
}
{
if ( parm11 > 0 )
blend add
map textures/red/bramble_large_01
rgb 0.15 * parm11
}

// TDM Ambient Method Related
{
if (global5 == 1)
blend add
map textures/red/bramble_large_01
scale 1, 1
red global2
green global3
blue global4
}
{
if (global5 == 2)
blend add
program ambientEnvironment.vfp
vertexParm 0 1, 1, 1, 1 // UV Scales for Diffuse and Bump
vertexParm 1 1, 1, 1, 1 // (X,Y) UV Scale for specular
vertexParm 2 global2, global3, global4, 1

fragmentMap 0 cubeMap env/gen1
fragmentMap 1 _black // Bump
fragmentMap 2 _black // Diffuse
fragmentMap 3 _black // Specular
}
}

textures/red/bramble_small_01
{
surftype15
description "foliage"

qer_editorimage textures/red/bramble_small_01
diffusemap _black
bumpmap _black

{
if ( parm11 > 0 )
blend gl_dst_color, gl_one
map _white
rgb 0.40 * parm11
}
{
if ( parm11 > 0 )
blend add
map textures/red/bramble_small_01
rgb 0.15 * parm11
}

// TDM Ambient Method Related
{
if (global5 == 1)
blend add
map textures/red/bramble_small_01
scale 1, 1
red global2
green global3
blue global4
}
{
if (global5 == 2)
blend add
program ambientEnvironment.vfp
vertexParm 0 1, 1, 1, 1 // UV Scales for Diffuse and Bump
vertexParm 1 1, 1, 1, 1 // (X,Y) UV Scale for specular
vertexParm 2 global2, global3, global4, 1

fragmentMap 0 cubeMap env/gen1
fragmentMap 1 _black // Bump
fragmentMap 2 _black // Diffuse
fragmentMap 3 _black // Specular
}
}

 

 


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

The material type is foliage. I am not sure whether this type seals against the void, as it is normally used on top of other surfaces. You have used _black as a bumpmap, which cannot work. You have to use _flat. Please remove the if(global5 ==2) part in the materials, it is not needed.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

I fixed those things. (For the record the hedge uses foliage and it seals, but changed it anyway to see.) Problem remains. It's in .tga format, 512^2 size. Looks fine in editor. Looks like this in game:

33wr31v.jpg

 

Edit. Used .dds format. Still looks the same.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Well, your shader only renders the _black image. You have to set the diffusemap to your image file to get it displayed.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

Ah. I fixed that now. Unfortunately it still renders borked up like before. Double checked everything & I'm stumped now. I packaged it all in a pk4 if you want to take a look. The map opens with all the borked walls visibly in front of you. (Link deleted)


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

If they are I can't see where. I did 'compare' with a working mtr def and the file addresses are the only difference, and those are ok. And I don't see anything obviously wrong with the dds files. And what else even is there?

 

I thought maybe DR wasn't updating changes, so I deleted & redid it all and clicked reload materials, etc, and ran off the pk4, but that didn't change anything either. I posted a pk4 above. All I could think to do now. Even confirming it on another system would help.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Hmm.

 

Well to reduce the trouble-shooting complexity, get rid of the " if (global5 == 2)" stanza.

That is no longer used as of 2.01.

 

I can't see anything else wrong so I suspect you are seeing UV mapping errors?


Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Share this post


Link to post
Share on other sites

That's already done.

 

So, I used a TDM texture with its own mtr, put it in my own folder as if custom, and I got the borking. It works when it's in the tdm folder-tree. That's officially nuts. I guess it's some little hard-to-see typo or something.

 

It has the colors of the texture (the above screenshot too). And if you change the scale, the borking lines change accordingly. So something's getting through. What causes bad uv mapping? And does anyone else see it in that pk4?


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Have you re-dmapped since updating the materials?

 

The keyword to make a material seal against the void is forceOpaque. It goes up top with surftype and description. You don't always need it, but the keyword will make even pure transparent blend materials seal.

 

I've seen that borking mostly when messing with cubemaps, but I can't remember how I fixed it. It was something silly like re-dmapping.

Share this post


Link to post
Share on other sites

Heh, I re-dmap like 3 times every time I test something. But I do suspect it's something obvious like that.

 

@Bikerdude, I gave a link to a test map above, 7 posts up, but I PM'd it too. Anyone else can look at it from the above link too.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

I am tired and possibly dumb, and the wiki has failed me. Which flag do I use on a looping ambient sound if I only want it to repeat after a certain number of time?


Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...