Author Topic: Help with campfire proximity and climate damage  (Read 402 times)

Legacy_GIANTSWORD

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Help with campfire proximity and climate damage
« on: September 05, 2014, 08:34:56 pm »


               

Hey guys I'm in some serious need of assistance.


 


I am using VG's base mod which has been great so far but I've run into an issue I can't seem to solve because of limited scripting knowledge.  I've contacted VG and have gotten a few replies but no fix and I haven't heard back.  I'm sure he's just busy and moved on.


 


That said, my issue is with the cold weather system, campfires and gear providing protection from the elements.  


 


I would love it if I could skype someone and just explain everything with sharescreen and we can just pastebin back and forth with the scripts.


 


I've got a really great module going and if I can get this system working right it's going to be amazing.  Just need to get over a small bump in the road.  


 


 


Skype info: Valbjorn3  


 


add me or send me a message if you're willing to help out.  much appreciated!!!



               
               

               
            

Legacy_GIANTSWORD

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Help with campfire proximity and climate damage
« Reply #1 on: September 05, 2014, 10:55:03 pm »


               

Here is the include script that deals with cold intensity


 


http://pastebin.com/b9TZBZpV


 


ideally I would have it so when in close proximity to a fire you would always bypass the cold check and be safe from cold damage.


 


The way it is now you will always take 1 cold damage even if you can get the intensity below 0.


 


Hope this helps



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Help with campfire proximity and climate damage
« Reply #2 on: September 05, 2014, 11:36:27 pm »


               

Try this ... down near the bottom of your file you'll see "void main" followed by some -if- statements for cases skipping the damage. Add the following to the top of those exceptions.



object oWarmth = GetNearestObjectByTag("vg_questfire", oPC);
if(GetIsObjectValid( oWarmth)||(GetDistanceBetween( oWarmth, oPC) < 4.0)) return;

Should work, but untested.


 


PS ... I set the distance at 4.0 or 4 meters. Change the distance to whatever you desire if its too much.



               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Help with campfire proximity and climate damage
« Reply #3 on: September 06, 2014, 01:48:56 am »


               

I used his system as a base.  There's a pretty nasty memory leak in the weather system that would crash my server every 6-7 hours.  It has to do with once inclement weather, like a lightning storm or windstorm or something like that, is triggered.  It never shuts off and continues to run even when PCs leave the area and eventually consumes all the available system ram.  So, as more areas get inclement weather, more resources are consumed and the faster the crash.


 


As I recall, my fix was to hook the system into a variable that was already being set on the area that kept a count of the number of players in the area.  If that number went to 0, don't run that storm any more.  If the variable was above 0, keep the inclement weather running.


 


Not necessarily related to the campfire proximity, I know, but relevant to the system.


 


As to the proximity, you might consider expanding the affected PC to be a loop to include other nearby PCs as well.  The way it is written now, only the PC who started the fire gets the warmth benefit, but any and all close PCs should be able to warm themselves to any fire.


 


I'm happy to help provide my code if you want.  Send me a PM if interested.  



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Help with campfire proximity and climate damage
« Reply #4 on: September 06, 2014, 02:02:22 am »


               


As to the proximity, you might consider expanding the affected PC to be a loop to include other nearby PCs as well.  The way it is written now, only the PC who started the fire gets the warmth benefit, but any and all close PCs should be able to warm themselves to any fire.


 


If that was the case, only a single PC would benefit from cold weather gear as well. -GIANTSWORD- merely posted the include for the main script which holds the functions used in the main script.



               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Help with campfire proximity and climate damage
« Reply #5 on: September 10, 2014, 04:42:12 am »


               

It's been years since I rewrote it (so it's possible I'm misremembering), but as I recall, we hadn't had any issues with the cloaks/gear not improving the warmth/intensity.  However, fires never warmed any PC other than the PC who started it.  Players each had to carry their own campfire kits and start their own fires, which was quite sub-optimal.  I believe I changed it so that the fire looks for nearby PCs, rather than relying on the cold check looking for a fire.


 


In any event, both the gear and the fire seem to work as intended now.