MirceaKitsune 258 Posted November 7, 2020 Report Share Posted November 7, 2020 (edited) Following the release of my first FM I wanted to offer a little surprise to the TDM community. I've implemented a little feature I wished to have for a while: Colored flame lights! This covers all fire based light entities, meaning all torches and gas lamps get versions with colored flames. They work the same way as the normal flames in terms of functionality, meaning you can move candles around and water arrows put them out and the player can relight them with matches. Colors include: Red, green, blue, pink. The implementation is very flexible: Each color variation inherits its original entity and only changes the light color or particle definition, thus changes to the base def will automatically reflect to the colored versions during development modifications. The colored entities replicate the same DarkRadiant tree structure as the normal lights directory except in their own subdirectories. I'm eager to hear what you think and if you like them! My goal is to offer this submission for vanilla TDM, ideally as a new feature for 2.09... I think they would look very nice for many fantasy setups! And of course, here are some screenshots of how each color looks in-game (red, green, blue, pink): Spoiler Spoiler Spoiler Spoiler The pk4 is attached to this post as it includes only particle and entity definitions so it's ridiculously tiny. You can install it in one of two ways: Either unpack its contents inside the directory of your fm, or copy the file as is inside the darkmod folder next to all the other pk4's... both should work just fine. color_lights_1.0.pk4 Edited November 7, 2020 by MirceaKitsune 4 Quote Link to post Share on other sites
MirceaKitsune 258 Posted November 7, 2020 Author Report Share Posted November 7, 2020 Updated to use better naming and editor folder paths. color_lights_1.1.pk4 1 Quote Link to post Share on other sites
Obsttorte 1504 Posted November 7, 2020 Report Share Posted November 7, 2020 You can make the particles use the light color. This way you wouldn't need to have specific entities for each color. Btw.: You may want to start a mapping thread to bundle your ideas instead of creating a new one for everything?! 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 post Share on other sites
MirceaKitsune 258 Posted November 7, 2020 Author Report Share Posted November 7, 2020 7 hours ago, Obsttorte said: You can make the particles use the light color. This way you wouldn't need to have specific entities for each color. Btw.: You may want to start a mapping thread to bundle your ideas instead of creating a new one for everything?! Nice, I didn't know you could do that. Perhaps I could use it to have a single colorable version of each flame type? How do you do this though, as in allow the color of a particle to be specified from the light def rather than coded in the prt file? I ask most questions in Newbie DarkRadiant Questions. Usually I only start a new thread if it's an idea that warrants its own discussion or something I produced. Quote Link to post Share on other sites
MirceaKitsune 258 Posted November 7, 2020 Author Report Share Posted November 7, 2020 (edited) New update. I didn't quite like how the pink flame looked, too unrealistic and illogical for a fire. I thus converted it to a purple flame which I feel looks a lot nicer! Violet flames are common in magic too so it's a better choice for this reason as well. Spoiler color_lights_1.2.pk4 Edited November 7, 2020 by MirceaKitsune Quote Link to post Share on other sites
Dragofer 1414 Posted November 7, 2020 Report Share Posted November 7, 2020 1 hour ago, MirceaKitsune said: Nice, I didn't know you could do that. Perhaps I could use it to have a single colorable version of each flame type? How do you do this though, as in allow the color of a particle to be specified from the light def rather than coded in the prt file? You'd need to: - make black&white versions of the flame diffusemaps so they can be recoloured better - use the "colored" keyword in their material definitions, see existing colorme textures for examples - enable "use entity colour" in the particle editor - this gives you a recolourable flame entity. Since it's def_attached to a lamp fixture, you need to use the spawnarg "set _color on flame" on the fixture to change the colour. More initial work this way than cloning existing entities with different fixed colours, but you'd get a much more versatile entity and the entity list would remain more navigable. 2 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide Link to post Share on other sites
Obsttorte 1504 Posted November 7, 2020 Report Share Posted November 7, 2020 @MirceaKitsuneLike @Dragofersaid. If lights can have models (can't remember right now as it has been a while) and you use the particle as model, you may even be able to skip the "set _color on flame" part (note that there is a space after set). 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 post Share on other sites
MirceaKitsune 258 Posted November 7, 2020 Author Report Share Posted November 7, 2020 I don't plan on editing the default flames, that might mess up what was done in development. That also sounds a bit more complicated... I'd have to rewrite the particle definitions as well as re-texture the flame images to use color maps. And since the red tint of the texture applied on top of the particle color looks nice, I would rather leave it as is for now. It's good to know this is a possibility in general none the less! Quote Link to post Share on other sites
Geep 265 Posted November 29, 2020 Report Share Posted November 29, 2020 I've just expanded the "_color" wiki page, to include how to change the brightness or color of the light cast by flame lights, and a link to this thread as well. 2 Quote Link to post Share on other sites
MirceaKitsune 258 Posted November 29, 2020 Author Report Share Posted November 29, 2020 9 hours ago, Geep said: I've just expanded the "_color" wiki page, to include how to change the brightness or color of the light cast by flame lights, and a link to this thread as well. Do you mean the light source or the flame particles? The first is super easy... main problem is colorizing the particles themselves, I didn't know how to do that. Once I do I'll make what should be the final update to this, so I can define a single set of particle defs instead of one for each color variant. In the prt. sub-particle definition (the entries between {}'s nested inside that particle def's {}'s) uses the flag "color R G B". What do you use there so it inherits the color of the light source? Would it be something like "color _color" or just "colored" or a similar format? Quote Link to post Share on other sites
Geep 265 Posted November 29, 2020 Report Share Posted November 29, 2020 I only dealt with the "super super easy" part of using the entity's "set _color to flame" to override the default color. I needed to do that in my current FM WIP to make the cast light dimmer. Sorry, I'm clueless regarding anything to do with particles, such as colorizing them. Quote Link to post Share on other sites
HMart 334 Posted December 9, 2020 Report Share Posted December 9, 2020 Afaik particles are just like any model, you use a material to give them their look, so most material tricks should work on them, have you tried to use a material, with a material stage keyword "colored"? It should give you the ability to color them in DR, you do this, like i said by just giving the particle, a material with a stage using the keyword "colored" then in DR you just use keyword parm0 to parm3 (R G B A respectively) to change its color. Btw don't know if really necessary but the Doom3 materials I saw using this, add a black&white diffuse texture. Example from Doom 3 models/mapobjects/chairs/kitchenchair/kitchenchair { qer_editorimage models/mapobjects/chairs/kitchenchair/kitchenchair bumpmap models/mapobjects/chairs/kitchenchair/kitchenchair_local { blend diffusemap map models/mapobjects/chairs/kitchenchair/kitchenchair_d colored } { blend specularmap map models/mapobjects/chairs/kitchenchair/kitchenchair_d rgb parm3 * 0.4 } } Quote Link to post Share on other sites
MirceaKitsune 258 Posted December 9, 2020 Author Report Share Posted December 9, 2020 Got them working! Now the entity's "_color" parameter automatically colors the flames as well. I had to redefine all the flame materials but the new mtr is a single set so it's no issue. Please try out the update and see if everything's good. There's only one problem: I have to comment out the "vertexColor" parameter in order for the "colored" one to work. This seems to cause the particles to appear and disappear suddenly (no fading). Not sure what solution there is to this side effect. color_lights_1.3.pk4 2 Quote Link to post Share on other sites
MirceaKitsune 258 Posted December 9, 2020 Author Report Share Posted December 9, 2020 I tried using "vertexColor parm3 * 0.4" as suggested by nbohr1more. No idea why that post isn't appearing here any more, I could only see it from an email notification. Sadly it only causes the particles to turn into black boxes without solving the fading issue. Quote Link to post Share on other sites
nbohr1more 2158 Posted December 9, 2020 Report Share Posted December 9, 2020 Hmm... I remember this problem from before. I believe the "scale" image program was the workaround: blend diffusemap map scale (models/mapobjects/chairs/kitchenchair/kitchenchair_d, parm0, parm1, parm2, parm3) colored parm0 = red parm1 = green parm2 = blue parm3 = alpha https://www.iddevnet.com/doom3/materials.html Quote 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...) Link to post Share on other sites
MirceaKitsune 258 Posted December 9, 2020 Author Report Share Posted December 9, 2020 42 minutes ago, nbohr1more said: Hmm... I remember this problem from before. I believe the "scale" image program was the workaround: blend diffusemap map scale (models/mapobjects/chairs/kitchenchair/kitchenchair_d, parm0, parm1, parm2, parm3) colored parm0 = red parm1 = green parm2 = blue parm3 = alpha https://www.iddevnet.com/doom3/materials.html map scale (the_texture, parm0, parm1, parm2, parm3): Causes the flames to become completely invisible. map scale (the_texture, 1, 1, 1, parm3): No change from not using it at all, you still see the flames popping out of existence instead of fading away. Apparently the engine really wants me to use vertexColor, which I cannot as it overrides the colored parameter and causes colorization to stop working. It take it vertex colors are somehow used to tell the particles when to fade... I'd need to somehow set only the alpha channel from it but leave the RGB set by the entity. Quote Link to post Share on other sites
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.