Author Topic: Resting  (Read 345 times)

Legacy_JerrodAmolyan

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Resting
« on: August 15, 2013, 09:34:27 pm »


               Clicking the "No rest" box, then is there a way to use a script to have a "safe" rest spot to rest in the wilds... making portable bedroll placeables for example, that would force you to rest ignoring the no rest box ? 
               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Resting
« Reply #1 on: August 15, 2013, 10:22:36 pm »


               You could make a trigger that adds a variable to the PC on entering, then removes it on exiting.  The bedroll's script could check for that variable, and if it's there, do a ForceRest() on the PC.  That function works just like the regular resting, but is instant (no animations, no waiting for the progress bar).
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Resting
« Reply #2 on: August 15, 2013, 10:24:13 pm »


               Never tried it when the No Rest flag is on, but try ForceRest().

For an alternate tack, try henesua's Magus Rest System.

EDIT: ninja'd! ':ph34r:'
               
               

               


                     Modifié par Squatting Monk, 15 août 2013 - 09:24 .
                     
                  


            

Legacy_JerrodAmolyan

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Resting
« Reply #3 on: August 19, 2013, 08:59:18 am »


               Hmmmmm. I really want it to have a timer and an animation, maybe something similar to Ravenloft's sleeping animation. It's possible to make this system do something like:

If you click on the option on bedroll conversation "rest" it FIRST does the animation ON the bedroll (can't be interrupted, I don't want exploiters.) and after that, it has something like DelayCommand(10.0, ForceRest(oPC)); ? Or well, whatever the correct form would be. '<img'> and after that it'd do something like ClearAllActions or something that Stops the animation / makes it do a wake up one?
               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Resting
« Reply #4 on: August 19, 2013, 09:13:50 am »


               I do something like this in my PW...the PCs "sleep" instead of "rest".

PC uses bedroll item
> tag based script checks if proper time has passed (0 hours for level 0-3, 4 hours for levels 4-8, 8 game hours after that)
> > script checks if PC has "sustenance" (food in inventory, ring of sustenance, etc.)
> > > script checks for nearby enemies
> > > > if all checks pass:
> > > > > set cutscene mode TRUE for PC
> > > > > create bedroll placeable
> > > > > delay: make PC play sleeping animation for set duration (one of Vaei's custom ones)
> > > > > delay: apply sleep VFX to PC ("ZZZZZZZs" and snoring). '<img'>
> > > > > delay: FadeToBlack()
> > > > > delay: "do various and sundry sleep stuff"
> > > > > delay: FadeFromBlack()
> > > > > delay: set cutscene mode FALSE for PC
               
               

               


                     Modifié par The Amethyst Dragon, 19 août 2013 - 08:18 .
                     
                  


            

Legacy_JerrodAmolyan

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Resting
« Reply #5 on: August 19, 2013, 09:32:04 am »


               Yeah, that sounds like something I could use. Hm. Or well, something similar.I'd probably make it possible to sleep without food, but it'd apply penalties until you eat.
               
               

               
            

Legacy_bdtgazo

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Resting
« Reply #6 on: August 20, 2013, 11:34:31 pm »


               I haven't put the option in my mod yet, but given it some thought, and its very doable. Here's how I would go about it - but I wouldn't use the norest box.

1) I have a rest spawn script in place. I use waypoints for my restspawns, but you don't need to know that. Just know that when the PC rests, the onrest script includes a % chance for rest spawns.

2) Lets say you want to use a bedroll. All you need to do is use an onactivate script to control whatever you want the bedroll to do, i.e, spawn a tent and campfire or some such near the PC. If it were me, I would put charges on the bedroll so the PCs have something to spend gold on.

3) Include in the onactivate script a set variable function. This can be as complex as you want.

4) Make sure the onrest scripts checks for the variables. Be sure to add to the onrest script that the variable is reset when the rest is over, and the items placed from the onactivate are removed.
- I would add the remove placeable routine after a variable check function, so its not always run on every rest, just when the bedroll has been used.

5) If you don't want the players to be able to rest AT ALL, unless they have the bedroll, you just call for the onrest script to interrupt the rest if the variable has not been changed from the onactivate script, using an area check function (so you can control which areas cannot be rested in)... or set the rest spawn rate to 100% with an area check function.

6) To pretty it up, you can send some fancy messages to the PC, something ominous, maybe toss in some wolf howls or lightning or something. Whatever.

How many areas do want this to occur in?  If its many, may want to create a special area transition script to set a variable on the PCs, so the onrest script doesn't have to do an area checks, just a single variable check, and all of the areas would be ID'd by the one variable.
               
               

               


                     Modifié par bdtgazo, 20 août 2013 - 10:38 .