Adding spouse to new player home

Post » Tue Jun 19, 2012 1:25 pm

This has probably been asked before, but has anyone figured out how to add the necessary information to allow in game spouses to move to player built cells?

What little I have learned so far, I think.
Requires a special sandbox package and location (LCTN)
Is somehow tied into the RelationshipMarriageFIN quest and dialouge

Beyond that I am completely and utterly stumped.

Any assistance is appreciated. Thank you.
User avatar
Annick Charron
 
Posts: 3367
Joined: Fri Dec 29, 2006 3:03 pm

Post » Tue Jun 19, 2012 1:31 am

I hate bumping threads but this is a fairly valid question and since a large portion of mods are actually player homes, it's going to become a common question sooner or later.

Perhaps a developer could point me in the right direction? Even a hint would be great. Like, check this script, or add this line, or you're doing it wrong...anything?
User avatar
christelle047
 
Posts: 3407
Joined: Mon Apr 09, 2007 12:50 pm

Post » Tue Jun 19, 2012 12:23 pm

adding custom player homes for spouse access requires modifying the marriage quest as well as the house purchase quest which it is dependent on for the proper dialog branch to show up.

as soon as i get it working i will probably post a tutorial. from the initial look-through of what i have seen, it looks like it will involve a lot of copying/modifying scripts, properties, dialog trees, etc.

it's not as simple as changing your AI's package. if you want your house to function properly through the in-game dialog, it has to be recognizable in the quest data, and the house itself has to be set up correctly in order for a living ai to sandbox it.
User avatar
Micah Judaeah
 
Posts: 3443
Joined: Tue Oct 24, 2006 6:22 pm

Post » Tue Jun 19, 2012 8:29 am

after poking through all of the scripts and quest dialogues, it appears that the only way this can properly work is to override vanilla settings and scripts. which means, if you plan to publish your mod publicly, the person using it can only have access to one custom house for their spouse as per rule of one (in this case the script file being overwritten). and if they install another house mod with marriage compatibility, it breaks yours (as their script will overwrite yours), regardless of load order.

the way spouse house is recognized in the game is by declaring properties in the script. it needs to clear the alias of the existing spouse house so that it can relocate it to the new house. so in order for the game to recognize multiple houses, they all have to be declared in the same script, or else the spouse could potentially have multiple house locations it is supposed to be sandboxing in (causing problems).

Even if you create an entirely new quest that is independent of the vanilla script and existing quests/dialog, you still have to "clear" all existing houses in order for the spouse to move to a new one. if the spouse is living in someone else's house from a different mod, you won't be able to clear that alias through your script.

long story short, it is not possible to do this in a public mod without potentially breaking someone else's mod or vice versa, as far as i know.


i don't know if there is a way to have a script add code to an existing script without completely overwriting it (possibly through fragments? i don't exactly know how it works). if there is, then it can be done.
User avatar
Andrea P
 
Posts: 3400
Joined: Mon Feb 12, 2007 7:45 am

Post » Tue Jun 19, 2012 12:53 am

That svcks.

Well not for me personally as I don't use use spouses. The constant monotonous pvssyr was highly annoying, and since divorce was not an option, losing them in the woods to a troll duo became common practice. But quite a few people have asked for this on my player homes and I have no doubt on others.

Unfortunate, but at least now I have an answer. Thank you for the information.
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Tue Jun 19, 2012 11:55 am

don't give up just yet, i'm looking into the fragments feature, to see if it is possible to add a line of code into the existing marriage script without overwriting the file. if this is possible then multiple mods that use their own fragments will be able to write in the appropriate code for clearing aliases.

i generally svck at coding, so if there is anyone else out there that actually knows what they are doing, please chime in
User avatar
Maria Leon
 
Posts: 3413
Joined: Tue Aug 14, 2007 12:39 am

Post » Tue Jun 19, 2012 1:44 am

We can always hope. You have a much firmer grasp on this issue than I do. I'll keep an eye on this thread though. Much thanks for your response. If only we could get a developer to chime in...alas...lost in the morass of CK threads.
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Tue Jun 19, 2012 7:09 am

40 aspirins later...

