System DynamicAmbiance

Builder Bob

Live free or don't
Reaction score
249
Dynamic Ambiance
v 0.12​

I needed a system capable of changing the fog and water tinting color dynamically depending on where the camera is looking. It turned out rather nice, so I thought I might as well share it.

To use it is very easy. All you need to do is create a region in the Region Palette, and call a function to set the fog and/or water color for that region. Everything else is handled by a running timer in-game.

If you use the GUI, follow the import instructions and look in the Trigger Editor for examples of how to make a custom script to call the functions.


It is untested in multiplayer, and I'm unable to test it myself, so I don't know how it will behave in a network.

I am unable to take screenshots because of my graphic card, but I don't think a screenshot would do the system much justice anyway.


Changes:
Changes in 0.1
  • Added the function RegionRemoveAmbiance(whichRect).
  • Added functionality to SetDefaultAmbiance() to allow it to be used to change the global ambiance without any existing ambiance regions in the map.
  • Added check to pause the timer when no ambiance regions exist.
  • Added some text commands to the test map.
Changes in 0.11
  • Minor fix
Changes in 0.12
  • Changed some code to make it compatible with newest NewGen

JASS:
// ===============================
// DynamicAmbience
//   version 0.12   by Builder Bob
// ===============================
//
//	Purpose
//	-------
//		A system for changing fog and water tinting with smooth transitions.
//		Allowing you to easily create regions with specific fog and/or water tinting tied to them;
//		 the fog and water color will change dynamically as you move your camera around in your map.
//
//	How to import
//	-------------
//		1. create a trigger named DynamicAmbiance.
//		2. Edit -> Convert to Custom Text.
//		3. replace the content of that trigger with the content of this trigger.
//
//	How to use
//	----------
//		1. create a region with the region palette in the Editor.
//		2. call any of the RegionSet... functions either with Jass or a custom script in GUI. (see examples)
//		3. repeat until you have enough regions.
//
//	Functions
//	---------
//		SetDefaultAmbiance(fogZStart, fogZEnd, fogRed, fogGreen, fogBlue, waterRed, waterGreen, waterBlue)
//			sets the default ambiance in any part of the map that is not affected by ambiance regions.
//		
//		RegionSetAmbiance(whichRect, fogZStart, fogZEnd, fogRed, fogGreen, fogBlue, waterRed, waterGreen, waterBlue)
//			sets both fog and water color for a region.
//			will overwrite old values if called twice with the same input region.
//
//		RegionSetFog(whichRect, fogZStart, fogZEnd, fogRed, fogGreen, fogBlue)
//			sets fog color for a region. default water color will be used.
//			will overwrite old values if called twice with the same input region.
//
//		RegionSetWaterColor(whichRect, waterRed, waterGreen, waterBlue)
//			sets water color for a region. default fog color will be used.
//			will overwrite old values if called twice with the same input region.
//
//		RegionRemoveAmbiance(whichRect)
//			removes all ambiance set for a region.
//			default fog and water color will be used until new ambiance is set.
//			this function is not needed when changing the ambiance.
//
//	Variable explanations
//	---------------------
//		whichRect		Name of your region. Regions made in the Region Palette are named gg_rct_NameOfRegion.
//		fogZStart		the distance from the camera the fog starts.
//		fogZEnd			the distance from the camera the fog ends.
//		fogRed			red value of the fog. (0. - 255.)
//		fogGreen		green value of the fog. (0. - 255.)
//		fogBlue			blue value of the fog. (0. - 255.)
//		waterRed		red value of the water. (0. - 255.)
//		waterGreen		green value of the water. (0. - 255.)
//		waterBlue		blue value of the water. (0. - 255.)
//
//	Tips
//	----
//		* I have used the term Ambiance for the collection of fog and water color for simplicity in this trigger.
//		* Overlapping regions will give good transitions between different ambiance colors.
//		* The ambiance color will never exeed the borders of it's region.
//		* The ambiance color is at it's fullest value in the center of the region, and is 0 at the borders.
//
//	Requires Jass NewGen Pack
//	-------------------------

