Need advice on "furniture.activate"

Post » Mon Nov 25, 2013 3:57 am

Hi all,

I've been trying to mimic NPCs sleep animation for the player on a custom bed - only to realize that all the root animations like "IdleBedEnterStart" or "IdleBedExitStart" are best left alone when dealing with the player, I got my character completely stuck every time.

In the end, I used to Laydown animation which is okay with PCs. All worked fine at the start, only to find out that after a while the "bed.activate" stops working, the PC does lie in bed but the sleep Interface no longer shows up. Regular activation of the bed still works in game, it's just my script that no longer activates it.

Here's the script I have attached to a trigger close to the bed:

Spoiler
[code]Event onActivate(ObjectReference TriggerRef)		If (TriggerRef == Game.GetPlayer())		Game.GetPlayer().SetAngle(0, 0, -180)		Game.GetPlayer().SetPosition(-33.5063, 402.6996, 34.1313)		Debug.sendAnimationEvent(Game.GetPlayer(), "IdleLayDownEnter")		Utility.Wait(3.0)		MyLinkedRef.Activate(Game.GetPlayer())		Utility.Wait(5.0)		Debub.sendAnimationEvent(Game.GetPlayer(), "IdleChairExitStart")	If (TriggerRef == !Game.GetPlayer())		Return ; do nothing	EndIfEndEvent[/Code]

?

The LinkedRef did not work, so I used my bed as ObjectReference instead with "bed.activate" instead of "myLinkedRef;Activate" just to try things out. It worked: the player would lay down in bed, sleep UI showed up, I could use the camera during the 5 seconds the player was still in LayDown anim, and after these 5" my character was playing the ChairExit idle which restored its full controls. (I was using a renamed Vanilla bed).

Then I tried to use the root anims again and completely messed up my PC's behavior. So I rewrote the above script, reloaded a clean save, but stil it had stopped working properly: the sleep UI stopped showing up and instead I was stuck with a top view of my PC lying in bed until the IdleChairExit kicked in. Like I said, normal activation of the bed instance still worked though. Uninstalling and reinstalling my mod in clean saves did not change a thing.

I know that bed and sleep anims are tricky - could someone help me figure out what I accidentally triggered there?

I've searched the forum but could not find anything that'd help me figure out what's wrong. I'd be very grateful for any tips or shared experience, many thanks in advance :smile:.

User avatar
Dragonz Dancer
 
Posts: 3441
Joined: Sat Jun 24, 2006 11:01 am

Post » Mon Nov 25, 2013 4:00 pm

I assume what your trying to do is enable you to watch the player sleep? There already are at least a couple of mods which do this, I think there is a bit of messing around to get it to work.

You might be able to get it to work by activating another standard bed (say in a holding cell) to bring up the sleep menu interface while running your animations targeted at your custom bed.

User avatar
Damian Parsons
 
Posts: 3375
Joined: Wed Nov 07, 2007 6:48 am


Return to V - Skyrim