Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

minmay wrote: Sat Apr 13, 2019 5:39 am You can add uniform RGB values to entire models with ModelComponent:setEmissiveColor() or the emissiveColor field in the component definition, but this is additive rather than multiplicative so it is nothing like changing the "opacity" of the emissive map.
But you can add negative emission color; and this can be animated via scripting.

Example:

Code: Select all

	forest_oak_cluster_1.model:setEmissiveColor(vec(-.025))
	forest_oak_cluster_2.model:setEmissiveColor(vec(-.01,-.005,-.05))
	forest_oak_cluster_3.model:setEmissiveColor(vec(0,0,-.01))
	forest_oak_cluster_4.model:setEmissiveColor(vec(-.025,-.01))
	forest_oak_cluster_5.model:setEmissiveColor(vec(-.01,-.025,-.06))
Image
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

thanks minmay, I hate to ask this stupid question but how do you destroy it at the end again. I use to kind of know this but.. well its gone lol.
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

Isaac wrote: Sat Apr 13, 2019 6:12 am
minmay wrote: Sat Apr 13, 2019 5:39 am You can add uniform RGB values to entire models with ModelComponent:setEmissiveColor() or the emissiveColor field in the component definition, but this is additive rather than multiplicative so it is nothing like changing the "opacity" of the emissive map.
But you can add negative emission color; and this can be animated via scripting.

Example:

Code: Select all

	forest_oak_cluster_1.model:setEmissiveColor(vec(-.025))
	forest_oak_cluster_2.model:setEmissiveColor(vec(-.01,-.005,-.05))
	forest_oak_cluster_3.model:setEmissiveColor(vec(0,0,-.01))
	forest_oak_cluster_4.model:setEmissiveColor(vec(-.025,-.01))
	forest_oak_cluster_5.model:setEmissiveColor(vec(-.01,-.025,-.06))
Thanks Isaac for your input on that, I might use that idea but I was hoping for more of just a noise on the emissive map. But since I can't do that, I'm not going to mess with the fluctuation idea :) The mushrooms I created still look good as they are :D
Image
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Materials do have an onUpdate hook that allows realtime adjustments to [some of] the various internal settings.

https://github.com/JKos/log2doc/wiki/As ... terialdesc
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

Here is a more clear shot. I don't know, do you guys think these might look cooler with a fluctuating emissive?
Image
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

They look nice. 8-)
They could look great with pulsating luminescence.

They could be breakable, and could be food—or poisonous.
IIRC, in the ORRR2 mod, Xanathar put in psychedelic mushrooms that sent dancing chorus girls across the screen, with a moiré pattern background.
Last edited by Isaac on Sat Apr 13, 2019 7:25 am, edited 1 time in total.
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

Isaac wrote: Sat Apr 13, 2019 7:21 am They look nice. 8-)
They could look great with pulsating luminescence.
You know I wonder if I could have a rotating overlay on/over the emissive. using an alpha channel maybe?
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Alpha channel is either on or off, I think; no middle degree of transparency.

Translucent blending mode can —sort of— come close to a similar effect, but not really.

*Edit: removed text about alpha values.... AFAIK they are single bit—or are treated that way. I don't recall ever having success with a partially transparent material where the alpha areas were not completely on, or completely off.
Last edited by Isaac on Sat Apr 13, 2019 7:39 am, edited 1 time in total.
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

So if I were to use the first idea you had, how would I go about it (I'm still very much a scripting newb lol). would it be in the defineObject?
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

You can start with this:
viewtopic.php?f=22&t=7951&start=2770#p119082

For the mushroom effect, I am not sure that it can be straightforwardly done, but there might be some way to come close to it.

It might be possible to bake part of the effect into an animated material, and include a fluctuating light component.
I have not tried anything like that —yet.
Post Reply