library DynamicAmbiance

globals
	
	//	Changeable global values
	//	------------------------
	//		PERIOD				how often the ambiance will be updated in seconds.
	//		CHANGE_DELAY		how fast ambiance will change over time.
	//		AMBIANCE_STRENGTH	determines the rate of dissipation for the ambiance when at the outskirts of an ambiance region.
	//
	//		Default fog and water values can be changed here
	//		 without the use of SetDefaultAmbiance() if prefered.
	
	private constant real PERIOD = .04
	private constant real CHANGE_DELAY = 200. * PERIOD
	private constant real AMBIANCE_STRENGTH = 4.
	
	private real DefaultFogZStart = 3000.
	private real DefaultFogZEnd = 5000.
	private real DefaultFogRed = 0.
	private real DefaultFogGreen = 0.
	private real DefaultFogBlue = 0.
	private real DefaultWaterRed = 255.
	private real DefaultWaterGreen = 255.
	private real DefaultWaterBlue = 255.
endglobals

//SYSTEM BELOW -- Change at your own risk --
globals
	private constant integer STYLE = 0
	private constant real DENSITY = .00
endglobals

private function Limit takes real value, real min, real max returns real
	if value < min then
		set value = min
	elseif value > max then
		set value = max
	endif
	return value
endfunction

