How do you change dungeon fog/cemetery sky fog colour?

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!
Post Reply
User avatar
WaspUK1966
Posts: 135
Joined: Sat Aug 09, 2014 9:17 am

How do you change dungeon fog/cemetery sky fog colour?

Post by WaspUK1966 »

The script for the dungeon fog in log2 is below:

defineObject{
name = "swamp_dungeon_fog",
baseObject = "base_floor_decoration",
components = {
{
class = "FogParams",
fogMode = "dense",
fogColor = vec(0.3,0.5,0.15) * 0.3,
fogRange = {0,30},
},
{
class = "FogParticles",
texture = "assets/textures/particles/fog_particle.tga",
particleSize = 6.5,
color1 = vec(1,1,1)*3*0.55,
color2 = vec(1,1,1)*3*0.55,
color3 = vec(1,1,1)*3*0.55,
opacity = 0.4,
},
},
}

What elements do I amend to change its colour? And what are the colour ranges? I've been experimenting but cant get the colour I want quite right to use in my latest mod that I'm creating. Any help greatly appreciated as always.

George
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: How do you change dungeon fog/cemetery sky fog colour?

Post by Isaac »

Change the color 1, 2 & 3 values, and try spawning a "swamp_dungeon_fog" object via the console.


color1 = vec(1,1,91)*3*0.55,
color2 = vec(1,1,91)*3*0.55,
color3 = vec(1,1,91)*3*0.55,

Color2 seems to have the most prominent visual effect. The valid rage [afaik] is 0 to 255; with zero being invisible.
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: How do you change dungeon fog/cemetery sky fog colour?

Post by minmay »

Isaac wrote:Color2 seems to have the most prominent visual effect.
No. The game transitions between fogColor1, fogColor2, and fogColor3 depending on the time of day. fogColor1 is for daytime, fogColor2 is for sunrise/sunset, fogColor3 is for night.
Isaac wrote:The valid rage [afaik] is 0 to 255; with zero being invisible.
No. Any number is "valid" and the equivalent of RGB 0,50,255 is vec(0,50/255,1), NOT vec(0,50,255).

If it helps, think of color vectors as multipliers. Take particle emitter definitions. A particle color of vec(0.5,1,2) means the texture's red values are multiplied by 0.5, its green values by 1, and its blue values by 2.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: How do you change dungeon fog/cemetery sky fog colour?

Post by Isaac »

Interesting, and useful. 8-)

(And not something one learns in four minutes of playing around with it. :mrgreen: )

So color2 had the most apparent effect simply for it being the right time in the game-day.
...and the equivalent of RGB 0,50,255 is vec(0,50/255,1)
So is the effective range 0-1?
Post Reply