I don't know what I did wrong

Post » Mon Nov 19, 2012 11:05 pm

I Duplicated the WRCastleSecretDoor (an activator).
Renamed it and gave it a texture compatible with Breezehome. So far so good. In the preview pane it moves up and down like the origional. I placed it in my cell and linked it to a pullchain like in the tutorial.

Problem: In the game the pullchain moves as it should but the door just sits there. Where did I go wrong? Does it need a script?
User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Post » Mon Nov 19, 2012 8:05 pm

Yes, pullchains need scripts. It would probably look something like this.
event OnActivate(Objectreference akActivator)   GetLinkedRef().SetOpen()endEvent
User avatar
electro_fantics
 
Posts: 3448
Joined: Fri Mar 30, 2007 11:50 pm

Post » Mon Nov 19, 2012 3:47 pm

You shouldn't need a script if you just make the pullchain the activate parent of the door.
User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm

Post » Mon Nov 19, 2012 6:59 pm

Oh, thats true too I guess. I forgot doors automatically do that.
User avatar
Kat Stewart
 
Posts: 3355
Joined: Sun Feb 04, 2007 12:30 am

Post » Mon Nov 19, 2012 7:54 pm

Or
kREFR.SetOpen(kREFR.GetOpenState() > 2)
should toggle it just like activation.
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm

Post » Mon Nov 19, 2012 3:49 pm

Or
kREFR.SetOpen(kREFR.GetOpenState() > 2)
should toggle it just like activation.

Sorry to butt in gents, but I'm intrigued by this line of code...

In the ck wiki it says SetOpen(Bool abOpen = true). So it can only accept either true or false (1 or 0). But GetOpenState() returns 0-4 depending on what the doors doing. I'm presuming this is where the "> 2" comes in, but I've never seen this used before. Any chance of putting me out of my misery JustinOther?

- Hypno
User avatar
Yvonne
 
Posts: 3577
Joined: Sat Sep 23, 2006 3:05 am

Post » Mon Nov 19, 2012 8:33 pm

If kREFR.GetOpenState() > 2 is true then it places true in abOpen variable.

Basically (when greater than 2)
kREFR.GetOpenState() > 2 == True
so
abOpen == True
User avatar
saharen beauty
 
Posts: 3456
Joined: Wed Nov 22, 2006 12:54 am

Post » Mon Nov 19, 2012 3:00 pm

Makes perfect sense, thanks for explaining. If I was going to write that I would've gone the long way by using a few if's, I would never have thought it could be done in one line. Well as the saying goes, you learn something new every day :)

- Hypno
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Mon Nov 19, 2012 11:24 am

Part of my problem is my retextured WRcastlesecretdoor doesn't act like an activator which it is listed as but like a static like a wall. It can't be activated and if you move your mouse over it no name pops up. Could that be why it won't open? Could someone look at the WRsecretwall in the CK and see if there is something about it that needs changing in Nifskope so it can be activated.
User avatar
Brιonα Renae
 
Posts: 3430
Joined: Mon Oct 22, 2007 3:10 am

Post » Mon Nov 19, 2012 5:04 pm

It should work. Lets start over...

Double click on the pull chain, then in the linked reference tab, double click and add the door

Then add the following script to the pull chain in the scripts tab (I'm at work so no ck to check. I merged Il Ducey's and JustinOther's scripts in my head. Let me know if it does not compile):

Scriptname PullchainScript  extends ObjectReferenceObjectReference Property kREFR = GetLinkedRef() Event OnActivate(ObjectReference akActionRef)   kREFR.SetOpen(kREFR.GetOpenState() > 2)EndEvent

Then you should be good to go

I'm stuck here for the next 10 hours. If by then you are still having problems, I'll fire up the ck and test it with WRCastleSecretDoor when I get home

- Hypno
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm


Return to V - Skyrim