UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Adding fog to a certain area?

HOT
broken avatar :(
Created 12 years ago
by Suffocating Edge
0 Members and 1 Guest are viewing this topic.
9,577 views
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 9 years ago
Posts
19
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Programmer :)
×
Suffocating Edge's Contact & Social LinksZasah_CzombieedgeZasah_lewis
How am I able to add fog to a certain area of the map? I would like it so you are unable to see through the fog (I wont be allowing players to enter the part that has fog.) Here is an example of where I want the fog:

Spoiler: click to open...
(Behind the trees)

Thanks.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Either use UGX Easy FX, or use my fx function:

add this to your MAPNAME.gsc
Code Snippet
Plaintext
fx_start()
{
fx_init(level._effect["zombie_fog"], "amb_long");
}
fx_init(fx, key)
{
if(isdefined(fx) && isdefined(key) )
{
fx_spawn = getentarray(key, "targetname");

for( i = 0; i < fx_spawn.size; i++ )
{
playfx(fx, fx_spawn[i].origin);
}
}
}

in MAPNAME_FX.gsc make sure this is included:

Code Snippet
Plaintext
level._effect["zombie_fog"] 	  		      = loadfx("env/smoke/fx_fog_zombie_amb");

Place script_origins wherever you want fox with the targetname of "amb_long".

EDIT: the level affect was the _short version. fixed.

Last Edit: April 16, 2014, 09:50:42 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 9 years ago
Posts
19
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Programmer :)
×
Suffocating Edge's Contact & Social LinksZasah_CzombieedgeZasah_lewis
Either use UGX Easy FX, or use my fx function:

add this to your MAPNAME.gsc
Code Snippet
Plaintext
fx_start()
{
fx_init(level._effect["zombie_fog"], "amb_long");
}
fx_init(fx, key)
{
if(isdefined(fx) && isdefined(key) )
{
fx_spawn = getentarray(key, "targetname");

for( i = 0; i < fx_spawn.size; i++ )
{
playfx(fx, fx_spawn[i].origin);
}
}
}

in MAPNAME_FX.gsc make sure this is included:

Code Snippet
Plaintext
level._effect["zombie_fog"] 	  		      = loadfx("env/smoke/fx_fog_zombie_amb");

Place script_origins wherever you want fox with the targetname of "amb_long".

EDIT: the level affect was the _short version. fixed.

