jaredmitchell Posted October 7, 2016 Report Share Posted October 7, 2016 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! Quote Link to comment Share on other sites More sharing options...
stumpy Posted October 7, 2016 Report Share Posted October 7, 2016 (edited) 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 October 7, 2016 by stumpy Quote Link to comment Share on other sites More sharing options...
Obsttorte Posted October 7, 2016 Report Share Posted October 7, 2016 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. 1 Quote 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 More sharing options...
jaredmitchell Posted October 7, 2016 Author Report Share Posted October 7, 2016 textures in the editor are jpg's, textures on your model should be either tga or dds or both tga and dds. Oh, I see, I was pointing to the .jpg file. I'l try that real quick... Quote Link to comment Share on other sites More sharing options...
VanishedOne Posted October 7, 2016 Report Share Posted October 7, 2016 (edited) 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 October 7, 2016 by VanishedOne Quote Some things I'm repeatedly thinking about... - louder scream when you're dying Link to comment Share on other sites More sharing options...
jaredmitchell Posted October 7, 2016 Author Report Share Posted October 7, 2016 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.