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 .