it seems like Fragments are supposed to do what i think they are (write an additional code that extends the main quest script). the good thing with fragments is that you can create entirely new ones that dont affect vanilla ref id's. the problem it seems, is that when you compile these fragments it sends them to a main QF script that houses all of the fragments. this can be either good or bad.

if the QF is compiled at runtime, then all is gravy and the marriage quest can be modded without worry.

if the QF is compiled in the CK only, this is bad because it is back to square one with the last installed file overwriting all changes from previous files.



i will test this theory out by making 2 totally separate esp mods that access the same marriage script and only add fragments to see what happens.
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Tue Jun 19, 2012 10:26 am

i will test this theory out by making 2 totally separate esp mods that access the same marriage script and only add fragments to see what happens.

I have registered an account to be cheer you on. I've looked all over for anyone looking to get this working.
You're someone's hero today.
User avatar
Chrissie Pillinger
 
Posts: 3464
Joined: Fri Jun 16, 2006 3:26 am

Post » Tue Jun 19, 2012 2:53 am

Hey, I have never really messed with any modding (with or without creation kit,) but I figured a suggestion couldn't hurt.

Is it possible that the coding that requires a spouse to live in a home isn't entirely in the quest but rather it is in the house? i.e. a script or something along those lines? You could try comparing them.
Or even under player properties? For example, when you buy a house I'm sure a line is added into your character's properties that states that house is owned by you (I could be wrong, again unexperienced.)

Sorry for any misuse of terms or confusion. I'd just love to see this be implemented and to help you guys out in anyway possible. I just don't think that the marriage script is entirely in the correct direction, though again, what do i know:)

Good luck guys, I hope you can figure it out!
User avatar
Shannon Lockwood
 
Posts: 3373
Joined: Wed Aug 08, 2007 12:38 pm

Post » Tue Jun 19, 2012 5:52 am

Getting the vanilla spouses to move in was a lot easier than I expected. A couple of people have asked, so I thought I'd share what i did here. If you're new to script or dialogue editing, check the CK Wiki out, for a good introduction. I hope I've included enough detail for this mini-tutorial, but let me know if things don't work or if you have questions.

These steps will allow you to:

+ Get your spouse to move to your new house
+ Get your spouse's AI to do things around the new house
+ If your spouse has a trade, will let the find a job (I think - this is the part I didn't thoroughly test).

PART I: SET UP THE DIALOGUE

1) Find the Quest/Relationship quest "RelationshipMarriageFIN." Go to Dialogue Views: you need to adds dialogue nodes to RelationshipMarriageFINMovingView and RelationshipMarriagePostWeddingView. You'll be doing the same thing in both places, so just repeat the following for each of them:

2) Copy the topic node for one of the other houses and paste them in the same topic area, Be sure to copy all seven response-infos for the seven voice types. Then link them to the original node. You'll need to link each of the seven responses to the "I want to move" node to your new node (see wiki for how to do this).

3) In your new node, change the topic (which is the player's line) to refer to your custom house ("I want us to move to YourHouse"): You don't need a voice for that, so no need to record new voice files.

PART II: THE QUEST SCRIPTS

4) Still in the Quest Editor, go to Quest Aliases. You'll be setting up a new alias for your house. Copy and paste works just fine here, just change the name of the Alias to refer to your house.

5) Double click on your new Alias to set up some functions. In the Factions area, choose factions that begin with ServiceSpouse followed by the closest city and their profession. Since my house was outside Whiterun, I just copied the factions from Breezehome. What I *think* this does, though I haven't tested it for all spouses, is that if they have a trade, like smithing, they'll commute to the smithy in that town. So if you're in the middle of the country, you might not want any factions (or to define your own.)

6) More importantly, on the right bottom of the Alias window is an area for Alias Package Data, which defines what the spouse ai is allowed to do in the house. Double click that to open up a package page. I essentially used one of the existing packages as a template to allow all the basic activities, gave it a new name, and let the CK save it as a new Editor ID. It's important to give it a new name, because you WILL be changing one important thing, and you don't want to accidentally overwrite the ai for a vanilla house. In the first line, the package defines the cell where these things will be allowed to happen. Make sure to have your house's indoor cell selected. Hit OK to save the package, make sure the new package is what shows up on the alias page, and then hit OK on the Alias page to save it.

