{"name":"setRain","title":"setRain","type":"command","url":"https://community.bistudio.com/wiki/setRain","revid":377884,"updated":"2026-01-04T16:27:04Z","groups":["Environment"],"status":"ok","games":{"ofp":"1.75","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.75","arma3_since":"0.50","locality":{"effect":"global","server_exec":true},"description":"Sets rain density smoothly over the given transition time. A transition time of zero means an immediate change.\nA rain density of zero is no rain, one is maximum rain. Rain is not possible when overcast is less than 0.7.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 this command is multiplayer-synchronised:\n>\n> - if executed on the server, the changes will propagate globally.\n> - if executed on a client, the effect is local, temporary and will soon change to the server setting.\n>\n> Minimum overcast needed for rain in Arma 3 is **0.5**.\n\n> [!IMPORTANT]\n> Alternative syntaxes (Syntax 2 and Syntax 3):\n>\n> - set rain particle params. Rain particles params are client-side params and are ignored on dedicated server. Use helper function BIS_fnc_setRain if sync is needed in Multiplayer\n> - have a **local** Local effect effect","syntaxes":[{"syntax":"time setRain rain","params":[{"name":"time","type":"Number","description":"transition time in seconds to the new value","type_expr":"Number"},{"name":"rain","type":"Number in range 0..1","description":"new rain value","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"time"},"right":{"text":"rain"}},{"syntax":"setRain rainParams","since":"arma3 2.08","effect":"local","params":[{"name":"rainParams","type":"Array of Anything","description":"custom `RainParticles` params - see rainParams. Use empty array [] to reset to default config values","type_expr":"Array<Anything>"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"rainParams"}},{"syntax":"setRain config","since":"arma3 2.08","effect":"local","params":[{"name":"config","type":"Config","description":"config path to a custom class, which contains `RainParticles` class. Use configNull to reset to default config values","type_expr":"Config"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"config"}}],"examples":[{"code":["60 setRain 1;"]},{"text":"Force no rain:\n\n```sqf\n0 setRain 0;\nforceWeatherChange;\n999999 setRain 0;\n```","code":["0 setRain 0;\nforceWeatherChange;\n999999 setRain 0;"]},{"text":"See also BIS_fnc_setRain since Arma 3 v2.10:\n\n```sqf\n0 setOvercast 1;\n0 setRain 1;\n0 setFog 0.1;        // snow affects visibility at distance\nsetHumidity 0.9;    // don't want to see dust clouds\nenableEnvironment [false, true];    // don't want to see snakes and butterflies either\nforceWeatherChange;\n[\n    \"a3\\data_f\\snowflake4_ca.paa\",    // rainDropTexture - 4 means it has 4 flakes in it. Other available textures: snowflake8_ca.paa, snowflake16_ca.paa\n    4,                // texDropCount - 4 because we are using texture with 4 flakes. Change to 8 or 16 in accordance with other textures used\n    0.01,            // minRainDensity\n    25,                // effectRadius\n    0.05,            // windCoef\n    2.5,            // dropSpeed\n    0.5,            // rndSpeed\n    0.5,            // rndDir\n    0.07,            // dropWidth\n    0.07,            // dropHeight\n    [1, 1, 1, 0.5],    // dropColor\n    0.0,            // lumSunFront\n    0.2,            // lumSunBack\n    0.5,            // refractCoef\n    0.5,            // refractSaturation\n    true,            // snow\n    false            // dropColorStrong\n]\ncall BIS_fnc_setRain;\n```","code":["0 setOvercast 1;\n0 setRain 1;\n0 setFog 0.1;\t\t// snow affects visibility at distance\nsetHumidity 0.9;\t// don't want to see dust clouds\nenableEnvironment [false, true];\t// don't want to see snakes and butterflies either\nforceWeatherChange;\n[\n\t\"a3\\data_f\\snowflake4_ca.paa\",\t// rainDropTexture - 4 means it has 4 flakes in it. Other available textures: snowflake8_ca.paa, snowflake16_ca.paa\n\t4,\t\t\t\t// texDropCount - 4 because we are using texture with 4 flakes. Change to 8 or 16 in accordance with other textures used\n\t0.01,\t\t\t// minRainDensity\n\t25,\t\t\t\t// effectRadius\n\t0.05,\t\t\t// windCoef\n\t2.5,\t\t\t// dropSpeed\n\t0.5,\t\t\t// rndSpeed\n\t0.5,\t\t\t// rndDir\n\t0.07,\t\t\t// dropWidth\n\t0.07,\t\t\t// dropHeight\n\t[1, 1, 1, 0.5],\t// dropColor\n\t0.0,\t\t\t// lumSunFront\n\t0.2,\t\t\t// lumSunBack\n\t0.5,\t\t\t// refractCoef\n\t0.5,\t\t\t// refractSaturation\n\ttrue,\t\t\t// snow\n\tfalse\t\t\t// dropColorStrong\n]\ncall BIS_fnc_setRain;"]}],"multiplayer":"Prior to Arma 3, each client and the server could have different rain values.","see_also":["rainParams","BIS_fnc_setRain","overcast","setOvercast","rain","nextWeatherChange","forceWeatherChange","setFog","setHumidity"],"notes":[{"user":"Zapat","date":"2015-12-15T14:31:00Z","text":"setTimeMultiplier does **not** affect transition time."},{"user":"Killzone_Kid","date":"2016-11-16T22:06:00Z","text":"Using Example 2 on dedicated server might need additional interference on JIP clients. The reason is that JIP has rain value > 0 slowly changing to 0. To force client to sync one can execute this on client:\n\n```sqf\nskipTime 1; skipTime -1;\n```"}]}