Jump to content
The Dark Mod Forums
Sign in to follow this  
R Soul

Skins and nodraw materials

Recommended Posts

I'm currently making a custom button, in the style of the one we see in "the other game", but I've hit a snag. I want to provide the option of using a skin to give the button a label (e.g. floor number for a lift).

 

The metal housing and the button are in one texture, with one material, so it seemed logical to create a plane over the button with the material textures/common/nodraw.

 

I've already made a few skin files so I know how they work. My intention was to allow the nodraw material to be replaced, but when I try that I can't see the replacement. In DR the plane is solid white, and in game it's invisible. I could only get the skin to work when the default material was a conventional one (e.g. a brick wall), which defeats the purpose - I'd like the button to be blank by default, and I don't want the user replacing the entire button texture because it's 1024 x 512.

 

Can a plane be genuinely unrendered unless a skin changes its material?

Share this post


Link to post
Share on other sites

A button texture of 1024 x 512 really sounds like overkill.

 

But why not just texture the model with the first label, and then use skins to switch to the other labels?

Share this post


Link to post
Share on other sites

Yes, a plane can remain invisible for effects such as you propose. I've done it when I had on/off effects for transformers and engines. Can you post your skin file so I can compare it with my working version? It just sounds like a typo or something but yeah it definitely works so as long as the skin file isn't doing anything strange.

Share this post


Link to post
Share on other sites

I can confirm this bug, I was looking to provide 2 different seat textures with different uv-maps on my stagecoach by making 1 start visible and the other 1 start as nodraw, then swap them around by skin. It worked ok in the editor but the faces which started nodraw never showed up ingame.

 

I've simplified the setup by making a nodraw box model and skinning it with a regular wall texture. Same result: works in editor, invisible ingame. Making a small test package of this for the bugtracker was on my todo list.

Share this post


Link to post
Share on other sites

A button texture of 1024 x 512 really sounds like overkill.

 

But why not just texture the model with the first label, and then use skins to switch to the other labels?

The metal housing is 512x512, with another 512x512 for the button itself. I've reduced the total size to 512x256 and scaled down the two models to 0.75. It's still big enough to look chunky, but shrinking the model more or less cancels out the loss of texture resolution.

 

It's not my intention to release a reskinable labelled button. It's a plain button with support for an optional label.

 

 

Maybe the texture scale is wrong. Did you fit the nodraw texture to the plane?

The texture scale is correct (fits the nodraw plane perfectly)

 

 

I can confirm this bug.

Thanks, although I would have preferred the opposite :D

 

Skin example:

skin tdm_button1_test
{
	model models/darkmod/mechanical/switches/button1_press.lwo
	textures/common/nodraw textures/darkmod/stone/brick/old_worn_blocks_003
}

Share this post


Link to post
Share on other sites

I can confirm this bug, I was looking to provide 2 different seat textures with different uv-maps on my stagecoach by making 1 start visible and the other 1 start as nodraw, then swap them around by skin. It worked ok in the editor but the faces which started nodraw never showed up ingame.

 

I've simplified the setup by making a nodraw box model and skinning it with a regular wall texture. Same result: works in editor, invisible ingame. Making a small test package of this for the bugtracker was on my todo list.

 

Yes, afaik id4 wont process more than a single UV map to a model. However in the instance of a sign like this (on a separate material) it should all be able to be on the same UV map since it sounds like he's just matching to boundaries with the sign.

//-----------------------
// Steam Engine Mk.III - Epi
//-----------------------

steam_engine_003_off

{
model models/darkmod/super_secret/steam_engine_003.lwo

steam_engine_003 steam_engine_003
steam_engine_grate textures/common/nodraw
steam_engine_heatwarp textures/common/nodraw
transformer_needle_a transformer_needle_a2
transformer_needle_b transformer_needle_b2
steam_engine_glassReadout steam_engine_glassReadout
} 

steam_engine_003_on

{
model models/darkmod/super_secret/steam_engine_003.lwo

steam_engine_003 steam_engine_003
steam_engine_grate steam_engine_grate
steam_engine_heatwarp steam_engine_heatwarp
steam_engine_glassReadout steam_engine_glassReadoutOn
}

You don't have to double list the non-interchanging materials like I did. Steam_engine_003 is listed there for my own use of keeping track of the materials. You can see various material definitions either be replaced outright or just remain unlisted if the primary material applied was an ON effect to start with. However, I've been able to slot in the nodraw material for OFF mode usage when heatwarp or grating glow isn't applied. Hope this helps but I can guarantee you it does work as long as it's all on the same UV.

Share this post


Link to post
Share on other sites
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.

Loading...
Sign in to follow this  

×
×
  • Create New...