PART III: BACK TO THE DIALOGUE

7) Almost done! For each of the seven responses (and remember you need to do it for 2 dialogue views), you'll need to add a papyrus fragment. You can essentially begin with what you already copied. But what you will need to do it add a new property for the script fragment, so click on the Script name, then hit properties. You'll be adding a property called ReferenceAlias which you will then define as the alias you created in step 4 (example YourHouse). You can also name the property the same thing. Hit return to go back to the topic info window.

8) You will want to change the script fragment to be:
(GetOwningQuest() as RelationshipMarriageSpouseHouseScript).MoveSpouse(akspeaker, YourHouse)

9) Now, while you can copy and paste that fragment for all seven (14) of the responses, you will also need to manually set the ReferenceAlias property (step 7) manually for each them. A little tedious, but it doesn't take too long.

10) Remember to do this for both dialogue views. One is for immediately after the wedding, the other is for any time during your long, happy marriage. Make sure you've compiled all your scripts and that they don't have any errors. Hit OK on the Quest Editor.

That's it!

Now this will only work for vanilla spouses or custom spouses that use vanilla spouse voices. If you have a custom spouse with new voicing, you'd add an "info" response to the moving topic for both the post-wedding and moving views (which is how you'd get them to move to the vanilla houses, too).

Under Miscellaneous/Idle Markers, you'll find those neat little blue ai squares, that you can put all over your house (appropriate ones, please, unless you like your spouse grazing on the floor). Because of the navmesh bug, your spouse won't always go to them, but once Beth fixes that (I hope), your spouse's package will let them pick animations and activities to do. They'll also use activators like alchemy tables, etc. In my test, I had Argis the Bulwark sweeping the floors in full Ebony Mail. "Yes, dear."

By the way, I'm pretty sure this can work for multiple houses. The only thing I'm nervous about is that linking my new dialogue node to the "I want to move" topic, technically counted as a change to the "I want to move" topic itself. I'm hoping that you can add more than one link through an esp.
User avatar
Amy Smith
 
Posts: 3339
Joined: Mon Feb 05, 2007 10:04 pm

Post » Mon Jun 18, 2012 10:55 pm

I copied that from a post I made on Skyrim Real Estate. This is what I used for my house mod, but reading Amethyst's comments make me wonder about my house's compatibility, which is something I wanted to achieve.

So here's a question for Amethyst. I realize that the script fragments get bundled together into the overall quest script. Does this mean that there can't be multiple fragments added by multiple mods? I'm guessing, yes /sadpanda.

BUT: If this is the case, perhaps there's a way to make the Quest Alias for the house be generic enough that it could identify if the current cell you're in is a house. Then someone could make a generic spouse-move plug-in and instruct house builders who want to make their houses compatible with it put a certain flag in their house. Perhaps the Radiant system could be utilized for this.

However, I'm not sure how one would go about setting up the generic package folder for spouses that have jobs outside the home.
User avatar
Jason Rice
 
Posts: 3445
Joined: Thu Aug 16, 2007 3:42 pm

Post » Tue Jun 19, 2012 4:08 am

I copied that from a post I made on Skyrim Real Estate. This is what I used for my house mod, but reading Amethyst's comments make me wonder about my house's compatibility, which is something I wanted to achieve.

So here's a question for Amethyst. I realize that the script fragments get bundled together into the overall quest script. Does this mean that there can't be multiple fragments added by multiple mods? I'm guessing, yes /sadpanda.

BUT: If this is the case, perhaps there's a way to make the Quest Alias for the house be generic enough that it could identify if the current cell you're in is a house. Then someone could make a generic spouse-move plug-in and instruct house builders who want to make their houses compatible with it put a certain flag in their house. Perhaps the Radiant system could be utilized for this.

However, I'm not sure how one would go about setting up the generic package folder for spouses that have jobs outside the home.


that's what i'm trying to test (i havent had a chance to yet).

if i can successfully get 2 independent esps to concatenate fragments into the same QF script file without overwriting each other, then its all gravy.


there is also the issue of:

If SomeoneElsesCustomHouse  SomeoneElsesCustomHouse.Clear()EndIfNewHouse.ForceRefTo(Spouse)