private struct AmbianceRegion
	public static timer Timer = CreateTimer()
	public static integer RegionCount = 0
	
	private static real CurrentFogZStart = 3000.
	private static real CurrentFogZEnd = 5000.
	private static real CurrentFogRed = 0.
	private static real CurrentFogGreen = 0.
	private static real CurrentFogBlue = 0.
	private static real CurrentWaterRed = 255.
	private static real CurrentWaterGreen = 255.
	private static real CurrentWaterBlue = 255.
	
	public static region DefaultFogRegion
	private boolean defaultFog = false
	private boolean defaultWaterColor = false
	
	private region ambianceRegion = CreateRegion()
	private real centerX
	private real centerY
	private real reachX
	private real reachY
	
	private real fogZStart
	private real fogZEnd
	private real fogRed
	private real fogGreen
	private real fogBlue
	private real waterRed
	private real waterGreen
	private real waterBlue
	
	private static method UpdateAmbiance takes nothing returns nothing
		local AmbianceRegion n = 1
		local integer i
		
		local real cameraX = GetCameraTargetPositionX()
		local real cameraY = GetCameraTargetPositionY()
		local real weightX
		local real weightY
		local real weight
		local real totalWeight = 0.
		
		local real newFogZStart = 0.
		local real newFogZEnd = 0.
		local real newFogRed = 0.
		local real newFogGreen = 0.
		local real newFogBlue = 0.
		local real newWaterRed = 0.
		local real newWaterGreen = 0.
		local real newWaterBlue = 0.
		
		loop
			set i = n
			exitwhen(i > .RegionCount)
			if IsPointInRegion(n.ambianceRegion, cameraX, cameraY) then
				set weightX = (cameraX - n.centerX) / n.reachX
				if weightX < 0. then
					set weightX = -weightX
				endif
				set weightX = 1. - Pow(weightX, AMBIANCE_STRENGTH)
				set weightY = (cameraY - n.centerY) / n.reachY
				if weightY < 0. then
					set weightY = -weightY
				endif
				set weightY = 1. - Pow(weightY, AMBIANCE_STRENGTH)
				if weightX < weightY then
					set weight = weightX
				else
					set weight = weightY
				endif
				
				if weight < 0. then
					set weight = 0.
				endif
				
				set totalWeight = totalWeight + weight
				
				set newFogZStart = newFogZStart + weight * n.fogZStart
				set newFogZEnd = newFogZEnd + weight * n.fogZEnd
				set newFogRed = newFogRed + weight * n.fogRed
				set newFogGreen = newFogGreen + weight * n.fogGreen
				set newFogBlue = newFogBlue + weight * n.fogBlue
				set newWaterRed = newWaterRed + weight * n.waterRed
				set newWaterGreen = newWaterGreen + weight * n.waterGreen
				set newWaterBlue = newWaterBlue + weight * n.waterBlue
			endif
			set n = n + 1
		endloop
		
		if totalWeight > 1. then
			set newFogZStart = newFogZStart / totalWeight
			set newFogZEnd = newFogZEnd / totalWeight
			set newFogRed = newFogRed / totalWeight
			set newFogGreen = newFogGreen / totalWeight
			set newFogBlue = newFogBlue / totalWeight
			set newWaterRed = newWaterRed / totalWeight
			set newWaterGreen = newWaterGreen / totalWeight
			set newWaterBlue = newWaterBlue / totalWeight
		else
			set weight = 1. - totalWeight
			
			set newFogZStart = newFogZStart + weight * (DefaultFogZStart - newFogZStart)
			set newFogZEnd = newFogZEnd + weight * (DefaultFogZEnd - newFogZEnd)
			set newFogRed = newFogRed + weight * (DefaultFogRed - newFogRed)
			set newFogGreen = newFogGreen + weight * (DefaultFogGreen - newFogGreen)
			set newFogBlue = newFogBlue + weight * (DefaultFogBlue - newFogBlue)
			set newWaterRed = newWaterRed + weight * (DefaultWaterRed - newWaterRed)
			set newWaterGreen = newWaterGreen + weight * (DefaultWaterGreen - newWaterGreen)
			set newWaterBlue = newWaterBlue + weight * (DefaultWaterBlue - newWaterBlue)
		endif
		
		set .CurrentFogZStart = .CurrentFogZStart + (newFogZStart - .CurrentFogZStart) / CHANGE_DELAY
		set .CurrentFogZEnd = .CurrentFogZEnd + (newFogZEnd - .CurrentFogZEnd) / CHANGE_DELAY
		set .CurrentFogRed = .CurrentFogRed + (newFogRed - .CurrentFogRed) / CHANGE_DELAY
		set .CurrentFogGreen = .CurrentFogGreen + (newFogGreen - .CurrentFogGreen) / CHANGE_DELAY
		set .CurrentFogBlue = .CurrentFogBlue + (newFogBlue - .CurrentFogBlue) / CHANGE_DELAY
		set .CurrentWaterRed = .CurrentWaterRed + (newWaterRed - .CurrentWaterRed) / CHANGE_DELAY
		set .CurrentWaterGreen = .CurrentWaterGreen + (newWaterGreen - .CurrentWaterGreen) / CHANGE_DELAY
		set .CurrentWaterBlue = .CurrentWaterBlue + (newWaterBlue - .CurrentWaterBlue) / CHANGE_DELAY
		
		call SetTerrainFogEx(STYLE, .CurrentFogZStart, .CurrentFogZEnd, DENSITY, .CurrentFogRed, .CurrentFogGreen, .CurrentFogBlue)
		call SetWaterBaseColor(R2I(.CurrentWaterRed), R2I(.CurrentWaterGreen), R2I(.CurrentWaterBlue), 255)
		
		if .RegionCount == 0 then
			if RAbsBJ(.CurrentFogZStart - DefaultFogZStart) < .5 then
				if RAbsBJ(.CurrentFogZEnd - DefaultFogZEnd) < .5 then
					if RAbsBJ(.CurrentFogRed - DefaultFogRed) < .001 then
						if RAbsBJ(.CurrentFogGreen - DefaultFogGreen) < .001 then
							if RAbsBJ(.CurrentFogBlue - DefaultFogBlue) < .001 then
								if RAbsBJ(.CurrentWaterRed - DefaultWaterRed) < .1 then
									if RAbsBJ(.CurrentWaterGreen - DefaultWaterGreen) < .1 then
										if RAbsBJ(.CurrentWaterBlue - DefaultWaterBlue) < .1 then
											call PauseTimer(.Timer)
										endif
									endif
								endif
							endif
						endif
					endif
				endif
			endif
		endif
	endmethod
	
	public static method SetDefAmb takes real fogZStart, real fogZEnd, real fogRed, real fogGreen, real fogBlue, real waterRed, real waterGreen, real waterBlue returns nothing
		local AmbianceRegion n = 1
		local integer i
		
		set DefaultFogZStart = fogZStart
		set DefaultFogZEnd = fogZEnd
		set DefaultFogRed = Limit(fogRed / 255., 0., 1.)
		set DefaultFogGreen = Limit(fogGreen / 255., 0., 1.)
		set DefaultFogBlue = Limit(fogBlue / 255., 0., 1.)
		set DefaultWaterRed = Limit(waterRed, 0., 255.)
		set DefaultWaterGreen = Limit(waterGreen, 0., 255.)
		set DefaultWaterBlue = Limit(waterBlue, 0., 255.)
		
		loop
			set i = n
			exitwhen(i > .RegionCount)
			if n.defaultFog then
				set n.fogZStart = DefaultFogZStart
				set n.fogZEnd = DefaultFogZEnd
				set n.fogRed = DefaultFogRed
				set n.fogGreen = DefaultFogGreen
				set n.fogBlue = DefaultFogBlue
			elseif n.defaultWaterColor then
				set n.waterRed = DefaultWaterRed
				set n.waterGreen = DefaultWaterGreen
				set n.waterBlue = DefaultWaterBlue
			endif
			set n = n + 1
		endloop
		
		call TimerStart(.Timer, PERIOD, true, function AmbianceRegion.UpdateAmbiance)
	endmethod
	
	public static method create takes rect rc, real fogZStart, real fogZEnd, real fogRed, real fogGreen, real fogBlue, real waterRed, real waterGreen, real waterBlue, boolean defaultFog, boolean defaultWaterColor returns AmbianceRegion
		local AmbianceRegion n = AmbianceRegion.allocate()
		
		call RegionClearRect(.DefaultFogRegion, rc)
		
		call RegionAddRect(n.ambianceRegion, rc)
		set n.centerX = GetRectCenterX(rc)
		set n.centerY = GetRectCenterY(rc)
		set n.reachX = (GetRectMaxX(rc) - GetRectMinX(rc)) / 2.
		set n.reachY = (GetRectMaxY(rc) - GetRectMinY(rc)) / 2.
		
		set n.defaultFog = defaultFog
		set n.defaultWaterColor = defaultWaterColor
		set n.fogZStart = fogZStart
		set n.fogZEnd = fogZEnd
		set n.fogRed = Limit(fogRed / 255., 0., 1.)
		set n.fogGreen = Limit(fogGreen / 255., 0., 1.)
		set n.fogBlue = Limit(fogBlue / 255., 0., 1.)
		set n.waterRed = Limit(waterRed, 0., 255.)
		set n.waterGreen = Limit(waterGreen, 0., 255.)
		set n.waterBlue = Limit(waterBlue, 0., 255.)
		
		set .RegionCount = .RegionCount + 1
		
		call TimerStart(.Timer, PERIOD, true, function AmbianceRegion.UpdateAmbiance)
		
		return n
	endmethod
	
	public static method RegSetAmb takes rect rc, real fogZStart, real fogZEnd, real fogRed, real fogGreen, real fogBlue, real waterRed, real waterGreen, real waterBlue, boolean defaultFog, boolean defaultWaterColor returns nothing
		local AmbianceRegion n = 1
		local integer i
		loop
			set i = n
			exitwhen(i > .RegionCount)
			if GetRectCenterX(rc) == n.centerX then
				if GetRectCenterY(rc) == n.centerY then
					if (GetRectMaxX(rc) - GetRectMinX(rc)) / 2. == n.reachX then
						if (GetRectMaxY(rc) - GetRectMinY(rc)) / 2. == n.reachY then
							set n.defaultFog = defaultFog
							set n.defaultWaterColor = defaultWaterColor
							
							set n.fogZStart = fogZStart
							set n.fogZEnd = fogZEnd
							set n.fogRed = Limit(fogRed / 255., 0., 1.)
							set n.fogGreen = Limit(fogGreen / 255., 0., 1.)
							set n.fogBlue = Limit(fogBlue / 255., 0., 1.)
							set n.waterRed = Limit(waterRed, 0., 255.)
							set n.waterGreen = Limit(waterGreen, 0., 255.)
							set n.waterBlue = Limit(waterBlue, 0., 255.)
							exitwhen(true)
						endif
					endif
				endif
			endif
			set n = n + 1
		endloop
		
		set i = n
		if i > .RegionCount then
			call AmbianceRegion.create(rc, fogZStart, fogZEnd, fogRed, fogGreen, fogBlue, waterRed, waterGreen, waterBlue, defaultFog, defaultWaterColor)
		endif
	endmethod
	
	public static method RegRemAmb takes rect rc returns nothing
		local AmbianceRegion n = 1
		local AmbianceRegion right
		local integer i
		local boolean match = false
		loop
			set i = n
			exitwhen(i > .RegionCount)
			if not match then
				if GetRectCenterX(rc) == n.centerX then
					if GetRectCenterY(rc) == n.centerY then
						if (GetRectMaxX(rc) - GetRectMinX(rc)) / 2. == n.reachX then
							if (GetRectMaxY(rc) - GetRectMinY(rc)) / 2. == n.reachY then
								set match = true
							endif
						endif
					endif
				endif
			endif
			
			if match then
				set right = n + 1
				set i = right
				if i > .RegionCount then
					call n.destroy()
				else
					set n.ambianceRegion = right.ambianceRegion
					set n.centerX = right.centerX
					set n.centerY = right.centerY
					set n.reachX = right.reachX
					set n.reachY = right.reachY
					
					set n.defaultFog = right.defaultFog
					set n.defaultWaterColor = right.defaultWaterColor
					
					set n.fogZStart = right.fogZStart
					set n.fogZEnd = right.fogZEnd
					set n.fogRed = right.fogRed
					set n.fogGreen = right.fogGreen
					set n.fogBlue = right.fogBlue
					set n.waterRed = right.waterRed
					set n.waterGreen = right.waterGreen
					set n.waterBlue = right.waterBlue
				endif
			endif
			
			set n = n + 1
		endloop
	endmethod
	
	private method onDestroy takes nothing returns nothing
		call RemoveRegion(.ambianceRegion)
		set .RegionCount = .RegionCount - 1
	endmethod
	
