Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Link to comment
Share on other sites

I can't really help regarding building fast, but regarding limitations, there is a Wiki page with all limits, like maximum step size, maximum slope angles etc.

 

 

Thank you both. :) I was thinking primarily of typical, right-angled stairwells, but that spiral staircase tutorial will also come in handy whenever I need to build the interior of a tower or such. B)

Link to comment
Share on other sites

Is it possible to remove a door mover entity from a brush door once you've added it ? I have a separate lock element to my door and I forgot to group it with the door brush while I was making said brush into a door entity. And now I'm not sure how to remove the entity from the brush and add it to all five brushes that the door consists of, sans handle.

 

Also, where does one find the Bind function in DR ? The tutorials describe it as if it was the easiest thing in the world, but the interface of the editor barely has any mention of a Bind function. Not even the Entity Inspector, where I'd expect it, nice and handy. It's rather frustrating trying to find the control for something as basic as attaching an entity handle to the brush door. A really weird thing to get stuck on.

  • Like 1
Link to comment
Share on other sites

You can right-click on the door entity and use "revert to worldspawn".

 

In order to bind an entity to another one, you give the entity to be bound the spawnarg "bind" with "target entity". See also the Wiki-page. I don't think that there is a button or something similar for that (but I may be mistaken). Would be a nice feature to have though. For "target" there is the option to select two entities and then hit "ctrl+k" to let the first on target the second one. Maybe the same would be possible for binding; e.g. "ctrl+b"?

  • Like 1
Link to comment
Share on other sites

You can right-click on the door entity and use "revert to worldspawn".

 

In order to bind an entity to another one, you give the entity to be bound the spawnarg "bind" with "target entity". See also the Wiki-page. I don't think that there is a button or something similar for that (but I may be mistaken). Would be a nice feature to have though. For "target" there is the option to select two entities and then hit "ctrl+k" to let the first on target the second one. Maybe the same would be possible for binding; e.g. "ctrl+b"?

 

D'oh, should have known it was that one option ! B)

 

I'm now having issues with grouping the four lock brushes and the door brush, turning them into door mover, then trying to move the centre of the mover entity. Moving the centre (to the corner of the door) doesn't work now, whereas it had previously, when I only used the main door brush. But I can't leave the door brush without the lock brushes attached. The door without them looks unconvincing and they'll just float in the air if I don't couple them with the main door brush.

 

Is there no way to merge the brushes into a single door and then set this composite door to work together as a single entity ?

Edited by Petike the Taffer
  • Like 1
Link to comment
Share on other sites

Select all the brushes, right-click, create entity. Or export them as model and use that instead. Btw, there are plenty of door models and prefabs shipped with tdm.

  • Like 1

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I'm now having issues with grouping the four lock brushes and the door brush, turning them into door mover, then trying to move the centre of the mover entity. Moving the centre (to the corner of the door) doesn't work now, whereas it had previously, when I only used the main door brush. But I can't leave the door brush without the lock brushes attached. The door without them looks unconvincing and they'll just float in the air if I don't couple them with the main door brush.

 

Is there no way to merge the brushes into a single door and then set this composite door to work together as a single entity ?

I am not sure what the problem with the origin is, but it might be that this works only for entities made from a singel brush. You could make one entity for the door (that should have the option to move the origin) and another entity for the remaining parts. Then you could bind the "remaining parts" entity to the door. For better handling you could additionally group the two entities in DR. That way you also always move all the parts at once.

  • Like 1
Link to comment
Share on other sites

I am not sure what the problem with the origin is, but it might be that this works only for entities made from a singel brush. You could make one entity for the door (that should have the option to move the origin) and another entity for the remaining parts. Then you could bind the "remaining parts" entity to the door. For better handling you could additionally group the two entities in DR. That way you also always move all the parts at once.

 

Yes.

 

post-35080-0-74720800-1509373674_thumb.png

 

Anyway, here's my door design. The handle is a prefab entity, the rest are custom textured brushes made by me (a total of 5 - one large, four small).

 

Which property needs to be modified to allow for binding of the handles to the door ? Because my main issue is that I can't even figure out where to write the Bind spawnarg in the Entity Inspector. The wiki says "Bind it" about objects like handles, but never explains which part of the interface one needs to use for the binding action.

  • Like 1