It seems that the spouse stores some kind of variable which house location they are currently sandboxing. in the comments of the script it says to clear the current location before assigning the new one. I don't know how important this is but if it is, this could be problematic because every custom house has to register in the main script file with their house location's alias so that it can be properly cleared when selecting the dialogue option "i'd like us to move somewhere else".

since we can't edit the main script file, i'm wondering if it can be added in the QF file and if it will still work the same.
User avatar
Liii BLATES
 
Posts: 3423
Joined: Tue Aug 22, 2006 10:41 am

Post » Tue Jun 19, 2012 12:20 pm

if the QF is compiled in the CK only, this is bad because it is back to square one with the last installed file overwriting all changes from previous files.
It's compiled only in the CK, as one monolithic quest fragment script that collects the individual ones in the stage boxes.

So here's a question for Amethyst. I realize that the script fragments get bundled together into the overall quest script. Does this mean that there can't be multiple fragments added by multiple mods? I'm guessing, yes /sadpanda.
Yes. This is no different from Oblivion btw. Two mods can't alter different stages of the same quest, because the quest records are monoliths. The Papyrus fragments for each stage get collected into a single file, and thus two mods can't modify the same quest.

Rule of One invokes, last one loaded wins.
User avatar
kristy dunn
 
Posts: 3410
Joined: Thu Mar 01, 2007 2:08 am

Post » Tue Jun 19, 2012 4:59 am

well unfortunately, after some quick tests, it seems that the QF only compiles in the CK and not at runtime (at least as far as i know).

which means, if multiple mods all make new fragments, they each have to package their own version of the locally compiled QF file in their mods in order for it to work. skyrim does not seem to be able to generate a compiled QF file made of multiple fragments from other mods, on its own (outside of the CK). this goes back to square one, since every new mod will still overwrite the previous when they package the QF in their mod upload.


edit: beaten to the punch



i think you would have to create a new MarriageFIN quest with a separate form ID that only adds this dialog:

"let's move to my house in (somewhere)"

which would have to be in the same heirarchy as "i'd like us to move somewhere else"


so that in game both dialogs will be visible. extremely clumsy, yes, but i think it's the only way. and also you have no possible way to integrate your house into the "check if cleared" function of the vanilla script.

this means that when your spouse moves to your house he/she will be assigned whatever variable flags them as living in that location, and this will not be cleared when you move to a new house. your spouse will end up with multiple house locations (i think).
User avatar
alicia hillier
 
Posts: 3387
Joined: Tue Feb 06, 2007 2:57 am

Post » Tue Jun 19, 2012 4:31 am

Hmm, yes, I guess I should rebuild my moving quest, since I don't want to be the one messing up other people's house mods. At least it's not square one. I'll update my mini-tutorial once I've checked it out.

How important is clearing the old houses if you've assigned a new AI sandbox package that assigns activities in your new cell?
User avatar
Adam Baumgartner
 
Posts: 3344
Joined: Wed May 30, 2007 12:12 pm

Post » Tue Jun 19, 2012 9:35 am

If the internals of the dialogue system work anything like Oblivion, it ought to be possible for two mods to add topics to an existing vanilla dialogue and have both show up. I mean, we all regularly added things to the greetings and other branches without any issues then, but who knows now. Shouldn't be too hard to set up a quick test.
User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Tue Jun 19, 2012 3:24 am

If the internals of the dialogue system work anything like Oblivion, it ought to be possible for two mods to add topics to an existing vanilla dialogue and have both show up. I mean, we all regularly added things to the greetings and other branches without any issues then, but who knows now. Shouldn't be too hard to set up a quick test.

the adding dialog part is fine, i have additional dialog set up for merchants and hirelings without affecting any vanilla records.

i think what makes the marriage quest different is that the dialogs also have attached script fragments which get compiled into the main QF file. rule of one applies the the script file, not the dialog branches.
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Tue Jun 19, 2012 3:46 am

Hi,

Been looking into this myself, and apart from adding the .clear() method to the fragment script i.e. If myHouse { myHouse.clear() } endIf etc.. the script fragments can in theory build scripts, so why not just recreate the MarriageScript, and then in quest fragments when it generates the .pex file, you would have a complete script, as in add the dialogue and corresponding script run methods, but rather than just adding the fragment, create the whole script, except just involving your House. As long as the alias is defined under the script properties it should work.