endstruct

function SetDefaultAmbiance takes real fogZStart, real fogZEnd, real fogRed, real fogGreen, real fogBlue, real waterRed, real waterGreen, real waterBlue returns nothing
	call AmbianceRegion.SetDefAmb(fogZStart, fogZEnd, fogRed, fogGreen, fogBlue, waterRed, waterGreen, waterBlue)
endfunction

function RegionSetAmbiance takes rect rc, real fogZStart, real fogZEnd, real fogRed, real fogGreen, real fogBlue, real waterRed, real waterGreen, real waterBlue returns nothing
	call AmbianceRegion.RegSetAmb(rc, fogZStart, fogZEnd, fogRed, fogGreen, fogBlue, waterRed, waterGreen, waterBlue, false, false)
endfunction

function RegionSetFog takes rect rc, real fogZStart, real fogZEnd, real fogRed, real fogGreen, real fogBlue returns nothing
	call AmbianceRegion.RegSetAmb(rc, fogZStart, fogZEnd, fogRed, fogGreen, fogBlue, DefaultWaterRed, DefaultWaterGreen, DefaultWaterBlue, false, true)
endfunction

function RegionSetWaterColor takes rect rc, real waterRed, real waterGreen, real waterBlue returns nothing
	call AmbianceRegion.RegSetAmb(rc, DefaultFogZStart, DefaultFogZEnd, DefaultFogRed, DefaultFogGreen, DefaultFogBlue, waterRed, waterGreen, waterBlue, true, false)
