Jump to content
The Dark Mod Forums

Creating Frob Highlight texture for existing model


jaredmitchell

Recommended Posts

Hey there,

 

I've been making a map for a few months now, and am finishing up with polish before I can pass it off for critique. One thing I want to fix is making it so that an instance of the model the_hammer_small1.lwo can highlight when frobbed, as the goal of my map is to steal this particular item. I understand that this particular model wasn't intended as a loot item (as I had to make it an atdm:loot_broach entity), but I figured getting a highlight wouldn't be too much work.

 

Several hours later, I'm ready to pull my hair out. I've managed to make a .mtr file:

sk/the_hammer_small_highlight
{

metal

	diffusemap models/darkmod/props/textures/thehammer_small_bronze_d_ed
    {
        if ( parm11 > 0 )
        blend       add
        map         models/darkmod/props/textures/thehammer_small_bronze_d_ed
        rgb         0.15 * parm11		
	}
}

As well as a .skin file, which is showing up in DarkRadiant:

skin small_hammer_highlight
{
	model models/darkmod/decorative/statues/the_hammer_small1.lwo
	sk/the_hammer_small_highlight models/darkmod/props/textures/thehammer_small_bronze_d_ed
}

However, the texture used in editor and the game isn't the bronze texture that I've specified, which makes me believe there's an issue with the .mtr file, either in its being read, or its syntax.

 

Would someone be able to explain to me how to get this working? Much appreciated!

Link to comment
Share on other sites

textures in the editor are jpg's, textures on your model should be either tga or dds or both tga and dds.

 

this is the material settings for a pumpkin I made that is frobable, not the pumpkins that are included with the darkmod.

 

textures/darkmod/samhaim/jack5body
{

surftype15
description "cloth"

//jpg image seen by the editor darkradiant
qer_editorimage textures/darkmod/samhaim/jack5body_ed

//tga and dds image files seen by the darkmod engine
diffusemap textures/darkmod/samhaim/jack5body
{//i think this is the high light
if ( parm11 > 0 )
blend gl_dst_color,gl_one
map _white
rgb 0.30*parm11
}
{//i think this is whats seen from a distance when not in frobable range
if ( parm11 > 0 )
blend add

//tga and dds image file
map textures/darkmod/samhaim/jack5body
rgb 0.15*parm11
}
{//not actually sure what this bit does but its on all frobable items materials
blend add

//tga and dds image file
map textures/darkmod/samhaim/jack5body
red global2
green global3
blue global4
}
}

the parm11 is what highlights the body, it starts of looking like a normal model, when in range it lights up to show that its frobable,

 

although to make custom items you should really use the atdm:moveable_custom_item entity its in items/custom then you just change its properties, model, skin and add a collision box to it. if it doesn't already have one (which is create a box with the collision texture, move your custom object and collision box on to the editors origin. eg. bottom of custom entity on origin,place the collision box over the custom object, save collision box as collision box for the custom object. if using a moveable entity already in game it will have a collision box already, you might have to change to the collision box first to a func_static before saving it as the collision box for the custom item.)

Edited by stumpy
Link to comment
Share on other sites

textures/darkmod/samhaim/jack5body
{

    surftype15
    description "cloth"

       //jpg image seen by the editor darkradiant
      qer_editorimage textures/darkmod/samhaim/jack5body_ed

      //tga and dds image files seen by the darkmod engine
      diffusemap textures/darkmod/samhaim/jack5body
      {//i think this is the high light
            if ( parm11 > 0 )
            blend gl_dst_color,gl_one
            map _white
            rgb 0.30*parm11
      }
      {//i think this is whats seen from a distance when not in frobable range
            if ( parm11 > 0 )
            blend add

            //tga and dds image file
            map textures/darkmod/samhaim/jack5body
            rgb 0.15*parm11
      }
      {//not actually sure what this bit does but its on all frobable items materials
            blend add

            //tga and dds image file
            map textures/darkmod/samhaim/jack5body
            red global2
            green global3
            blue global4
      }
}

This is not completely true. Both image stages that starts with if (parm11>0) are used for frobhilighting. The white stage lets the frobhilight look a bit more washed out.

 

The last stage is missing the condition. if (global5==1) iirc. This stage is used for simple ambient rendering, so instead of using the ambient_world light this additive stage gets used for ambience. global2 - global4 are the colors of the ambient_world light.

 

On file formats. You cna use tga for editor images, too. The reason why they are jpegs in most cases is the compression. Quality isn't that important in the editor preview. Jared, add the white stage to your materail, too. Additionally, make sure that the dimensions of the image you use is dimensioned in powers of two, for example 256x256 or 256x512 or similar.

  • 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

Several hours later, I'm ready to pull my hair out. I've managed to make a .mtr file:
sk/the_hammer_small_highlight
{

metal

	diffusemap models/darkmod/props/textures/thehammer_small_bronze_d_ed
    {
        if ( parm11 > 0 )
        blend       add
        map         models/darkmod/props/textures/thehammer_small_bronze_d_ed
        rgb         0.15 * parm11		
	}
}

As well as a .skin file, which is showing up in DarkRadiant:

skin small_hammer_highlight
{
	model models/darkmod/decorative/statues/the_hammer_small1.lwo
	sk/the_hammer_small_highlight models/darkmod/props/textures/thehammer_small_bronze_d_ed
}

 

If I read this right, sk/the_hammer_small_highlight is your new replacement material. In that case, try reversing the order of items in the last non-brace line of the skin def. so it's <material to replace> <with this one>. Also, you want the material name, not an image and certainly not an editor image, which is what models/darkmod/props/textures/thehammer_small_bronze_d_ed looks like. DR's choose model dialogue says the_hammer_small1.lwo uses only one material, tdm_hammer_medium_stone. So try making the last line:

tdm_hammer_medium_stone sk/the_hammer_small_highlight
Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

So try making the last line:

tdm_hammer_medium_stone sk/the_hammer_small_highlight

 

Oh, uh, I solved it while you were posting, and that was part of it. So you were right!

 

I poked around some more in the .pk4s and found the .mtr and .skin entries for this model. I was able to copy and paste them, then add the frob conditions. I was also unaware that it was using the bump and spec maps from the medium-sized model, so that might've been part of it.

 

Thank you again, everybody!

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

    • 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
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
×
×
  • Create New...