Link to comment
Share on other sites

Nothing really.

Your Door entity will have an entity name, like door01

You just have to add bind door01 to the handle.

Select the door handle, open the Entity Inspector with "n" on the keyboard.

There's 2 white boxes at the bottom. In the first one type bind

In the second one type the name of your door entity eg door01

Then click the check box to set the new property.

  • Like 2

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Did not see that. Good to know :)

 

 

Nothing really.

Your Door entity will have an entity name, like door01

You just have to add bind door01 to the handle.

Select the door handle, open the Entity Inspector with "n" on the keyboard.

There's 2 white boxes at the bottom. In the first one type bind

In the second one type the name of your door entity eg door01

Then click the check box to set the new property.

You could also right-click in the entity editor and Select "Add Property", then go to the "Links" folder and select the "Bind" spawnarg there. But simply typing it or the method VanishedOne wrote is actually quicker.

  • Like 1
Link to comment
Share on other sites

 

Actually DR does have a menu shortcut for binding:

 

  1. select intended bind child
  2. additionally select intended bind master
  3. in the top menu bar, go to Entity --> Bind selected entities

 

 

Yeah, I know of that one example, but wasn't sure about the exact order in which to bind things. Thank you for clearing that up ! :)

Link to comment
Share on other sites

I've now gotten to a point where most of my geometry in my map is complete. -phew-... but now comes the "tricky" parts, so I will probably start having questions for those more seasoned.

The first thing I want to ask is how to add a custom decal to my map. It's basically a "painting" directly on wood with many transparent parts. Anyway, I have made it in GIMP and the transparent parts are black. I saved it as jpg and tried putting it into my project files in the correct folder, but it's not showing up in DR. Am I missing a step? Do I need to give it the full treatment like a custom texture? Is there a special file format?

 

Secondly a matter of artistic integrity... How do we feel about copy-pasting from other FMs? Not whole sections of course, more like patch-objects, light ray effects and those kind of things. Credit always? Ask first? Or just treat it as GPL?

Thanks :)

My Fan Missions:

   Series:                                                                           Standalone:

Chronicles of Skulduggery 0: To Catch a Thief                     The Night of Reluctant Benefaction

Chronicles of Skulduggery 1: Pearls and Swine                    Langhorne Lodge

Chronicles of Skulduggery 2: A Precarious Position              

Chronicles of Skulduggery 3: Sacricide

 

 

 

Link to comment
Share on other sites

Jpg format isn't supported. You have to use targe (tga). Make sure you have added an alpha channel to the image if you want parts to be transparent.

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Actually jpegs should load in both DR and TDM, but they're normally used only as DR editor images. Otherwise FlakeBridge Monastery is the only FM I know of that uses them; I think they're discouraged because of compression artefacts or similar.

Would 'the full treatment' involve writing a material definition? In that case, yes, you'll need one of those.

