Jump to content
Official BF Editor Forums
Sign in to follow this  
jeffreyrichey

Weather

Recommended Posts

UPDATED March 10, 2007

+added custom weather info, various other fix's

Heres a short tut on getting weather to work ingame for those of you who havn't figured it out already.

**In your mod/2142 folder theres a bunch of .con files names rain, rain_heavy, snow_medium, etc. etc

**Copy the .con of the weather you want

**Paste it into your levels main folder (mods/bf2142/levels/My_Map)

**Rename this .con you just pasted "Weather"

**Open your init.con for the level

**Add 2 lines to your init .con

rem *** Generated by BF2Editor ***
if v_arg1 == BF2Editor

run Heightdata.con
LevelSettings.InitWorld
run Terrain.con BF2Editor
run StaticObjects.con BF2Editor
run Sounds.con
run Sky.con BF2Editor
[b]run weather.con BF2Editor[/b]
run Editor/GamePlayObjects.con host
UndergrowthEditable.create
Undergrowth.load Levels\Rising_Tides\
run Overgrowth/Overgrowth.con
Overgrowth.editorEnable 1
run AmbientObjects.con BF2Editor
run Water.con
run TriggerableTemplates.con BF2Editor

else

run Heightdata.con
run Terrain.con v_arg2
run Sky.con v_arg2
[b]run weather.con v_arg2[/b]
run CompiledRoads.con
run Sounds.con
run tmp.con v_arg1
Undergrowth.load Levels\Rising_Tides\
run Overgrowth/Overgrowth.con
run Overgrowth/OvergrowthCollision.con
run AmbientObjects.con
run Water.con
run TriggerableTemplates.con

CUSTOM WEATHER**

You can also make your own weather. (JUNAUM and I found out this stuff while working on a custom map)

Note if you follow these instructions you do not need a mod, this will work in default 2142 because you do not actually modify any client data.

For starters you can make your own sprite, for instance if you want yellow snow to fall (dogs DO go to heaven!)

each weather con file has a line stating where the texture/sprite for that weather is found. The default setting is "rainmanager.settexture common/textures/snow" So the texture is in fact located in mods/2142/common_client/textures. This means that the game will reference this file in this location. However if you add a new texture to this directory your players wont have it (becasue its added to the players client data.) Instead you can male the game reference the texture instead from a location within your map. Simply make a new folder in your map folder (I named mine "textures") and place your new texture you want in there. Then in your weathers con file change the location settings to "rainmanager.settexture levels/your_mapname_here/textures/your custom texture" The best way to find the best weather settings is to find a default one thats closest to what you want and start with that as a base, then modify it.

Heres what the settings mean from what I have been able to figure out. I'm using the weather con from "snow_light" as an example.

for Snow:

rainmanager.enabled 0
							  Don't know
rainmanager.particlecount 3000	
							   Amount of particles of course.  IE density.  10000 is alot of snow, 1000 not so much
rainmanager.offset 0,10,0											  
							  Governs where the effect begins in relation to the map.  For instance 0,10,0 means it begins high and																				  
							   ends near the ground.  If you change it to 0/70/0 the snow will end way above the player for example. 
rainmanager.emitradius 80,30,80
							   Nothing as far as I can tell
rainmanager.particlecolor 1,1,1,0.5
								 Don't know.  Should just depend on the actual texture used
rainmanager.particlesize 8
							   particle size.  20 is rather large.  You could use this for hail (plus modifying other parts of course)
rainmanager.particleMaxsize 20
							   I thin this governs the max size if the particle size fluctuates.  I do not know if some do or not.
rainmanager.particleScale 0,0.1,0
							   Beats me
rainmanager.particlevelocity 0,-0.5,0.15
							   Don't know
rainmanager.particlespeed 6
							  Particles Movment speed.  For example rain falls faster then snow so it has a higher particle speed.  6 is slow
rainmanager.fadeoutrange 0.875
							   Well, its the fade out range.  What setting constitutes what I dont know.  2 dosn't work.  I think the max is actaully 1
rainmanager.maxdeviation 3,3,3
							   How far individual sprites move back and forth (x,y,z ?)
rainmanager.anglespeed 50,50
								Speed at wich the particles change direction.  For instance snow actually falls back and forth and sways.
rainmanager.celldisplay 0
								Don't know
rainmanager.linedisplay 0
							   0 for Snow, 1 for rain.  This setting governs if the sprite leaves a "streak" when it falls, like rain. 0=no 1=yes
rainmanager.settexture common/textures/snow
								 location of where your sprite is stored
rainmanager.enabled 1  
							  Dont know.  I assume 1 means weather enabled 0 is off.

For rain:

rainmanager.enabled 0
rainmanager.particlecount 5000
rainmanager.offset 0,10,0
rainmanager.emitradius 60,30,60
rainmanager.particlecolor 0.5/0.5/1/0.1
rainmanager.particlevelocity -0.1/-1/0
rainmanager.particlespeed 60
rainmanager.linelength 3
						  Length of the streak left when the particle falls
rainmanager.linedisplay 1
rainmanager.settexture common/textures/snow
rainmanager.enabled 1

NOTES

When finished set your init.con to read only so it dosn't get reset. Thanks Xaritix for reminding me (again...)

Edited by jeffreyrichey

Share this post


Link to post
Share on other sites

It took me an hour and a half to realize why your code wasn't working. Look at the DICE part of the code.

run Terrain.con v_arg2

run Sky.con v_arg2

Now look at your codeline

run weather.con v_arg_2

After loading and unloading several times and wondering why the snow wasn't falling, I compared the weather.con to Minsk. It's weather line appeared as:

run weather.con v_arg2

I put that in instead of your code and it worked! Please edit this, to make sure no one else has to go through this.

Edited by Soduka

Share this post


Link to post
Share on other sites
Heres a short tut on getting weather to work ingame for those of you who havn't figured it out already.

**In your mod/2142 folder theres a bunch of .con files names rain, rain_heavy, snow_medium, etc. etc

**Copy the .con of the weather you want

**Paste it into your levels main folder (mods/bf2142/levels/My_Map)

**Rename this .con you just pasted "Weather"

**Open your init.con for the level

**Add 2 lines to your init .con

rem *** Generated by BF2Editor ***

if v_arg1 == BF2Editor

run Heightdata.con

LevelSettings.InitWorld

run Terrain.con BF2Editor

run StaticObjects.con BF2Editor

run Sounds.con

run Sky.con BF2Editor

run weather.con BF2Editor

run Editor/GamePlayObjects.con host

UndergrowthEditable.create

Undergrowth.load Levels\Rising_Tides\

run Overgrowth/Overgrowth.con

Overgrowth.editorEnable 1

run AmbientObjects.con BF2Editor

run Water.con

run TriggerableTemplates.con BF2Editor

else

run Heightdata.con

run Terrain.con v_arg2

run Sky.con v_arg2

run weather.con v_arg2

run CompiledRoads.con

run Sounds.con

run tmp.con v_arg1

Undergrowth.load Levels\Rising_Tides\

run Overgrowth/Overgrowth.con

run Overgrowth/OvergrowthCollision.con

run AmbientObjects.con

run Water.con

run TriggerableTemplates.con

There you go. You now have weather. Congrats.

NOTES

Just like the team settings in your init.con, everytime you edit the map you will have to add the 2 "run weather.con" lines in your init.con. They are erased each time the editor remakes your init.con. The best time to do this is if course after editing the map just prior to testing it.

FOR GOD SAKES HOW MANY TIMES MUST I SAY, SEE A BUTTON IN "PROPERTIES" CALLED "READ ONLY"??? rofl

Seriously just set it to read only

Share this post


Link to post
Share on other sites

If you make your own texture (ie, sand for sandstorms) you can place it in your client.zip of your map, then change this instruction:

rainmanager.settexture common/textures/snow (snow is really snow.dds) to:

rainmanager.settexture Levels/"your level"/sand. modify the location if you put the texture in another deeper folder (ie, rainmanager.settexture Levels/"your level"/"your folder"/sand.

Set the particles to at least 30k, more would be better. I'm not sure if it crashes on higher numbers.

of course set the speed faster and choose snow. I haven't tried rain, to get streaks of sand, but it could be interesting.

Share this post


Link to post
Share on other sites

Hehe, Bensta your link does open a reply post window :blink: Nice :P

None of this works in BF2 retail. But a lot of it can be played with using the BF2_r.EXE debugger. Unfortunately ONLY the debugger has implemented the particled rain feature ( to a certain degree )

Share this post


Link to post
Share on other sites

Give it a try and keep an eye on the FPS rate. It will probably work but the FPS will suffer. Try to find a compromise between the number of particles and your framerate.

Share this post


Link to post
Share on other sites

I've set the particles to 100000 while invoking on a local server.

No lag as long as it's in a small area.. for the whole map, maybe.

Share this post


Link to post
Share on other sites

I tried out my suggested rainfall, looks more realistic, the only thing needs changing is the direction in which it falls as it doesn't fall vertically, any ideas on how to change that?

Share this post


Link to post
Share on other sites

There is a "directionfromspeed" thing, which will rotate it according to the direction it travels across the screen. Next step is finding a texture that points the right way.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×