Anyone chance someone can fix this for me please.

Post » Sat Nov 17, 2012 7:45 am

Ok so I have a room just after you enter the dungeon you kill two "easy con" mobs, then you find a door with a lever. So you open the lever an nothing happens.... few seconds later the door opens. an your presented with a small hallway and in middle of the floor is a spotlight on a Diamond sitting on floor.

(Obviously you pick it up), an BAM!.... Door closes behind you.
Now here is the bit I am going crazy on. I want the door to lock after you pick up the diamond an "stay locked"....But for life of me I cant get it to do so. I have the other side of the door set to be "locked" when you find it an "req's a key" which is the lever sitting on the wall.....

This means you have a to find another way out of the room (yes there is one) an it's quite obvious, but the fact you can see the outline of the secret door doesn't really help you, because you have to "find" the trigger that opens it.

I have worked on this for 3 days an cant for life of me work it out. I have watched every vid, read every post I can find remotely related to it....

Can "anyone" help me out with it :)
User avatar
Ryan Lutz
 
Posts: 3465
Joined: Sun Sep 09, 2007 12:39 pm

Post » Sat Nov 17, 2012 2:21 pm

Attach a script to the diamond, an OnContainerChange event. Make the door a door property of the script. Then in the script use the lock door function. Have a search on the creation kit wiki for lock and unlock :)
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Sat Nov 17, 2012 12:18 pm

Cheers man, I will have to try to figure out how to do scripting i guess...

This is a quick 30 sec vid of the issue at hand, just went an made it after posting.
http://www.youtube.com/watch?v=iqThEujKwlo&feature=youtu.be
User avatar
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Sat Nov 17, 2012 12:04 pm

At work mate so can't check the video. But the script should definitely work. Search the creation kit wiki for OnContainerChange also so you can see the script. Basically looks like this
Event OnContainerChange
If container is the player
Door.lock
Endif
End event
User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Sat Nov 17, 2012 10:56 am

oh ok thanks mate, yer i am checking the wiki now, doesn't seem "too" difficult. But then I aint tried it yet heh...
User avatar
Matt Gammond
 
Posts: 3410
Joined: Mon Jul 02, 2007 2:38 pm

Post » Sat Nov 17, 2012 5:01 pm

Just remember to add a property to the script for the door. A Door property. Then in the script, call the door by the property name you gave it.

If it helps I don't know if you've watched miller boy's tutorials, but his quest items have OnContainerChange scripts attached to them, so maybe worth having a watch of them :)

Edit - Bear in mind he uses quest aliases, which you can also do. But atleast you'll see the script.
User avatar
Greg Swan
 
Posts: 3413
Joined: Tue Jun 05, 2007 12:49 am

Post » Sat Nov 17, 2012 8:17 am

oh magic, your a champion, I'll watch em now cos at moment I have a migraine trying to understand it lol
User avatar
Donald Richards
 
Posts: 3378
Joined: Sat Jun 30, 2007 3:59 am

Post » Sat Nov 17, 2012 10:26 am

Just remember to add a property to the script for the door. A Door property. Then in the script, call the door by the property name you gave it.

If it helps I don't know if you've watched miller boy's tutorials, but his quest items have OnContainerChange scripts attached to them, so maybe worth having a watch of them :smile:

Edit - Bear in mind he uses quest aliases, which you can also do. But atleast you'll see the script.

hmm went to watch this Miller guys tutorials on youtube an cant find anything.....
User avatar
Hot
 
Posts: 3433
Joined: Sat Dec 01, 2007 6:22 pm

Post » Sat Nov 17, 2012 2:55 am

Put a script on your diamond
Add a Property called myDoor to the script ... Make that property an ObjectReference ... Assign your actual door to that property (by adding/editting the value)
Add this code to that script

Scriptname ShutThatDoor extends ObjectReferenceEvent OnContainerChanged(ObjectReference NewContainer, ObjectReference OldContainer)if OldContainer == Game.GetPlayer();this means the player DROPPED the diamond;you may not want this bit ... so remove the line below (up to the Elseif) if you don't want it to open when droppedmyDoor.Lock(false)elseif NewContainer == Game.GetPlayer();this means the Player picked up the diamondmyDoor.Lock()else;NOTE:  I haven't included a solution for if an NPC picks up the diamond ... But it would go here if you need one ...endifEndEvent;game should add this last line automatically ...ObjectReference Property myDoor Auto

(at least I think that will work!)
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Sat Nov 17, 2012 5:13 pm



hmm went to watch this Miller guys tutorials on youtube an cant find anything.....

Here you go :) http://www.youtu.be/It5ZzjamtMk?hd=1

His videos are listed in the Video Tutorials topic stickied in this forum (post #1).
User avatar
Sxc-Mary
 
Posts: 3536
Joined: Wed Aug 23, 2006 12:53 pm

Post » Sat Nov 17, 2012 3:50 am

Here you go :smile: http://www.youtu.be/It5ZzjamtMk?hd=1

His videos are listed in the Video Tutorials topic stickied in this forum (post #1).

hehe ok now I feel stupid for not searching forum first.... sorry guys, an thanks. That script shows just how far from done I was....
Much appreciated for doing all the work for me. watching vids now :)
User avatar
Shannon Lockwood
 
Posts: 3373
Joined: Wed Aug 08, 2007 12:38 pm

Post » Sat Nov 17, 2012 8:09 am

I actually found a workaround last night while NavMeshing the first part of my Dungeon, I ended up putting in a portcullis, that starts closed, an when you open the initial door, it opens the inner door too. Which you wont notice in the darkness an it's hidden behind some furns. So when you pick up the diamond a simple script pops up an basically makes fun of you for being greedy. Then the door slams shut an you have no way to open it again from the inside.

Trying that script out now though, as it's alot cleaner than my way.
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am


Return to V - Skyrim