As for copying stuff, I would ask the mappers involved (not least because they may have got parts of those map assets from elsewhere, under someone else's permission).

Light rays are actually pretty simple to make with the built-in assets. Try this prefab: http://forums.thedarkmod.com/topic/10764-moon-ray/?do=findComment&comment=211589 Edit: or this one: http://forums.thedarkmod.com/topic/11266-moonlight-through-windows/?do=findComment&comment=220106

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I recently had a go at sketching a street layout to use as a background image, but it's behaving strangely. When I hold the right mouse button to pan the view (top), the image stays in the same place. When I move the view dividers, the image scales up/down whereas the brushes don't.

 

Here's a video showing the problem, and at the end is a clip from Blender, showing how background images should behave.

 

Is there a way to always keep the image in synch with the brushes without having to keep adjusting the image parameters?

Link to comment
Share on other sites

I'm trying to get a better handle on how the RGB stage keywords affect specular highlights. So far I've found the following:

  • Specular highlights are strongly affected by RGB in diffuse stages. This is independent of the result of multiplying RGB by the diffusemap: you can have _black as the diffuse and still manipulate specular highlights with RGB in the diffuse stage. (For this post I'm using _black for diffuse and _white for specular, and no bumpmap.)
  • Specular highlights are affected by RGB in the specularmap stage, but in this case there's a sharp cutoff somewhere. rgb sinTable[time] in the diffuse stage gives smooth fading. In the specular stage it gives an abrupt on/off toggle.

Some searching brought me to the following discussions...

 

http://forums.thedarkmod.com/topic/11893-ungoliants-mapping-questions/page-2?do=findComment&comment=242920

http://forums.thedarkmod.com/topic/11893-ungoliants-mapping-questions/page-13?do=findComment&comment=333331

 

...and from those clues I found that both (1) and (2) above are true only of the enhanced interaction shader.

 

The thing I still don't understand after reading the explanations in the linked thread is where the RGB of the diffuse stage comes into play.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

In the interaction shader, there is a multiplication of the specular term (fresnel term) with the already calculated pixel color (which is the product of the diffuse map with the light, modified by the different angles that comes into play). As the diffuse is multiplied with the color parms in the material shader, this multiplication is handled over to the specular stage.

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

One more question about door meshes and entities:

 

If I'm converting parts of the door that will represent the lock from a worldspawn brush to an entity, what entity should I choose ? Originally, I chose the same entity as for the main door brush (i.e. the textured brush door itself, without the doodads) when I was converting it to a door entity. But that caused issues, such as me not being able to move the rotation point of the door entity (forcing it to rotate in the middle, which of course looks ridiculous). I can adjust the rotation towards a hinge just fine, but not when the brushes representing the lock are converted to the same entity and bound to the door. And I'm sure I must be doing something wrong.

Link to comment
Share on other sites

Make it a func_static and bind it to the door.

  • Like 1

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

In the interaction shader, there is a multiplication of the specular term (fresnel term) with the already calculated pixel color (which is the product of the diffuse map with the light, modified by the different angles that comes into play). As the diffuse is multiplied with the color parms in the material shader, this multiplication is handled over to the specular stage.

But if your diffusemap is _black then multiplication by anything will result in 0 0 0. Is the difference entirely down to the angle modification?

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I had a look at the new GLSL interaction fragment shader from the 2.06 beta.

 

I seems to use a different test to decide whether to apply the default 0.026 specularity. rgb sinTable[time] no longer causes the specular stage to blink on/off.

 

I'm unsure without trying whether map _black alone to disable the default specularity will still work (is it testing for rgb 0 instead?).

 

(I haven't confirmed that it does work under ARB; it's something from the previously linked thread.)

 

I noticed that this bit...

// fresnel part, ported from test_direct.vfp

...

color = color * light * var_Color.rgb * u_diffuseColor.rgb * lightColor();
return  color;

...seems to multiply by the diffuse colour as nearly the last thing it does before returning, which matched my impression that the enhanced shader (both ARB and GLSL) scales the highlights by the diffuse RGB.

 

I experimentally modified it to be more like the simple interaction shader:

 

 

 

vec3 advancedInteraction() {
	vec4 fresnelParms		= vec4( 1.0, .23, .5, 1.0  );			
	vec4 fresnelParms2		= vec4( .2, .023, 120.0, 4.0 );
	vec4 lightParms			= vec4( .7, 1.8, 10.0, 30.0 );

	// compute the diffuse term    
	vec3 color = texture2D( u_diffuseTexture, var_TexDiffuse ).rgb * u_diffuseColor.rgb;

	// compute the specular term
    float specularPower = 10.0;
    float NdotH = clamp( dot( N, H ), 0.0, 1.0 );
    float specularContribution = pow( NdotH, specularPower );
	vec3 specular = texture2D( u_specularTexture, var_TexSpecular ).rgb * u_specularColor.rgb;

	// fresnel part, ported from test_direct.vfp
	vec3 fresnelTerm = vec3(pow(1.0-dot(normalize(var_tc6), RawN), fresnelParms2.w));
	vec3 R1 = vec3(min(NdotL - 0.3, fresnelParms.z));
	vec3 rimLight = R1 * fresnelTerm * lightParms.y;
	vec3 R2 = vec3(0.026);
	if (dot(u_specularColor, u_specularColor) > 0.0)
		R2 = specular;
	R1 = vec3(dot(normalize(normalize(var_tc0)+normalize(var_tc6)), RawN));
	float R2a = mix(lightParms.z, lightParms.w, R2.z);
	R1 = vec3(pow(R1.x, R2a));
	R1 = R1 * fresnelParms2.z;	
	vec3 R3 = vec3(fresnelTerm.x * fresnelParms.y + fresnelParms2.y);	
	R1 = R1 * R3;
	R3 = color * 0.25;
	R3 = R2 * R3;
	R3 = R2 * 0.75 + R3;
	R1 = R1 * R3;
	vec3 LM = normalize( var_tc0 ); 
	float R2f = min(1.0, max(0, LM.z * 4.0));
	vec3 light = clamp((rimLight * R2f + vec3(NdotL)), 0.0, 1.5);
	// vec3 light = rimLight * R2f + vec3(NdotL);
	color = R1 * R2f + color;
 	color = color * light * var_Color.rgb * lightColor();
	return  color;
}   

 

 

 

Since I don't really know what I'm doing here I've probably broken something else, but it does seem the diffuse and specular stage RGBs can be disentangled like this.

Edited by VanishedOne
  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Actually jpegs should load in both DR and TDM, but they're normally used only as DR editor images. Otherwise FlakeBridge Monastery is the only FM I know of that uses them; I think they're discouraged because of compression artefacts or similar.

 

Would 'the full treatment' involve writing a material definition? In that case, yes, you'll need one of those.

 

As for copying stuff, I would ask the mappers involved (not least because they may have got parts of those map assets from elsewhere, under someone else's permission).

 

Light rays are actually pretty simple to make with the built-in assets. Try this prefab: http://forums.thedarkmod.com/topic/10764-moon-ray/?do=findComment&comment=211589 Edit: or this one: http://forums.thedarkmod.com/topic/11266-moonlight-through-windows/?do=findComment&comment=220106

 

Thanks for the information, however I am running in to problems getting my decal to load in game. It loads in the editor just fine, but ingame it's just transparent. I saved the image as TGA with an alpha channel, and wrote a material definition file. Although there is no information on the wiki pertaining to decals specifically. It only talks about textures with their normal maps, bump maps and speculars which I hope I am right in assuming don't apply to decals. Logically all I would have to do is point the game toward the image file, right? My material file nonetheless seems kind of short, or?

 

 

textures/darkmod/decals/panel_couple_music

{

 

 

qer_editorimage textures/darkmod/decals/panel_couple_music_ed

 

 

 

}

 

All of the files are in their correct folders and there are no typos in the mtr file. What am I missing?

My Fan Missions:

   Series:                                                                           Standalone:

Chronicles of Skulduggery 0: To Catch a Thief                     The Night of Reluctant Benefaction

Chronicles of Skulduggery 1: Pearls and Swine                    Langhorne Lodge

Chronicles of Skulduggery 2: A Precarious Position              

Chronicles of Skulduggery 3: Sacricide

 

 

 

Link to comment
Share on other sites

qer_editorimage holds the reference to the image to be used in DR. TDM ignores it. You have to specify how it should be rendered in TDM. This depends of the kind of decal.

 

There are basically two types:

  • dirt decals that darken the surfaces that they are applied on, those normally use blend filter
  • decals to be used for detail pieces, like fences, those normally use an alpha-tested diffuse stage

The best approach (like always) is to check the material definitions of stock decals that behave like you want it to see how it is done.

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

If the decal is meant to use alpha, and isn't meant to be alphatested (fully opaque or fully invisible depending on whether alpha > a threshold value; allows diffuse/specular/bump light interactions on the opaque pixels), then you may be looking for an alpha-related blend.

name/of/decal
{
DECAL_MACRO //activates some stuff decals often use	
	{
		blend blend // alias for blend gl_src_alpha, gl_one_minus_src_alpha
		// which is (your image's RGB * its alpha) + (the colour of the surface below * one minus your image's alpha)
		map path/to/image
	}
}

Here light interaction will only be with the colour you get from the surface below, so depending on your needs you may encounter unwanted glow-in-the-dark effects. (This is why Obsttorte's talking about darkening and suggesting blend filter, which doesn't use alpha but multiplies the decal colour by the colour of the surface below. ) If you give us more information about the intended look we might be able to suggest a suitable blend mode.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
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.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...