This behavior is based on the description of the dangers of the environment, specifically heat and cold dangers, on page 86 of the third edition of the Dungeon Master's Guide. This or a later version of the DMG should be the primary resource for describing environmental fatigue. The Environmental Fatigue Engine tries to simulate the model described in the DMG as closely as possible but in some areas the Aurora toolset just didn't provide the functionality needed to do this. Also, the description of environmental fatigue is a little sparse in the DMG, and hence, I've had to take liberties and use creative license in certain areas. For example, no description is given for when a body falls to excessive temperatures and is then resurrected a little while later in the same area. My assumption was that they got all their life back with no damage (subdual or otherwise) but the body was still hot so the DC was not reset.
Basically, when you are in an excessively hot or cold place, you have to do a fortitude saving throw every hour (or 10 minutes in insanely hot or cold places). The first hour you are there the DC is 15. Every successive throw adds 1 to that DC. When you fail a fortitude saving throw due to environmental fatigue, you must take subdual damage. If you're in a cold place, you take 1D6 of subdual damage. If you are in a hot place you take 1D4 subdual damage.
Please note that subdual damage in the Environmental Fatigue engine doesn't work exactly like subdual damage described in the DMG. The main difference is this damage is local to the environmental fatigue scripts. In other words, if you take subdual damage from a punch (if we were to add a subdual damage system), the system as setup presently will not include this when tallying your subdual damage from the environment.
When you take subdual damage due to environmental fatigue you then get fatigue. There is no fatigue effect in NWN (as far as I know) so I simulate it by reducing the PC's dexterity and strength by 2. This is how fatigue due to the elements is supposed to affect you according to the DMG.
You can find relief from the elements by going near a waypoint that is properly tagged with ENFT_RELIEF_SPOT, having an environmental protection spell cast on you (this will also protect you from future fatigue form the elements for the duration of the spell), or coming to a temperate area (an area not flagged for the Environmental Fatigue engine). Relief will take away all the subdual damage, the fatigue effect if any, and reset your fortitude saving throw to 15. I should note that immunity to hot or cold will protect you from taking damage (subdual damage or otherwise) although your DC will still rise.
If you don't find relief and your subdual damage exceeds your HP, you fall unconscious. Unconscious means you can't move and are lying on the ground (well, hopefully). If you fall unconscious due to the cold, your skin also turns a nice shade of blue (the ice skin visual effect is applied to you). When you fall unconscious you roll as usual using an ever increasing DC and take damage with the same dice. However, now instead of subdual damage you take real heat or cold damage. You continue to take this damage until you find relief or die.
When you die, your subdual damage returns to zero and you are no longer unconscious. This isn't much consolation anymore but is important should you be raised.
This version of the Environmental Fatigue Engine is compatible with NWN2.
This is version 2 . 2 . 2 of the Environmental Fatigue Engine. Contained in this erf file are the scripts that constitute the environmental fatigue engine and a few equipable items that provide protection from the elements.
Thanks you. Now if I could just get 5 more votes then maybe this script could get into the HoF. :-)
Posted by bsb5652 at 2009-04-11 07:30:47 Voted 10.00 on 04/11/09
Excellent work! I was going to write something like this for our upcoming rollout! A+ _________________________ Brian S. Bloom
Realms of Trinity for NWN2 PW Creator Link
Neverwinter Nights Podcast Executive Producer Link
Posted by TastEPlasma at 2008-03-28 16:12:24 Voted 9.00 on 03/27/08
Thanks for the reply, edret. I just finished some scripting tutorials, and I think I understand what you mean about the difficulty of implementing a water bottle system. Im still mulling it over though, and if I come up with any bright ideas I will share them. As for the reality of it, considering what you've said I have re-thought my position. My thought is that if the player hasnt taken any subdual damage it takes a couple of points away from the DC, and if they have taken subdual damage it takes a few points of the heat dmg itself away. The idea is that before the heat really gets to them the water helps them shake it off, but once the physical effects of the heat start to take thier toll, the water only helps to delay the inevitable. I agree that water alone cant save you when out in the noon desert sun, but OTOH without it you would be worked over twice as fast.
Also, any implementation I personally do is made simpler by the fact that I am working on a module, not a persistant world, although I would like to keep it multi-player friendly (scaling treasures and encounters, etc).
As for Stridev's idea about the armor, I really like it from a realistic viewpoint. Gameplay mechanics-wise though, I am thinking that it would work well in a persistant world, where the PC's would view the desert with real trepidation (especially the fighters). However, in a single player module, I think such a mechanic would be viewed as annoying and detracting, however much sense it made.
Sorry for the lengthy comments, I am brevity-impaired, and thanks for the reply! Sad to say that I hope I won't need your help to pull it off. :-)
Whenever heat damage is applied to the PC by the EFE, you could include a multiplier or add bonus based on the armor the PC is wearing. For example, add ND4 heat damage to the base heat damage due to the environment where N is the PC's AC above some base amount (like, say 4). Another option is to raise the DC of the fatigue check by the amount the PC's AC is above some base amount.
Interesting idea stridev. Thanks for doing the research for me.
Perhaps I can implement this as an extension. The extra game mechanics doesn't seem too terribly complex (famous last worlds). I'd still wouldn't want this system part of the core code because some people may want the more light weight version of the EFE. And those that want the extra mechanics can just get the extension.
To TestEPlasma:
If I recall correctly, implementing something like a water bottle that refreshes and relieves you in extream heat was a bit more difficult to implement than an equipable item. I think to get the water bottle to work, you'd have to have the water bottle fire a unique power (or whatever it's called) when used and add code to the module event that handles when items are used to notife the EFE to relieve the player in question (and only that player).
It's not impossible to implement but it certainly is a pain in the but. Also, you can essentially get the same effect by drinking a resist elements potion or the like. Finally, does water really give you relief when you're walking in the desert at noon? If you had a bottomless canteen in the middle of the desert but no clothes, you might never go thirsty but you'd still probably die of heat stroke or sun poisioning before too long. Still, if adding water bottles that relieve you from the heat will add a dimension to the server, I say go for it.
As far as the code snippet you provided, it looks as if it should work. Mind you, I haven't examined the code in a little while. Test the code out extensively and if you can't find any bugs, then the code should work. And, if you do, then figure out the problem and make the fix. And, if you're stumped, feel free to ask me for help.
Posted by stridev at 2008-03-28 13:27:46 Voted 8.50 on 02/23/08
speaking of deserts, I had another idea for armor penalties. Would it be possible to multiply heat damage X armor check penalty? (or some fraction thereof?) So there would be incentive to just wear plain clothes. I'd think tromping around the Sahara in full plate would put you down pretty quickly.
Posted by TastEPlasma at 2008-03-27 00:11:51 Voted 9.00 on 03/27/08
Greetings, and thanks for the script, very useful indeed. I also wanted to say that implementing a water bottle system for the heat side would great, wherein using the item would reset (or perhaps take 3 to 5 off) the dc check of the fort save. I also needed a system that would allow the player (who is wandering in a desert) to get some relief at night, so I added this:
//Check for cooling nighttime
if(GetIsNight())
{
// Throws are set back to 0 because body temperature has returned to normal.
if(GetLocalInt(OBJECT_SELF, "HEAT_SUBDUAL_DAMAGE") > 0)
{
SendMessageToPC(OBJECT_SELF, "The setting sun brings relief at long last.");
SendMessageToPC(OBJECT_SELF, "Subdual damage: " + IntToString(0));
}
SetLocalInt(OBJECT_SELF, "HEAT_SUBDUAL_DAMAGE", 0);
SetLocalInt(OBJECT_SELF, "HEAT_THROWS", 0);
SetLocalInt(OBJECT_SELF, "HEAT_UNCONSCIOUS", 0);
// Remove unconscious effect if applied
RemoveSpecificEffect(EFFECT_TYPE_CUTSCENE_PARALYZE, OBJECT_SELF);
// Check for heat damage in an hour.
DelayCommand(heatTime, ExecuteScript("enft_heat_ftg", OBJECT_SELF));
return;
}
In-between the checks for a hot place and not a warm place, in the enft_heat_ftg script. I have no idea if it will work or not, I am hella noob at scripting, in fact this is the first one I have ever tried to change. Now if I can just figure out the whole water bottle thing...
;-D
Again, many thanks for this,
TastEPlasma
Posted by stridev at 2008-03-14 14:09:51 Voted 8.50 on 02/23/08
thanks for the update, edret. Love this system. I'm working on a late autumn module set in the Silver Marches so I'll be putting this to good use. :) It even works with companions! (which was my next concern)
I do have a few suggestions, though.
1. it seems that if you rest, even in a cold area and not protected, you can remove the fatigue effects.
2. as is, I think its too easy to defeat the system. You can just throw on the cloak, and you're completely immune.
I'd suggest varying levels of intensity/protection, so you might have to wear a cloak, warm clothes AND warm boots (for example) to protect yourself from the really cold areas, or a cloak by itself might be enough for slight chill. I think you should have to sacrifice more than one inventory slot in certain situations (like nighttime, or don't go out until daybreak).
To give me some inspiration for my mod, I went out and bought the "Frostburn" book. It details temperature effects beyond what is in the DMG(I think). I don't know the first thing about scripting, so I don't know how difficult it would be to expand the EFE, but in case you're interested in needlessly complicating your system :) here's the breakdown according to the book:
Essentially, there are four levels of "coldness", and four levels of "protection."
Temp. ranges:
Cold- 0 degrees F to +40 degrees F cold level 1
Severe cold -20 degrees F to 0 degrees F cold level 2
Extreme cold -50 degrees F to 20 degrees F cold level 3
Unearthly cold -50 degrees F or less cold level 4
Equipment:
No special equipment +0
cold weather outfit or fur clothing +1
Cold weather outfit + fur clothing +2
Improvised shelter +3
for these, I'd suggest just making each clothing item (cloak, boots, warm clothes, hat) give a +1, and make them stackable if possible, so you can combine them however you want. (similar to D.B. Winblood's "Frostbite" for NWN1)
page 9 of Frostburn: If your protection level equals or exceeds the coldness level, you're good and don't need to make a save.
One level less= partial protection.
Two (or more) less= unprotected.
Cold- unprotected PC needs Fort each hour (as you have it in EFE now)
Severe- unprotected PC needs Fort save every 10 min, partially protected every hour
Extreme- unprotected PC takes 1d6 cold (real) damage every 10 minutes (no save), plus Fort save or take subdual damage. Partially protected PC needs Fort save every hour.
Unearthly- unprotected: 1d6 cold and 1d4 subdual per minute (no save). partially protected: same damage only every 10 minutes. for complete protection you need protection 4 or higher. 2 or 3 is partial, 1 is unprotected.
If this doesn't make sense and you're still interested after reading all this gibberish, I could find another way of getting the information to you. Again, just suggestions, but I thought you might find this info interesting. :)
Thanks again for creating this. It really adds a lot to the immersion.
I updated the Environmental Fatigue Engine to version 2.2.2 by fixing the bugs stridev pointed out to me. Basically, in this version of the EnvFat, I updated the ResRefs of all the placeables that would logically provide relief from the heat or the cold. For example, a camp fire should provide relief from the cold. I don't know of any placeables that provide relief from the heat so, if anyone can find any, let me know and I'll add them.
HOWEVER, I went ahead and commented out the lines of code that check for the placeables that provide cold relief (like brazier or any of the camp fire placeables). The reason for this is because these placeables aren't necessarily lit. One can place a camp fire without a fire in it and that camp fire shouldn't provide cold relief. Ideally, I should be checking for any fire placed effects close by but I don't know how to reference and identify a placed effect or if it's even possible. Help on this would be nice too. As for now, the only thing that will provide cold or heat relief is a waypoint with the tag "ENFT_RELIEF_SPOT".
To allow the camp fire and other placeables to provide heat or cold relief again, simply open up either the enft_freeze_rlf or the enft_heat_rlf scripts, go to around line 35 of the code near a comment that says:
// List sources of proximity heat relief as shown in examples above.
and edit the code accordingly. Naturally, doing this will require basic scripting knowledge so it may be easier to simply use the ENFT_RELIEF_SPOT waypoint if you aren't comfortable scripting.
I also added the blueprint for ENFT_RELIEF_SPOT waypoint for easy retrieval and use. Just look for it under the waypoints to add your own heat or cold relief in an area.
Regarding those MIA resrefs, you are exactly right. Those are leftovers from NWN that I forgot about. And, yes, you can add your own resrefs for camp fire placeables and the like right after the last entry. Thanks for the catch. I'll update the erf file and post the new one with the appropriate resrefs.
As for your second question, you can set the time to whatever floating number you want. So, if you wanted the time to be 30 seconds, you'd do this:
I'm not seeing these resrefs on the nwn2 placeables.
are they leftover from nwn1?
can I change them to the nwn2 placeable resrefs and/or add more resrefs right under the last entry? (there are a lot of placeables now that could conceivably give relief, snowy versions as well) mainly I'm interested in adding the resref of a placeable campfire that the player can create with a custom "campfire kit".
also, in enft_cnsts, this part:
float freezeTime = HoursToSeconds(1); // One game hour
float heatTime = HoursToSeconds(1); // One game hour
I'd like to decrease the time (i.e. check more often) but I'm not sure how or if its even possible to go less than (1) here.
Right now, getting temporary relief from an item (without having it cast endure elements or the like on you) isn't supported. You could go into the script enft_freeze_rlf or enft_heat_rlf, search for the code that provides relief when endure elements is cast on you, and add to that code.
Adding a penalty for armor use or the amount of weight you're carrying could be added to but isn't currently implemented. However, what would the penalty be and how would a penalty from heavy armor be different from medium armor?
I probably won't be implementing penalties for wearing armor or having too much weight because the DMG doesn't say there is a penalty during these situations. I basically want to keep the code as simple as possible and stick to the DMG rules. In this way, these scripts are as efficient as possible and as useful as possible. You're welcome to add features but I don't want to add a plethora of features to the main version and create feature bloat.
The idea of drinking water for relief might be doable, though. I'd have to see how much demand there is for it.
Though, how would I create an item that can temporarily create relief for a player, i.e. A bottle of water. Also, would it be possible to incorporate a penalty for armour use? I.e. Light and No armour, no penalty. Heavy armour maximum penalty. Maybe also include the weight the PC is carrying. Could you incorporate this, and how would I?
The 3 equipable items that come with the Environmental Fatigue Engine right out of the box are:
1) Desert Cloak (Miscelaneous->Clothing->Cloaks)
2) Ice Cloak (Miscelaneous->Clothing->Cloaks)
3) Heavy Hide Clothing (Armor->Clothing)
And, of course, you can add your own as long as you add their ResRefs to the script enft_cnsts.
Wich are the "equipable items" to prevent the heat/cold damage? (btw nice idea, i will check it as soon as i can run nwn2 xD) _________________________
> Reinos de Vargold (Link)
(Módulo argentino de NwN2!)
Well, I hope your PW picks it up. And, if you do use it, be sure to vote here so people know how well (or poorly) these scripts worked for you. Also, should you guys need any help or have any questions, I do respond to comments here.
This actually makes desert areas a scary, challenging experience!
I'm Suggesting this for my PW's desert area (this'll make things SO much more challenging, as you'll be trying to fight both the enviroment, and Succubi at ONCE!) _________________________ __________________________________________________
Megadeth has a very intelligent way of talking about governments and religions: Either they bullshit you or try to kill you for not being one of them. I wholeheartedly agree.
(Note: Just because Mustaine is christian doesn't mean he believes EVERYTHING the bible tells him.)
__________________________________________________
Posted by jallaix at 2006-12-22 05:41:56 Voted 8.00 on 12/22/06
I tried and it worked pretty well.
I won't have to script my own system.
Thanks _________________________ Spellcasting Framework Wild/Dead Magic Zone (Spellcasting Framework add-on)
I hadn't changed the ERF file in the update I made on 11/15/06. The description of the file said the file was version 2.1.2 when in fact it was version 2.2 of the file. So, I corrected the description. The file is still the same file, however. So, you 51 people who downloaded the file prior to 11/15/06 don't have to worry about downloading it again if you want the latest version.
The changes I made to this script system to allow it to run on NWN2 were minimal. Basically, the name of constants for some spells changed so I had to alter my code accordingly. I also updated the 3 equipable items that you can use to protect yourself from the environment so that they will work fine in NWN2.
I must say, I am pleasantly surprised about how easily the transition from NWN to NWN2 was. Of course, this script system doesn't utilize many of the more esoteric aspects of NWN or NWN2.
You must be Logged In to post comments in this section.
10 - A Masterpiece, Genuinely Groundbreaking 9 - Outstanding, a Must Have 8 - Excellent, Recommended to Anyone 7 - Very Good, Deserves a Look 6 - Good, Qualified Recommendation 5 - Fair, Solid yet Unremarkable 4 - Some Merit, Requires Improvements 3 - Poor Execution, Potential Unrealized 2 - Very Little Appeal 1 - Not Recommended to Anyone