Random Event When Sleeping in Special Location

Post » Wed Jun 04, 2014 10:31 pm

Is it possible to, whenever the player sleeps in ANY bed when currently in a specified Location, cause a few random events?

Let's say I have three different events and every time the script runs it calls on a Random Number generator and depending on which number the Int gets, a different function (which contains the event) is run.

I also want to make sure the player actually gets his/her sleep as well.

Is this possible? Any tips and hits for me to consider when doing this?

EDIT: what should a quest (I guess?) script like this Extend?

User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Wed Jun 04, 2014 9:51 pm

Look at the script for the DB quest line kick off http://www.uesp.net/wiki/Skyrim:With_Friends_Like_These... See how that script handles things and you could model what you want from that. It gives a full nights rest to the PC, but it triggers the next stage of the quest. If you want to limit this to certain beds in a certain area, then just give those beds a different formid than the rest of the beds in the game, and apply the script to that activator.

User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Thu Jun 05, 2014 2:21 am

Thanks!

I was thinking I could include an if-block that checks if the player IsInLocation(myLocation)==true and then run whatever I want. Since it should apply for a whole worldspace.

User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm


Return to V - Skyrim