Jump to content


Photo

Resting


  • Please log in to reply
8 replies to this topic

#1 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 25 May 2005 - 08:38 PM

Ok, this is getting really crazy.  I'm seeing all this code and it doesn't seem to do what it says.  I'm reading the comments, and I think I'm changing a setting, but then it doesn't do anything.

Were the rest restrictions taken out?  By default, RESTSYSTEM = 1, and RESTBREAK = 6, but in reality, you can rest as often as you want.  
How do I put the rest limits back in?  Thanks for any help,

Stuart Pierce

#2 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 30 May 2005 - 05:51 PM

Still working on this. It doesn't recognize cooked steak or cooked fish and being food, either. You can have both in your inventory, and it still says you can't rest on an empty stomach.
Has anyone put timed rest restrictions back in?

Stuart

#3 horred the plague

horred the plague

    Scourge of the Seven Seas

  • Modder
  • 1899 posts

Posted 30 May 2005 - 08:19 PM

Still working on this.  It doesn't recognize cooked steak or cooked fish and being food, either.  You can have both in your inventory, and it still says you can't rest on an empty stomach.
Has anyone put timed rest restrictions back in?

Stuart

View Post


I suspect this is databse related, as you expressed other problems with your database in another thread.

Try right-clicking on the food, and using its unique power. Having a bag of food isn't enough--you have to eat it too. ;) Same with your canteen--must drink to refresh yourself.

#4 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 30 May 2005 - 08:38 PM

Thanks for responding, but I'm not aware of any problems with my database, I just said that generating a character is very slow?

I have turned off the need for my characters to eat and drink every so often. I can use the food items and eat them, but there is no point with the hunger system turned off (HUNGERSYSTEM = 0).

I do have it where a piece of food is required in order to rest, but it will only use "food rations". Cooked steak and cooked fish are ignored and not recognized as food. I can have a dozen of each, but it will not let me rest unless there is a "food ration" in my inventory.

The main problem I have is I want to change the rest system so that I can only rest every 4 - 6 hours or so. I have LIMITEDRESTHEAL = 1, RESTSYSTEM = 1; and RESTBREAK = 6, yet I can rest anytime I want and get full HP back.

Does none of this work now? Thanks,

Stuart

Edited by stuartpierce, 30 May 2005 - 08:43 PM.


#5 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 30 May 2005 - 09:54 PM

No, I take that back, LIMITEDRESTHEAL is working.  It's just that I can rest over and over with no limits.
As for the food, it must be the difference between the tags, FoodRation and FOOD_NORM -- I just haven't quite parsed it out yet.

Stuart

Edited by stuartpierce, 30 May 2005 - 10:14 PM.


#6 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 30 May 2005 - 11:10 PM

Ok, it was easy to fix the HCR resting to accept the cooked steak and cooked fish.  I just changed line 86 of hc_on_play rest to check for both Food or FOOD.

        if((!FindSubString(GetTag(oEquip),"Food")) ||
          (!FindSubString(GetTag(oEquip),"FOOD")))

Stuart

#7 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 31 May 2005 - 12:55 AM

Ok, I see why resting isn't working.
In hc_on_play_rest, there is a function IsTooSoonToRest.
Around line 220 it says:

    if (iRESTSYSTEM && iLastRest && ((iLastRest + iMinRest) > nSSB))
        {
        AssignCommand(oPC, ClearAllActions());
        sRestedText += " Try again in ";
        sRestedText = sRestedText + GetSubString(FloatToString(((fMinRest+fLastRest) - fSSB) / fConv), 6,2)
        + " hours " + IntToString(iMin)+" minutes";
        FloatingTextStringOnCreature( sRestedText, oPC, TRUE);
        nNotOkToRest = 1;
        }

Well, iLastRest is 0 all the time, so this subroutine never gets to run, so nNotOkToRest = 1 never happens because of not waiting enough time.  

Stuart

#8 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 31 May 2005 - 12:59 PM

It looks like my iRestLast is getting set back to zero every time I rest.  Is this a database problem?  The information isn't getting stored correctly in the persistent database?  I think I see where it is supposed to update iRestLast.

if(!GetIsDM(oPC))
  SetPersistentInt(oMod,("LastRest" + GetName(oPC) + GetPCPlayerName(oPC)),nSSB);

but then next time the a rest happens and

int iLastRest = GetPersistentInt(oMOD,("LastRest" + GetName(oPC) + GetPCPlayerName(oPC)));

is executed, iLastRest is back to zero.

Stuart

#9 stuartpierce

stuartpierce
  • Member
  • 19 posts

Posted 31 May 2005 - 11:14 PM

I've got my NWN database setup, but it looks like the table pwdata has 0 data and has never been updated.   :(

Stuart