Frictional Games Forum (read-only)

Full Version: Activate/deactivate fog Area
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I need to Deactivate a fog Area. But if I deactivate one in Level Editor and test it ingame, the fog will still be active. How can I deactivate a fog area? (I need to activate it ingame with scripts, but first I need to know how to make the fog not appear at the start).
I hope someone can help.

Kind Regards,
Brian
You cannot directly deactivate a fog area, but Fear Not! You can fade the fog area's alpha value to 0 with a script, which basically makes the area transparent. I cannot remember the function off the top of my head, but it'll be on the wiki somewhere Smile


Here are value scripts:


void SetFogColor(float afR, float afG, float afB, float afA);
afR - red value
afG - green value
afB - blue value
afA - alpha value


void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);
afStart - how many meters from the camera should the fog begin
afEnd - how many meters from the camera should the fog reach full thickness
afFalloffExp - the amount by which the thinkness increases
abCulling - whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded


_____________________________


But if you're able to, this may be easier. It does GLOBAL fog, which surrounds the ENTIRE map. I'm not sure if you have it set in a specific area, or will be able to do this shrtcut instead. ALSO, I don't believe you can change values of global fog, so you'd probably have to change settings for global fog in the level editor, save it there, THEN run this script:


void SetFogActive(bool abActive);
Enables\Disables the global fog.

I musn't be the global fog. The fog area is a small bundle.

void SetFogColor(float afR, float afG, float afB, float afA);
This one doesn't change one specific fog area, because you can't fill the name of the fog area in here anywhere, so the game won't know what fog area you are talking about.

void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);
Again, you can't fill in the name of the specific fog area, so the game won't know what fog area you are talking about.

Hmm... there must be a way making those specific fog areas invisible an then visible ingame...
You might have to use particle effects instead of fog, unless you can attach a boxlight to the fog, much like you can attach one to a billboard, if you can do that, it will work Smile

1. attach fog to boxlight,
2. move boxlight away from map,
3. use SetLightColorTo or whatever the function name is to fade light to 0,
4. fog will be same colour as boxlight!
I can't find any option for attaching lights to a fogarea, so I think that isn't possible. If I use a particle system, the light will be flat. I've started a topic about this earlier here:

http://www.frictionalgames.com/forum/thr...e+of+light
(12-24-2011, 12:04 PM)DRedshot Wrote: [ -> ]You might have to use particle effects instead of fog, unless you can attach a boxlight to the fog, much like you can attach one to a billboard, if you can do that, it will work Smile

1. attach fog to boxlight,
2. move boxlight away from map,
3. use SetLightColorTo or whatever the function name is to fade light to 0,
4. fog will be same colour as boxlight!

(12-24-2011, 01:39 PM)Sauron The King Wrote: [ -> ]I can't find any option for attaching lights to a fogarea, so I think that isn't possible. If I use a particle system, the light will be flat. I've started a topic about this earlier here:

http://www.frictionalgames.com/forum/thr...e+of+light
(12-24-2011, 12:04 PM)DRedshot Wrote: [ -> ]You might have to use particle effects instead of fog, unless you can attach a boxlight to the fog, much like you can attach one to a billboard, if you can do that, it will work Smile

1. attach fog to boxlight,
2. move boxlight away from map,
3. use SetLightColorTo or whatever the function name is to fade light to 0,
4. fog will be same colour as boxlight!
I think I can see what you're trying to do here. As an alternative, why don't you try placing a small circle shaped billboard at the end of the laserbeam, make it the same colour as the laser, and make it type point, so that the "flat" end of the laser is hidden from view. Once it is done, you can use fog particles without worrying that the laser will look flat Smile

Hopefully you understand what I mean

(12-24-2011, 02:15 PM)DRedshot Wrote: [ -> ]
(12-24-2011, 01:39 PM)Sauron The King Wrote: [ -> ]I can't find any option for attaching lights to a fogarea, so I think that isn't possible. If I use a particle system, the light will be flat. I've started a topic about this earlier here:

http://www.frictionalgames.com/forum/thr...e+of+light
(12-24-2011, 12:04 PM)DRedshot Wrote: [ -> ]You might have to use particle effects instead of fog, unless you can attach a boxlight to the fog, much like you can attach one to a billboard, if you can do that, it will work Smile

1. attach fog to boxlight,
2. move boxlight away from map,
3. use SetLightColorTo or whatever the function name is to fade light to 0,
4. fog will be same colour as boxlight!
I think I can see what you're trying to do here. As an alternative, why don't you try placing a small circle shaped billboard at the end of the laserbeam, make it the same colour as the laser, and make it type point, so that the "flat" end of the laser is hidden from view. Once it is done, you can use fog particles without worrying that the laser will look flat Smile

Hopefully you understand what I mean
But if you place a circle shaped billboard at the end of the laserbeam and you stand next to the laserbeam, you will still see that it is flat. Not only the end is flat, the middle is also flat... I'm still trying to make it a beam myself, but I just can't find the answer for it...

(See attachment for pictures)
Finally solved! Used a billboard with a pointlight at the ends of it just like [b]DRedshot [/b]said. It doesn't look perfect but it does work now Smile