is it Possibleto use bed as door?

Post » Sun Jun 24, 2012 1:37 pm

Is it possible to use a bed as door/teleport to another world cell, if so how ?
User avatar
Ally Chimienti
 
Posts: 3409
Joined: Fri Jan 19, 2007 6:53 am

Post » Sun Jun 24, 2012 8:04 am

I haven't started to script in skyrim, but if the scripting system is anything like Oblivion's, then perhaps something like a OnActivate, and moveplayer will be the keywords, sorry I can't be more helpful
User avatar
Kelsey Anna Farley
 
Posts: 3433
Joined: Fri Jun 30, 2006 10:33 pm

Post » Sun Jun 24, 2012 9:33 am

Yes look at the OnActivate and Moveplayer scripts, easily doable.
User avatar
barbara belmonte
 
Posts: 3528
Joined: Fri Apr 06, 2007 6:12 pm

Post » Sun Jun 24, 2012 2:12 pm

You don't NEED to use scripting actually (well.. depending on exactly what that bed should be doing). Create a custom door baseObject, point the 'model' to whichever bed you want (which you'll have to extract from the BSA and place in your game folder... same path as where you found it). Then use it in-game just like a door - but you won't be able to use it as an actual bed. I use this technique to turn the statue of Ysgramor (several actually) into garden-gnome teleporters for my Player-home (Overlook Tower).

If you wanted the best of BOTH worlds... bed by night and door by... uh.. whenever: you could either have semi-elaborate scripting (which really isn't that hard if you have Papyrus experience), or have TWO of the same bed. One would be your custom door, and the other would be the real bed... but then you'd have to set up a quest or script to have one or the other enabled, depending on the correct timing.

An example of the latter would be to make a simple script and attach it to some random Ref in the room (or one/both of the beds). That script would only need an onCellAttach event; so when Player enters the area, whatever your conditions/checks would determine which 'bed' should actually be enabled (while the other disabled, of course). Either have one script on one ref which controls both, or one script on both beds' refs which only controls that bed.

In the former, you could either place similar scripting (with your conditions) in a quest fragment, dialog, scene, etc.
User avatar
Brιonα Renae
 
Posts: 3430
Joined: Mon Oct 22, 2007 3:10 am

Post » Sun Jun 24, 2012 8:16 am

if you make the bed a physical door it will say Open Skyrim or whatever cell it leads to, instead of Sleep Bed (which would be an immersion breaker depending on what you're trying to achieve)

for a more immersive effect, if your intent is to transport the player into a new area after they sleep in the bed (actual sleep with the selectable hours etc), try this:

place your actual door (the one that is connected to your custom world) somewhere either clipped into a wall or off in the void space. i suggest creating a brand new door object like slucky says above, but do not use any kind of fancy mesh, just use a plain Black Plane or xmarker (this door will never be seen by anyone)

connect this door to your world as usual and place the teleport markers where they need to be (the return marker would be placed near the bed furniture). finalize your navmeshes so the doors actually work.


attach this script to the bed reference (this will only work if the bed is the only one in the interior, otherwise any bed in the cell will teleport them)

ObjectReference Property DoorMarker  autoEvent OnCellAttach()	RegisterForSleep()EndEventEvent OnCellDetach()	UnregisterForSleep()EndEventEvent OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)   DoorRef.Activate(Game.GetPlayer()EndEvent


For a script that works on a specific bed ONLY

ObjectReference Property DoorRef  AutoEvent OnActivate(ObjectReference akActionRef)	if (akActionRef == Game.GetPlayer())	  DoorRef.Activate(akActionRef)	EndIfEndEvent


point your DoorRef property to your door object in the render window


you can also throw in a Utility.Wait(#.#) in there just before the DoorRef.Activate to delay the door being activated. replace the #.# with a float value (like 1.0 for 1 second)
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Sun Jun 24, 2012 4:32 am

Only caveat to the above is that followers will not be moved with the player when the door is activated via a script. I've not found a way around this yet.
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Sun Jun 24, 2012 4:09 am

they will come with you on a door activation as long as the door is valid (navmeshed and finalized). i can confirm it works because i use this extensively in my mod amethyst hollows
User avatar
Siidney
 
Posts: 3378
Joined: Fri Mar 23, 2007 11:54 pm

Post » Sun Jun 24, 2012 8:52 am

Hmm, I wonder if something changed in 1.6 then. I tested this extensively with 1.5 (from my various incarnations of my teleport mod) and found that a door that was activated via script from a trigger failed to move my followers with me, despite the navmesh being complete and finalized. I'm going to try this again with the current version of the Creation Kit/Skyrim and report back. Give me half an hour or so.
User avatar
Bee Baby
 
Posts: 3450
Joined: Sun Jun 18, 2006 4:47 am

Post » Sun Jun 24, 2012 4:44 am

it worked for me in 1.5 as well
User avatar
Justin
 
Posts: 3409
Joined: Sun Sep 23, 2007 12:32 am

Post » Sun Jun 24, 2012 6:16 pm

I haven't played with this yet, but I'm under the impression you can change what the Activate says via Location stuff. Personally, I change the 'name' in the baseObject to reflect instructions regarding my 'special' door/activator... but as stated, it still has the "Activate" thing above it (which for my purposes, is no big deal).

But as Amethyst said - that simple little onActivate should work... again - depending on specifically what it is you want to happen and how. I haven't messed with that 'remote door activation' yet... I'll be needing something like that in the future, so thanks!
User avatar
Adrian Morales
 
Posts: 3474
Joined: Fri Aug 10, 2007 3:19 am

Post » Sun Jun 24, 2012 4:49 am

I am currently trying to get - 1 or more hour of sleep = travel to cell

sort of like the assasin quest, except it works all the time
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Sun Jun 24, 2012 10:15 am

Definitely not working for me. I tried remote-activating both an auto-load door and a dwarven door via a script on a trigger box. The auto-load door doesn't bring followers through, the dwarven door did.. nothing.

If I use the doors directly (no script) everything works.

Sigh... maybe I'm doing something wrong, but it all seems pretty simple to me.
User avatar
Jessica Raven
 
Posts: 3409
Joined: Thu Dec 21, 2006 4:33 am

Post » Sun Jun 24, 2012 12:55 pm

holigan: If you know of something that already does what you want, why don't you hijack the code and modify it for repetition?

AzSteve: I've said that quite a bit about Papyrus since I've started learning it. In fact - I've been saying it a lot lately, but I think I finally figured out my problem (it, and most of them, are NOT simple... until the 'eureka' moment smacks me). It's getting a little late for me tonight, but maybe I'll look into this if I get some time tomorrow.
User avatar
Averielle Garcia
 
Posts: 3491
Joined: Fri Aug 24, 2007 3:41 pm

Post » Sun Jun 24, 2012 12:07 pm

are you sure you are using akTriggerRef as the Player to activate the doors and not any other reference?


Event OnTriggerEnter(ObjectReference akTriggerRef)

If (akTriggerRef == game.GetPlayer())
DoorRef.Activate(akTriggerRef)

EndIf

EndEvent

DoorRef is filled in the properties pointing to the door in question (just making sure)
User avatar
Sophie Morrell
 
Posts: 3364
Joined: Sat Aug 12, 2006 11:13 am

Post » Sun Jun 24, 2012 5:06 pm

Yes, I have the player check in my script.
User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am


Return to V - Skyrim