I tried that however, the fog doesn't seem to show :'( I haven't received any errors when compiling and running, do I add the
Code Snippet
Plaintext
level._effect["zombie_fog"] 	  		      = loadfx("env/smoke/fx_fog_zombie_amb");

under

Code Snippet
Plaintext
precache_createfx_fx()
or
Code Snippet
Plaintext
precache_scripted_fx()

And also how many origins should I add per area?

(Here's what I have done so far)
Spoiler: click to open...



(in mapname.gsc)


(under
Code Snippet
Plaintext
precache_scripted_fx()
)
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
I tried that however, the fog doesn't seem to show :'( I haven't received any errors when compiling and running, do I add the
Code Snippet
Plaintext
level._effect["zombie_fog"] 	  		      = loadfx("env/smoke/fx_fog_zombie_amb");

under

Code Snippet
Plaintext
precache_createfx_fx()
or
Code Snippet
Plaintext
precache_scripted_fx()

And also how many origins should I add per area?

(Here's what I have done so far)
Spoiler: click to open...



(in mapname.gsc)


(under
Code Snippet
Plaintext
precache_scripted_fx()
)

i have it under:

Code Snippet
Plaintext
precache_createfx_fx()

but it shouldn't really matter.

try calling the precache function likeso:

Code Snippet
Plaintext
maps\MAPNAME_fx::precache_createfx_fx();

under

Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();

Quote
And also how many origins should I add per area?

Don't know for sure. The fog that i use isn't that thick so you may want to try other FX's and see how well they work.
Last Edit: April 16, 2014, 11:01:20 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 9 years ago
Posts
19
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Programmer :)
×
Suffocating Edge's Contact & Social LinksZasah_CzombieedgeZasah_lewis
i have it under:

Code Snippet
Plaintext
precache_createfx_fx()

but it shouldn't really matter.

try calling the precache function likeso:

Code Snippet
Plaintext
maps\MAPNAME_fx::precache_createfx_fx();

under

Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();

Don't know for sure. The fog that i use isn't that thick so you may want to try other FX's and see how well they work.

So, I tried adding that code under:

Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();


And I got this error:
Spoiler: click to open...

(I have no idea...)

When I remove that line, the map works again, but no fog :'(
Last Edit: April 16, 2014, 11:15:46 pm by Suffocating Edge
broken avatar :(
×
broken avatar :(
Location: gbIsle of Man
Date Registered: 17 July 2013
Last active: 6 years ago
Posts
536
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
- It was a clear black night, a clear white moon -
Signature
<3

AnimalLover

Aranda
Aldenrade
Christmas

<3

×
animallover's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
If all else fails just try adding more to the background and adding in a black or white cloud into the map! Thats how i got my 'fog' in mine.. And it looks nice :)
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
So, I tried adding that code under:

Code Snippet
Plaintext
/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();


And I got this error:
Spoiler: click to open...

(I have no idea...)

When I remove that line, the map works again, but no fog :'(

That isn't my scripts fault O.o

What does developer give for the error?
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 9 years ago
Posts
19
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Programmer :)
×
Suffocating Edge's Contact & Social LinksZasah_CzombieedgeZasah_lewis
If all else fails just try adding more to the background and adding in a black or white cloud into the map! Thats how i got my 'fog' in mine.. And it looks nice :)

I have an idea for a certain part of the map that would look really good with actual fog :( I will keep trying and looking at the code given to me so far. :) See if I can get it working in my map.



That isn't my scripts fault O.o

What does developer give for the error?

That's on developer 1
Last Edit: April 16, 2014, 11:23:44 pm by Suffocating Edge
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
I have an idea for a certain part of the map that would look really good with actual fog :( I will keep trying and looking at the code given to me so far. :) See if I can get it working in my map.



That's on developer 1

right, what does it say in the console?
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 9 years ago
Posts
19
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Programmer :)
×
Suffocating Edge's Contact & Social LinksZasah_CzombieedgeZasah_lewis
right, what does it say in the console?

Spoiler: click to open...





EDIT:

There may be a slight possibility that I removed the fog FX whilst working on my test map for some scripts. Are there any zone_source etc files that I should check to see if I commented them out?
Last Edit: April 16, 2014, 11:44:06 pm by Suffocating Edge
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Spoiler: click to open...





nevermind MAPNAME_fx then, put the loadfx code inside fx_start();, should (hopefully) work all the same.

I have no idea whats causing the bad token, the code DOES WORK the way i said:



Post Merge: April 16, 2014, 11:50:49 pm
Spoiler: click to open...





EDIT:

There may be a slight possibility that I removed the fog FX whilst working on my test map for some scripts. Are there any zone_source etc files that I should check to see if I commented them out?

The fx include is in _zombiemode i think.
Last Edit: April 16, 2014, 11:50:49 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 9 years ago
Posts
19
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Programmer :)
×
Suffocating Edge's Contact & Social LinksZasah_CzombieedgeZasah_lewis
Ok, still not working :(

I will check out UGX Easy Fx
Last Edit: April 17, 2014, 12:04:04 am by Suffocating Edge
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Ok, still not working :(

Code Snippet
Plaintext
 
// level.DLC3.myFX = ::preCacheMyFX;

Is commented, should I 'uncomment' it?

That function was removed. it originally had a loadfx for snow in it... try creating the function and adding the loadfx to it, might work IDK. Kinda out of ideas.

did you recompile your entire map after re adding the fx by chance?
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 9 years ago
Posts
19
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Programmer :)
×
Suffocating Edge's Contact & Social LinksZasah_CzombieedgeZasah_lewis
That function was removed. it originally had a loadfx for snow in it... try creating the function and adding the loadfx to it, might work IDK. Kinda out of ideas.

did you recompile your entire map after re adding the fx by chance?

Yes.

The only reason I can think of for this not working is that I have removed some FX after getting the limit in my test map. Other than that, I have no clue, I'm sure I'm doing it right.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Yes.

The only reason I can think of for this not working is that I have removed some FX after getting the limit in my test map. Other than that, I have no clue, I'm sure I'm doing it right.

One final effort... try adding this to your MAPNAME.csv in zone source:

Code Snippet
Plaintext
// fog at edge of level
fx,env/smoke/fx_fog_zombie_amb
fx,env/light/fx_ray_sun_sm_short

i'm completely out of ideas now... lol

 
Loading ...