endfunction

function RegionRemoveAmbiance takes rect rc returns nothing
	call AmbianceRegion.RegRemAmb(rc)
endfunction

public function InitTrig takes nothing returns nothing
	set AmbianceRegion.DefaultFogRegion = CreateRegion()
	call RegionAddRect(AmbianceRegion.DefaultFogRegion, bj_mapInitialCameraBounds)
	
	call SetDefaultAmbiance(DefaultFogZStart, DefaultFogZEnd, DefaultFogRed, DefaultFogGreen, DefaultFogBlue, DefaultWaterRed, DefaultWaterGreen, DefaultWaterBlue)
endfunction

endlibrary
 

Attachments

  • DynamicAmbiance 0.12.w3x
    74.2 KB · Views: 321

PurgeandFire

zxcvmkgdfg
Reaction score
509
Nice codes, probably useful in certain maps.. I swear I thought of making something like this, but I was too lazy. :p

I thought of it today though, then I saw this. xD

Great coding, I'll test out the map.
 
Reaction score
333
Just out of interest, I often see people nesting their ifs like that. Is there some sort of concrete advantage?

EDIT: After demoing the map I can say that effect is thoroughly awesome, +rep.
 

Builder Bob

Live free or don't
Reaction score
249
Nice codes, probably useful in certain maps.. I swear I thought of making something like this, but I was too lazy. :p

