John 540 Report post Posted November 18, 2015 (edited) **UPDATED** Now has configuration settings for messages and other configurable options. Hi guys, id like to share with you another script I made. What this script does is the following - Applies effects to players based on certain weather circumstances and checks for conditions such as warm clothing, cover, fire etc. Default settings Conditions for cold are when it is between 7pm and 5am OR when it is raining beyond a factor of 0.5. Players are checked for "cold" roughly every 3 minutes If the player does not have Warm clothing, or is not within 50m of a building or not within 20m of a fire they would be "cold" and vulnerable to the effects There are 4 values the script looks at - Warm: Weather or not the player is warm or not, this determines weather to apply the next value - Cold: This value is applied if the player is not warm, it ranges from 0 - 1 - Sick: This value is boolean, true or false. If true the next value can increase -Sick Value: This value ranges from 0 - 1 If the player is not warm, Cold will increase slowly. If the player has a cold value higher than 0 they have a chance to get sick. If the players cold value is higher then 0.3 they suffer the effects of cold the cold value will continue to increase. Cold effects - Above 0.3, every 3 minutes (roughly) the player will loose 7% HP and suffer camera shaking A cold value of 0-1 will give the message "You are getting cold.." A cold value of 0-2 will give the message "You are starting to freeze.." A cold value of 0-3 and above will give the message "You are freezing..." If the player gets sick, his sick value will begin to increase, sick value will only increase while the player is not warm. A sick value of 0 to 0.25 has no ill effect "You are sick.." A sick value of 0.25 to 0.5 will cause the player to loose 2% hp every 2-3 minutes, enable fatigue for the player and cause a camera shake. "You are very sick.." A sick value of 0.50 and above will cause the same affects but set fatigue to 1 (make you walk) and apply a blood effect to your screen. "You are dieing..." sick value will continue to increase while the player is above 0.3 cold. To get healthy - Get warm! once your cold is 0. Your sickness will start to deteriorate over time. The colder / sicker you are the longer this takes. If the player is Warm and their cold value is 0 sickness will reduce over time. Once the value of cold reaches 0 and sick Value is less than 0.25 the payer will receive the message "You are feeling better..." When the following conditions are met the player will receive the message "You are healthy..." Player is warm Player is not sick Player is not cold Players health is above 90% If users do not want messages displaying, there are configurable options in the script. Installation - 1. Create a file called "WeatherEffects.sqf" inside this file place this code - hmm the code / spoiler things seems to be gone, so pastebin.. http://pastebin.com/963A7FED 2. At the bottom of your "InitPlayerLocal.sqf" put - [] execVM "WeatherEffects.sqf"; 3. Profit Some pictures of the warning messages - Edited January 11, 2016 by John 16 Share this post Link to post Share on other sites
BetterDeadThanZed 1006 Report post Posted November 19, 2015 Sounds cool. I'll be testing this out. Sounds like something that should be part of Exile already! 1 Share this post Link to post Share on other sites
ka0s 457 Report post Posted November 19, 2015 @John I love you! Thanks for creating this, was actually considering to do it myself, will check it out with next release, and see what else we can put into it Share this post Link to post Share on other sites
John 540 Report post Posted November 20, 2015 I have a new version of the script I am working on that advances the levels further - New mechanics will be. Value - "Cold" ranges 0 -1 Players will have a cold value that is constantly updating. Value "Sick" 0 -1 Players will have a sick value that is constantly updating The values will not instantly decrease based on circumstances anymore, but rather they will reduces / increase over time. The script will also have configurable notifcations to display such as - "You are comfortable" "You are getting cold" "You are starting to freeze.." "You are freezing" "You are sick" "You are very sick" etc.. this will be able to be turned on or off as you so desire so don't freak out. - John 3 Share this post Link to post Share on other sites
READTHESCROLL 203 Report post Posted November 20, 2015 Sounds pretty cool so far.. Any chance you could do a temperature system that bases off of the date in the mission sqm that could tie into all this? Could have fluctuating temperatures based off real world values that further determine how cold or hot someone gets. Introducing heat temp could be interesting. The hotter it is, the faster your thirst goes down but when it rains you dont get sick. Just some ideas! Share this post Link to post Share on other sites
John 540 Report post Posted November 21, 2015 OP has the latest version, please update it if your using it. I left out a very important piece of the puzzle.. Share this post Link to post Share on other sites
John 540 Report post Posted November 22, 2015 On 11/21/2015, 8:26:46, READTHESCROLL said: Sounds pretty cool so far.. Any chance you could do a temperature system that bases off of the date in the mission sqm that could tie into all this? Could have fluctuating temperatures based off real world values that further determine how cold or hot someone gets. Introducing heat temp could be interesting. The hotter it is, the faster your thirst goes down but when it rains you dont get sick. Just some ideas! I could, however, unless you are changing your mission date it would be the same all the time? I'll look into it though. I might make it configurable, tell me what dates would equal what effects, ie summer, winter, etc etc. Im from Australia which would be the minority and I can't be bothered googling your real world dates :) Share this post Link to post Share on other sites
Tobias Solem 559 Report post Posted November 22, 2015 Again, John, you add something that really is awesome. Hats off. 1 Share this post Link to post Share on other sites
John 540 Report post Posted November 23, 2015 Thanks to a friend on mine, ill be testing tonight adding "Cold Breath" coming from your character during cold conditions. Share this post Link to post Share on other sites
Diggz 16 Report post Posted November 24, 2015 another awesome script by yourself :) Share this post Link to post Share on other sites