Spawning A Door

Post » Fri May 27, 2011 12:38 am

I'm wondering how to show a change in ownership (for a building).
It isn't possible to spawn a door that retains extra data, is it?
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Post » Fri May 27, 2011 1:10 pm

you mean like changing it from "Bob's house" to "Fred's house"? Couldn't you just disable one and enable another?
User avatar
dav
 
Posts: 3338
Joined: Mon Jul 30, 2007 3:46 pm

Post » Fri May 27, 2011 12:36 am

you mean like changing it from "Bob's house" to "Fred's house"? Couldn't you just disable one and enable another?

What now?
User avatar
electro_fantics
 
Posts: 3448
Joined: Fri Mar 30, 2007 11:50 pm

Post » Fri May 27, 2011 9:51 am

Make two doors. And also make two cells. That's the only way to change the name of a cell, by making an identical one with a different name. Take the original cell, select everything and copy it, and paste it into a new cell. Then, you have to make a second door, and stick it right on top of the first one, one door pointing to one cell, and the other pointing to the identical cell with the different name. You need to put a script on both doors, so that when one is active, the other is disabled. Then, when you want to "change ownership" of the house, trigger the other door to enable, and the first one to disable.

It's most reliable to trigger the change with a Journal entry. The scripting is simple.

This is for the first door you find in the game, before you change the name of the place:
Begin YourFirstDoorScriptIf ( GetJournalIndex "YourJournalEntryName" >= ## ) ;number of the journal entry that says you've changed ownership of the place or whatever.	If ( GetDisabled == 0 ) ;makes sure it only does it once		Disable	EndifEndifEnd


This makes sure the other door disappears, and replaces the first one after you change the name of the place:
Begin YourSecondDoorScriptIf ( GetJournalIndex "YourJournalEntryName < ## ) ;same numbered entry as the first door	If ( GetDiabled == 0 )		Disable	EndifElse ;the journal entry is that number or higher so the place has changed	If ( GetDisabled == 1 )		Enable	EndifEndifEnd

User avatar
Leah
 
Posts: 3358
Joined: Wed Nov 01, 2006 3:11 pm

Post » Fri May 27, 2011 3:26 pm

The trouble with that is if you take an item from one, it will still be there in the other. And if you place an item in one, it won't be there in the other.
User avatar
flora
 
Posts: 3479
Joined: Fri Jun 23, 2006 1:48 am

Post » Fri May 27, 2011 6:00 am

That is true. I believe Beth solved that problem with the player house in Megaton by permanently locking the door until it was given to the player. The original cell it was pointing to may not even have had anything in it for that matter.

You could, of course, remove the stuff from the first cell, making it look like the former owner took everything not nailed down that belonged to him or her. If you're moving the player into the home, you could leave the cupboards barren and the tables clean for you to move all your stuff in. If you're changing npc ownership, you'll want to add new stuff which that npc owns instead.

Of course, now knowing just how much work it is to do, you have to decide if it's really worth it just to change the name of the place.
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm


Return to III - Morrowind