I thought of it today though, then I saw this. xD

Great coding, I'll test out the map.

Feel free to use and modify this as you wish if you still feel lazy ;)

Just out of interest, I often see people nesting their ifs like that. Is there some sort of concrete advantage?

EDIT: After demoing the map I can say that effect is thoroughly awesome, +rep.

As far as I know there are exactly no advantages or disadvantages by nesting if's over using and's. It just makes the code easier to read for me.

Glad you like it


Edit: I just noticed that the function with the most nested if's isn't even in use. I guess I'll refine the system and update it a bit later.
 

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
Nice! Kinda wierd... I cant think of very many uses for it, but good job..
 

Builder Bob

Live free or don't
Reaction score
249
As I mentioned in the first post, I'm not able to test how this system works in multiplayer. If anyone would like to help me with that testing, I'd be grateful. I'd like to know if the games stays in sync, and if different players can experience different fog colors independent of where other players have their cameras located.


Feel free to just leave a comment as well.
 

rodead

Active Member
Reaction score
42
WoW Really NIce system i can use this really for my orpg the only thing that is a little bit anoying is that the fog and water color at map boundries is fading :S
 

Romek

Super Moderator
Reaction score
963
JASS:
private function Limit takes real value, real min, real max returns real
        if value < min then
                set value = min
        elseif value > max then
                set value = max
        endif
        return value
endfunction


Could be:
JASS:
private function Limit takes real value, real min, real max returns real
        if value < min then
                return min
        elseif value > max then
                return max
        endif
        return value
endfunction

Doubt it makes a huge difference.

JASS:
if .RegionCount == 0 then
                        if RAbsBJ(.CurrentFogZStart - DefaultFogZStart) < .5 then
                                if RAbsBJ(.CurrentFogZEnd - DefaultFogZEnd) < .5 then
                                        if RAbsBJ(.CurrentFogRed - DefaultFogRed) < .001 then
                                                if RAbsBJ(.CurrentFogGreen - DefaultFogGreen) < .001 then
                                                        if RAbsBJ(.CurrentFogBlue - DefaultFogBlue) < .001 then
                                                                if RAbsBJ(.CurrentWaterRed - DefaultWaterRed) < .1 then
                                                                        if RAbsBJ(.CurrentWaterGreen - DefaultWaterGreen) < .1 then
                                                                                if RAbsBJ(.CurrentWaterBlue - DefaultWaterBlue) < .1 then
                                                                                        call PauseTimer(.Timer)
                                                                                endif
                                                                        endif
                                                                endif
                                                        endif
                                                endif
                                        endif
                                endif
                        endif
                endif

