Howdy zed heads, this modification here was cooked up several days ago. I can't remember if it was my wife's idea or mine but it turned out real well nonetheless.
Basically this is a modification of the water_fill.sqf file located within \dayzinstallfolder\@dayz\addons\dayz_code.pbo file. What it does is it allows the player to fill his or her water bottle with rainwater. Player must be outside to perform the action. The length of time required to collect enough is determined by the intensity of the rain. The process can also be interrupted yielding no rainwater collected. The script is configurable in that the rainwater collected in the bottle can be flagged as safe to drink or flagged as requiring boiling (similar to collecting water in a pond).
Anyhoo, on the add-on.
Step 1) Modify compiles.sqf and fn_SelfActions.sqf
On or about line 74, in compiles.sqf file located within \dayzinstallfolder\MPMissions\dayz_1.Chernarus folder, you'll see this line:
Comment out that line with two forward slashes // and add this line directly below it:
The two lines should now look like this:
Basically what we're doing here is telling DayZ to look for the water filling script in a different spot rather than within the dayz_code.pbo file. For those that are unfamiliar with unpacking PBO files and getting access to compiles.sqf for example, there are several tutorials on the forum available with more information. Also, feel free to post here and I'll give step-by-step instructions on a process you can use to do this. This is the same process that's used in many of the add-ons released.
Notice within the newly-added line the path given is "fixes\". The "fixes" folder is the folder name used in several other addons so I've stayed with it. Two others, "custom" and "scripts" may exist as well. If you have either of these, change "fixes" to either of those to be reflected here. Our new player_waterfill.sqf file will be placed there.
In fixes\fn_selfActions.sqf (or wherrever an extracted fn_selfActions.sqf file has been placed), on or about line 500 (it might be before), you'll find a section with a list of "player removeAction"'s. Example:
At the tail-end of that list, add these two lines:
For help on getting access to fn_selfActions.sqf, feel free to post below and I'll help out.
Step 2) Download and Modify player_waterFill.sqf
Player_waterFill.sqf can be downloaded here -> http://www.mediafire.com/download/kna0ieacc81ht73/player_waterfill.sqf
Place the file in a subfolder (default is "fixed" but may also be "custom" or "scripts" as mentioned previously) of \dayzinstallfolder\MPMissions\dayz_1.Chernarus. The folder name must match the entry the reference within compiles.sqf is pointing.
If there is trouble with the link, I will post the entirety of the script file in the post below.
Within player_waterFill.sqf, there's a section towards the top labeled "Configurable Variables":
Included are three variables for the time in seconds it takes to fill the bottle depending upon intensity of the rain. I default these to 12, 18, and 26 seconds respectively. The fourth variable, _CleanRainWater, can be set to true or false and will determine whether or not the rainwater collected needs boiling thereafter.
You're done! Let me know if you have any questions.
Basically this is a modification of the water_fill.sqf file located within \dayzinstallfolder\@dayz\addons\dayz_code.pbo file. What it does is it allows the player to fill his or her water bottle with rainwater. Player must be outside to perform the action. The length of time required to collect enough is determined by the intensity of the rain. The process can also be interrupted yielding no rainwater collected. The script is configurable in that the rainwater collected in the bottle can be flagged as safe to drink or flagged as requiring boiling (similar to collecting water in a pond).
Anyhoo, on the add-on.
Step 1) Modify compiles.sqf and fn_SelfActions.sqf
On or about line 74, in compiles.sqf file located within \dayzinstallfolder\MPMissions\dayz_1.Chernarus folder, you'll see this line:
Code:
player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
Comment out that line with two forward slashes // and add this line directly below it:
Code:
player_fillWater = compile preprocessFileLineNumbers "fixes\player_waterfill.sqf";
The two lines should now look like this:
Code:
//player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
player_fillWater = compile preprocessFileLineNumbers "fixes\player_waterfill.sqf";
Basically what we're doing here is telling DayZ to look for the water filling script in a different spot rather than within the dayz_code.pbo file. For those that are unfamiliar with unpacking PBO files and getting access to compiles.sqf for example, there are several tutorials on the forum available with more information. Also, feel free to post here and I'll give step-by-step instructions on a process you can use to do this. This is the same process that's used in many of the add-ons released.
Notice within the newly-added line the path given is "fixes\". The "fixes" folder is the folder name used in several other addons so I've stayed with it. Two others, "custom" and "scripts" may exist as well. If you have either of these, change "fixes" to either of those to be reflected here. Our new player_waterfill.sqf file will be placed there.
In fixes\fn_selfActions.sqf (or wherrever an extracted fn_selfActions.sqf file has been placed), on or about line 500 (it might be before), you'll find a section with a list of "player removeAction"'s. Example:
Code:
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
At the tail-end of that list, add these two lines:
Code:
player removeAction s_player_fillbottlewithrain;
s_player_fillbottlewithrain = -1;
For help on getting access to fn_selfActions.sqf, feel free to post below and I'll help out.
Step 2) Download and Modify player_waterFill.sqf
Player_waterFill.sqf can be downloaded here -> http://www.mediafire.com/download/kna0ieacc81ht73/player_waterfill.sqf
Place the file in a subfolder (default is "fixed" but may also be "custom" or "scripts" as mentioned previously) of \dayzinstallfolder\MPMissions\dayz_1.Chernarus. The folder name must match the entry the reference within compiles.sqf is pointing.
If there is trouble with the link, I will post the entirety of the script file in the post below.
Within player_waterFill.sqf, there's a section towards the top labeled "Configurable Variables":
Code:
// Configurable variables
_HeavyRainFillTime = 12; // Time in seconds to refill bottle in very heavy rain; default is 12
_MediumRainFillTime = 18; // Time in seconds to refill bottle in medium/moderate rain; default is 18
_LightRainFillTime = 26; // Time in seconds to refill bottle in light rain; default is 26
_CleanRainWater = true; // Acceptable values are "true" or "false"; "false" denotes collected rain water needs boiling with tin can
Included are three variables for the time in seconds it takes to fill the bottle depending upon intensity of the rain. I default these to 12, 18, and 26 seconds respectively. The fourth variable, _CleanRainWater, can be set to true or false and will determine whether or not the rainwater collected needs boiling thereafter.
You're done! Let me know if you have any questions.