Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Activate/deactivate fog Area
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#1
Activate/deactivate fog Area

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
(This post was last modified: 12-24-2011, 12:59 AM by Sauron The King.)
12-24-2011, 12:58 AM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#2
RE: Activate/deactivate fog Area

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



12-24-2011, 01:40 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#3
RE: Activate/deactivate fog Area

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.

(This post was last modified: 12-24-2011, 01:46 AM by Statyk.)
12-24-2011, 01:44 AM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#4
RE: Activate/deactivate fog Area

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...
12-24-2011, 10:58 AM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#5
RE: Activate/deactivate fog Area

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!

(This post was last modified: 12-24-2011, 12:07 PM by DRedshot.)
12-24-2011, 12:04 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#6
RE: Activate/deactivate fog Area

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!

(This post was last modified: 12-24-2011, 01:43 PM by Sauron The King.)
12-24-2011, 01:39 PM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#7
RE: Activate/deactivate fog Area

(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


(This post was last modified: 12-24-2011, 02:16 PM by DRedshot.)
12-24-2011, 02:15 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#8
RE: Activate/deactivate fog Area

(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)


Attached Files
.jpg   Naamloos.jpg (Size: 39.36 KB / Downloads: 99)
(This post was last modified: 12-24-2011, 05:35 PM by Sauron The King.)
12-24-2011, 05:16 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#9
RE: Activate/deactivate fog Area

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
(This post was last modified: 12-30-2011, 02:18 AM by Sauron The King.)
12-25-2011, 01:04 PM
Find




Users browsing this thread: 1 Guest(s)