Wtf is with that?! :p
You know you can do:
JASS:
if BoolExprA and BoolExprB then
endif

Just do that. Instead of a massive ">" of If blocks.

You do that quite a few times as well (Or something similar).
 

Dr.Jack

That's Cap'n to you!
Reaction score
109
This system kicks ass. Can help with creating terrain and moods. Good job man. :)
 

Builder Bob

Live free or don't
Reaction score
249
JASS:
private function Limit takes real value, real min, real max returns real
        if value < min then
                set value = min
        elseif value > max then
                set value = max
        endif
        return value
endfunction


Could be:
JASS:
private function Limit takes real value, real min, real max returns real
        if value < min then
                return min
        elseif value > max then
                return max
        endif
        return value
endfunction

Doubt it makes a huge difference.
Yup, that would be faster.

You know you can do:
JASS:
if BoolExprA and BoolExprB then
endif

Just do that. Instead of a massive ">" of If blocks.

You do that quite a few times as well (Or something similar).
I know I almost never use "and" except for when it actually makes a difference.

Put them all on the same line and try to read it. It's not gonna be an easy task. I prefer the ">" shaped if blocks :)

Thanks though

This system kicks ass. Can help with creating terrain and moods. Good job man.
I appreciate it

WoW Really NIce system i can use this really for my orpg the only thing that is a little bit anoying is that the fog and water color at map boundries is fading :S
Yes, that is a weakness in the system. I want to make an improved version that can create dense fog at the map boarders as well. If I get the time.
 

rodead

Active Member
Reaction score
42
well nice, i hope that fog thingie with the boarders is fastly done, and with tha i mean in 4 months? :p
 

Builder Bob

Live free or don't
Reaction score
249
well nice, i hope that fog thingie with the boarders is fastly done, and with tha i mean in 4 months? :p

I'll get it done within 4 months. I'd like to do it before of course.
Just a question: I've been thinking of renaming the system. I've got the feeling that DynamicAmbiance doesn't mean much to most people. Would FogRegions be a better name? Or something else?

For the moment I've got my hands full with school, christmas and my map Colosseum.
 

Nerfpl

New Member
Reaction score
53
Custom script: RegionSetFog(gg_rct_Cementary,1,100,10.0,20.0,30.0)

Gives me
Code:
    (call s__DynamicAmbiance__AmbianceRegion_RegSetAmb((gg_rct_Cementary ) , (( 1 )*1.0) , (( 100 )*1.0) , (( 10.0 )*1.0) , (( 20.0 )*1.0) , (( 30.0)*1.0) , DynamicAmbiance__DefaultWaterRed , DynamicAmbiance__DefaultWaterGreen , DynamicAmbiance__DefaultWaterBlue , false , true)) // INLINED!!

Any1 can post example of custom script, how it should be properly written? i odnt know thing about JASS
 

Trollvottel

never aging title
Reaction score
262
you forgot the "call"
-> Custom script: call RegionSetFog(gg_rct_Cementary,1,100,10.0,20.0,30.0)
 

Nerfpl

New Member
Reaction score
53
btw. Is there a way to change density of fog? atm i can only set it to heavy color, and i want it only be light fog to add creppy theme
 

Builder Bob

Live free or don't
Reaction score
249
Code:
Custom script: call RegionSetFog(gg_rct_Cementary,[COLOR="Red"]1[/COLOR],[COLOR="Blue"]100[/COLOR],10.0,20.0,30.0)

Red number is how far away from the camera the fog starts.
Blue number is how far away from the camera the fog ends.

They should both be increased until you get your desired effect.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top