{"name":"setRain","operator":null,"title":"setRain","type":"command","url":"https://community.bistudio.com/wiki/setRain","revid":377884,"updated":"2026-01-04T16:27:04Z","groups":["Environment"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"global","server_exec":true},"exec":null,"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> - 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> Minimum overcast needed for rain in Arma 3 is **0.5**.\n\n> [!IMPORTANT]\n> Alternative syntaxes (#Syntax 2 and #Syntax 3):\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","since":null,"effect":null,"exec":null,"params":[{"name":"time","type":"Number","optional":false,"default":null,"description":"transition time in seconds to the new value","types":["Number"],"since":null,"text":"time: Number - transition time in seconds to the new value"},{"name":"rain","type":"Number in range 0..1","optional":false,"default":null,"description":"new rain value","types":["Number"],"since":null,"text":"rain: Number in range 0..1 - new rain value"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"time","types":["Number"]},"right":{"text":"rain","types":["Number"]}},{"syntax":"setRain rainParams","since":"arma3 2.08","effect":"local","exec":null,"params":[{"name":"rainParams","type":"Array of Anything","optional":false,"default":null,"description":"custom `RainParticles` params - see rainParams. Use empty array [] to reset to default config values","types":["Array","Anything"],"since":null,"text":"rainParams: Array of Anything - custom `RainParticles` params - see rainParams. Use empty array [] to reset to default config values"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"rainParams","types":["Array","Anything"]}},{"syntax":"setRain config","since":"arma3 2.08","effect":"local","exec":null,"params":[{"name":"config","type":"Config","optional":false,"default":null,"description":"config path to a custom class, which contains `RainParticles` class. Use configNull to reset to default config values","types":["Config"],"since":null,"text":"config: Config - config path to a custom class, which contains `RainParticles` class. Use configNull to reset to default config values"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"config","types":["Config"]}}],"examples":[{"text":"```sqf\n60 setRain 1;\n```","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.","problems":null,"aliases":[],"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```"}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Environment","Introduced with Operation Flashpoint version 1.75","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Scripting Commands: Server Execution","Take On Helicopters: Scripting Commands"]}