Simply papyrus system is just a script builder taking aliases that are added and running a method defined ina vanilla script
User avatar
Isabel Ruiz
 
Posts: 3447
Joined: Sat Nov 04, 2006 4:39 am

Post » Tue Jun 19, 2012 3:07 am

Yes, my understanding is that all you have to do is divide the function into 2 scripts, the vanilla remains the same, and one for your house that is identical except that it includes an alias definition for your house. I'm not sure what the necessity for clear is. I didn't change RelationshipMarriageSpouseHouseScript at all for my house. I thought as long as you assign a new sandbox package, the ai behavior would be fine (it works fine for me in game). What are the consequences of not clearing the old house?

And now a question about dialogue. If keep the same topic ID for the "You want to move" node, but within a new dialogue view for my new house move quest, will it still link to the original conversation? Or does it create a duplicate?
User avatar
Charlotte Lloyd-Jones
 
Posts: 3345
Joined: Fri Jun 30, 2006 4:53 pm

Post » Tue Jun 19, 2012 11:08 am

@Qutayba7 Just adds it on top I would assume

Just tested my theory and it looks like it works:

I set up the aliases: one to the house with a custom sandbox package and faction package (these I know will just add into the existing list) then under each dialogue option I run the same fragment except replace "marriagerealationshipspouse..." with "houseScript"

houseScript contains an alias reference to the house alias created, and is basically a copy of the vanilla script it replaces, except it just focus' on adding a new IF for the "MoveSpouse" method. I made it so it extends "quests" aswell which is where the information gets it from.

I have tested and it works, but this script workaround might sort it, I would like someone to confirm this for me please.

The idea is based upon my experience as a c++/java programmer and how you can add "extras" to scripts and redefine methods. The same idea should work for this and it did for me, however a second opinion would be great.

theconqueror
User avatar
aisha jamil
 
Posts: 3436
Joined: Sun Jul 02, 2006 11:54 am

Post » Tue Jun 19, 2012 7:50 am

that sounds great.

the only question remaining in this scooby doo mystery is what about the clear function? is it even necessary?
User avatar
Holli Dillon
 
Posts: 3397
Joined: Wed Jun 21, 2006 4:54 am

Post » Tue Jun 19, 2012 11:14 am

the clear function, is an extenstion of the quest script which just empties the quest data i.e. moved into house, all you ahev to do is in the custom script as it in the
Scriptname myScript extends RelationshipMarriageSpouseHouseScriptReferenceAlias Property SanctuaryHouse AutoFunction MoveSpouse (Actor Spouse, ReferenceAlias NewHouse);Function puts the player spouse in the correct alias to sandbox in the appropriate house;Clear all the other house aliases before setting the new oneIf SanctuaryHouseSanctuaryHouse.Clear()EndIfEndFunction

Thtas is my own custom script which is ran instead of the standard marriage one as it just adds to the existing script,
User avatar
Bad News Rogers
 
Posts: 3356
Joined: Fri Sep 08, 2006 8:37 am

Post » Tue Jun 19, 2012 3:10 am

but that only clears your own.

how can your script clear the alias of another mod's house without all of the aliases in one script? that was the whole thing i was going on about in the posts above.

while this would all work for only one active house mod, the real question is how to get multiple houses to recognize one another when all the houses are in separate esp/esm files




edit: i'm so dumb. i didn't realize thats how the function works. LOL

i thought it had to run through every house and clear them before adding spouse to your house.


but it's actually just clearing your current spouse house, and then reassigning her to whatever NewHouse you picked in the dialog option? slaps self in forehead
User avatar
Claire
 
Posts: 3329
Joined: Tue Oct 24, 2006 4:01 pm

Post » Tue Jun 19, 2012 11:13 am

OK, just so I understand, the Clear function clears all the other houses except yours (as opposed to clearing your house in preparation for moving to another)?
User avatar
Johanna Van Drunick
 
Posts: 3437
Joined: Tue Jun 20, 2006 11:40 am

Next

Return to V - Skyrim