Offline Resting

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

Locked
User avatar
NickD
Beholder
Posts: 1969
Joined: Sat Jul 31, 2004 9:38 am
Location: Auckland, New Zealand

Offline Resting

Post by NickD »

I suspect there is a bug with offline resting. I was of the understanding that characters only restore as much as they would for each day over the time they are offline. It appears to me that as long as a character is offline for a single IG day, they are back at full strength when they log in.

If you point me at the the scripts in the sourceforge repository that handle this, I suspect I will be able to provide code to fix it.
Current PCs:
NWN1: Soppi Widenbottle, High Priestess of Yondalla.
NWN2: Gruuhilda, Tree Hugging Half-Orc
User avatar
Ithildur
Dungeon Master
Posts: 3548
Joined: Wed Oct 06, 2004 7:46 am
Location: Best pizza town in the universe
Contact:

Re: Offline Resting

Post by Ithildur »

A single RL day is nearly 9 days as far as the game engine is concerned with regards to the offline resting script, I'm pretty sure, under the current fast time compression ratio.
Formerly: Aglaril Shaelara, Faerun's unlikeliest Bladesinger
Current main: Ky - something

It’s not the critic who counts...The credit belongs to the man who actually is in the arena, who strives violently, who errs and comes up short again and again...who if he wins, knows the triumph of high achievement, but who if he fails, fails while daring greatly.-T. Roosevelt
User avatar
Keryn
Ogre
Posts: 678
Joined: Sat May 24, 2008 7:17 pm

Re: Offline Resting

Post by Keryn »

Its working as it should and how it was designed to be working.

An IG day is assumed to be enough for your PC to have rested during that IG day, thats why you get your PC rested when you log in. Also it is a way to favor casual gamers with few time to play.
<Kest> "what am i running away from? i dont know but it sounds big and large!!"
---
<@Veilan> I like sausage.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Re: Offline Resting

Post by AcadiusLost »

I have seen occasional reports of full-healing from serious HP loss after the equivalent of only a day or three of offline game-time; haven't experienced it myself, but my PC rarely logs out with more than a point or two of damage, so I wouldn't have noticed.

The code is handled by the ACR resting include:

http://alfa-bmf.svn.sourceforge.net/vie ... iew=markup

The functions to pick over would be _ProcessOffCameraRest() at 1139-1175, and _healFromRest() from 881-1010. My instinct would be that the "pre-resting" HP level isn't being initialized properly (due to PCs coming in fully healed before the ACR adjusts them back to their persistent HP levels). Thanks for having a look over it, if you don't spot anything obvious I'll set up a damage lever in my testmod and take a shot at working it out while I tinker with 1.23 stuff.
User avatar
NickD
Beholder
Posts: 1969
Joined: Sat Jul 31, 2004 9:38 am
Location: Auckland, New Zealand

Re: Offline Resting

Post by NickD »

I think I'd need a better understanding of how everything fits together (and the ability to run a module in debug mode with breakpoints would be nice... :? ). The code itself looks OK from a cursory look, so I'm going to need to delve a bit deeper.

My best guess at this point is that the ACR_RestOnClientEnter method is called some time during the On Client Enter Script. This, if the number of days offline is 1 or more, increases the character's HPs by their level and their abilities by 1 per offline day (up to their maximum values). It then saves the character.

I am also assuming that the On PC Loaded Script is called after the On Client Enter Script. And that ACR_PCOnPCLoaded is called some time during the On PC Loaded Script. This script gets the saved character and sets their status to how they were when they logged out.

However (if I'm right), if a character first logs in at full strength, ACR_RestOnClientEnter will added (level * offline days) HPs to their HPs (currently maximum) and trim it down to their maximum... i.e., do nothing. And then save that value, so ACR_PCOnPCLoaded will then pick up those maximum values and thus always restore HPs and ability scores to maximum if the character has been offline for 1 or more IG days.


Which is all pretty much the same as your guess.
Current PCs:
NWN1: Soppi Widenbottle, High Priestess of Yondalla.
NWN2: Gruuhilda, Tree Hugging Half-Orc
Locked