Jump to content

Spouse Scripting Question


Allannaa

Recommended Posts

Posted

First of all, this may be a goofy question, and second, I may not ask it right, but here goes.

 

 

Is it possible to write a very short script -- very few functions or events or whatever -- that would:

 

Check to see if the player is married, and if so, "add" the spouse to a formlist or as an alias, regardless of whether it's a vanilla spouse or a mod-added spouse.....

 

Check to see if the player has a house, and if so, "add" it and its "front door" or whatever it is Skyrim uses to mark houses as suitable, as above, regardless of whether it's vanilla, HF, DB, or mod-added.....

 

Add "spouse bed" to any non-Child bed in the above house.....

 

Make the "spouse" now regard that house/bed as home.....

 

Add a sandbox (For instance AllaSpouseSandbox with an X marker placed in the middle of the floor or somewhere logical, and the "near reference" condition) for the spouse to "do stuff" instead of stand there like a rock) to the now "recognized" spouse from Step One up there

 

And possibly, though not really important, allow that "add the bed and make this house home" to be re-applied if the player adds a new house or finishes a BYOH or saves the dark elves (whatever it is that gets you the Solstheim house in the dunmer town)

 

 

I'm aware there are "followers or kids or spouses or pet skeevers can live here or there" mods, but I want to make my own so I can learn to do stuff like this.

 

I know that some of those mods use a "spell" that the player cast on the door or on the bed or both, but is there a way to just have the game do that and not have to cast a spell or something?

 

Thanks!

Posted

I'm not a script expert or even close, but here are my thoughts. Hope some of this is useful, and I hope none of it is too far wrong. ;)

 

Quote

Check to see if the player is married, and if so, "add" the spouse to a formlist or as an alias, regardless of whether it's a vanilla spouse or a mod-added spouse.....

Sure! IIRC it's done by adding the actor to a faction, so all you need to do is check if the actor is in that faction before adding it to your formlist/alias.

 

Quote

Check to see if the player has a house, and if so, "add" it and its "front door" or whatever it is Skyrim uses to mark houses as suitable, as above, regardless of whether it's vanilla, HF, DB, or mod-added.....

Maybe? That is to say, I'm not sure how easy it would be to detect mod-added houses.

I'm also not sure how you'd even detect vanilla houses. I know that there's a way you can detect a cell's current owner, and if that owner is the player you can reasonably assume it's the player's house, right? The thing is, I don't know if that's actually ever used on vanilla houses. For all I know, houses like Hearthfire houses or Breezehome or whatever might be considered "public" areas - I haven't ever looked into it.

 

Quote

Add "spouse bed" to any non-Child bed in the above house.....

I don't think that's possible via script, because Skyrim doesn't allow you to add keywords via script. You'd have to edit the bed directly, so it would only work if you either:

a) used getformfromfile, detected position and rotation of the bed, disabled it, and replaced it with your own spouse-enabled bed at the same position and rotation, which sounds like a hell of a pain in the ass.

b) made a patch for every house mod in existence, which also sounds like a hell of a pain in the ass.

c) ignore mod-added houses, and edit the beds directly, which sounds like the best plan to me. :)

 

Quote

Make the "spouse" now regard that house/bed as home.....

I think that happens automatically, doesn't it? Just with the vanilla marriage system, if I'm not mistaken.

If not, you might look into other mods that are spouse-enabled and/or hearthfire-enabled, so you can figure out how they do it.

 

Quote

Add a sandbox (For instance AllaSpouseSandbox with an X marker placed in the middle of the floor or somewhere logical, and the "near reference" condition) for the spouse to "do stuff" instead of stand there like a rock) to the now "recognized" spouse from Step One up there

I'm not an expert, but I believe you can do this with vanilla AI packages. Look at Serana from Dawnguard, her AI packages have her hopping about to every piece of furniture in the immediate area.

There's also a mod on Nexus called something like "Multiple-floor sandbox" or "Sandboxing to other floors" or something like that, which might help.

 

Quote

And possibly, though not really important, allow that "add the bed and make this house home" to be re-applied if the player adds a new house or finishes a BYOH or saves the dark elves (whatever it is that gets you the Solstheim house in the dunmer town)

Pretty sure that if everything else falls into place, this one will just happen by default.

 

Quote

I'm aware there are "followers or kids or spouses or pet skeevers can live here or there" mods, but I want to make my own so I can learn to do stuff like this.

Ah, I guess I should read the whole thing before I start replying...

 

Quote

I know that some of those mods use a "spell" that the player cast on the door or on the bed or both, but is there a way to just have the game do that and not have to cast a spell or something?

If you can detect the door/house/bed/whatever without having to target it directly with an alias or script reference, then absolutely. For example, if you want to detect if the player has just added a new mod halfway through their game, use onplayerloadgame() and put your detection script in there.

Of course, this hinges on being able to detect a player's house.

Posted

Wow, thanks, CC!  Those are great points and I think they've given me a good way to start trying to do this.

 

The cell owner thing.... I wonder if something similar could be done with the bed.... hmmm!

Posted

Everything seems to be going well with Kedris, but I have one small, really weird, problem.

 

He has the MaleKhajiit voice type, and it works great, up to a point.  He says all kinds of idle chatter, he "sniffs", and he says the idle chatter I gave him to say, and he comments on caves, Nordic ruins, and Dwarven cities (Hireling Commentary lines, that is.)

 

Buuuut, one of his "Goodbyes" (when you Escape out of dialogue instead of choosing an option) is "I hope that you will come to do business with us again"

 

Obviously, that's among the Caravan lines (the others of which are fine, I like him saying them.)  That one, though, makes no sense.

 

So I opened Character > Quest > Caravans (where the UNwanted chatter line is)

I double-clicked the line to bring up the TopicInfo window

I added a condition -- GetIsID Actor: AllaKedrisFollower !=

 

I thought that would fix it, and let him say any caravan line EXCEPT that one, but it didn't help.  He still says it.

 

Should I have ticked the OR box in the the ConditionItem window?  Should I have changed the Run On line to something other than Subject?  Should I have done something else entirely?

 

I'm about as confused as a drunk skooma addict at this point.  Kedris does and says everything else I want, as far as I can tell (I haven't, for instance, bought a second house yet so I don't actually know if he'll move, but that's Marriage stuff and I'm not fine-tuning that yet.)

 

I just can't get him to stop saying that danged "I hope you will come to do business" line, and it's making me crazy.

 

Thanks!

 

Oh!  Edit -- I did generate a SEQ file, I did start with an absolutely new game, I did save & exit before going anywhere near the outdoor cell he lives in.  If that matters.

Posted

No, AND is correct in the condition window. "AllaKedrisFollower != 1 AND"

And subject is right too.

 

Is the topic <<shared>>? If so it might be being used by some other topics somewhere and he's inheriting the lines from those.

 

You're not testing marriage stuff, but you should know that Khajiit don't have any married voice files. Argonian, Breton, Dark Elf, Imperial, and Nord are the only male married voice files. Marrying a Khajiit (like, through console commands or a mod or whatever) can cause problems because of that.

 

But otherwise I'm not sure. Maybe take a look at Kharjo or J'zargo, they might have some difference.

 

Posted
27 minutes ago, Content Consumer said:

No, AND is correct in the condition window. "AllaKedrisFollower != 1 AND"

And subject is right too.

 

Is the topic <>? If so it might be being used by some other topics somewhere and he's inheriting the lines from those.

 

You're not testing marriage stuff, but you should know that Khajiit don't have any married voice files. Argonian, Breton, Dark Elf, Imperial, and Nord are the only male married voice files. Marrying a Khajiit (like, through console commands or a mod or whatever) can cause problems because of that. 

 

But otherwise I'm not sure. Maybe take a look at Kharjo or J'zargo, they might have some difference.

 

Oh, I'm well aware of all that, so I made him marryable, which involved a lot of WAV file listening to get appropriate responses.  As it turns out, if you have all day inside because of pouring rain, so you can listen to Every. Single. MaleKhajiit. Line, you *can* make any male Khajiit marryable.  (Though I personally wouldn't try it with existing Khajiit, for fear of really blowing up Skyrim, hence, in part, Kedris.)

 

Provided of course you add this here and that there, etc.  He's been marryable for ages, since I first made him in 2015.

 

I'm starting to wonder now if he *always* said that stupid Business line, but I never noticed before, because I never Escaped Out of dialogue before I made him my follower.

 

See, that's the weird thing.  After I "Follow me, I need your help" at him, he says only my goodbyes (Warm sands..., Wind is bitter cold..., and Khajiit walks...)

 

It's only *before* I make him my follower that he says the Business thing.

 

I opened the Caravans window again, just to be sure, and no, the topic isn't in <> (like a Shared, do you mean?)

 

It does have conditions -- KhajiitCaravanFaction, VoiceType MaleKhajiit, FemaleKhajiit, and my added condtion of GetIsID Actor: AllaKedrisFollower != with OR unchecked so that it remains an "and" condition.

 

Now, the other thing I see, Kedris *is* in Caravan Faction.

 

So I see two sort of options

-- Remove him from Caravan Faction, and risk having no idle chatter other than what I write (and copy voice files) for him.....

-- OR, do something like New VoiceType, AllaKedrisFollower.... re-do every line he already has (including his marriage stuff), add the "sniffing" and the other desired lines such as Good to see you, Creatures of the desert, Ready for any troublemakers, Skyrim once had lots of butterflies, etc etc (he has something like 300 different things he can say, all in all, thanks in part to Jzargo and Maiq)

 

I do still want to figure out how to add player and mod houses to a formlist, and I'm going to do it the way you suggested, but honestly, I tabled that when Kedris started talking about business.  I mean good grief, he's not my little man-courtesan (just my slightly submissive husband to be) and even if he was, *I'm* not one of his customers!  He's GOT to stop saying this.  I just can't figure out how to make him stop!

 

 

 

Posted

Depending on how important it is to you to keep that line for the caravans, you could just delete it entirely. That would still leave the other end responses intact for the caravans, and eliminate the "business" line for everyone.

Posted
12 minutes ago, Content Consumer said:

Depending on how important it is to you to keep that line for the caravans, you could just delete it entirely. That would still leave the other end responses intact for the caravans, and eliminate the "business" line for everyone.

Wouldn't that goof up the caravan merchants, though?  And make other people frown, if I ever happened to upload Kedris as a mod?

 

Posted
Just now, Allannaa said:

Wouldn't that goof up the caravan merchants, though?  And make other people frown, if I ever happened to upload Kedris as a mod?

 

It shouldn't harm the caravan merchants much, I don't think - I think they've got like four or five different lines they can say on goodbye. Warm sands, may the sun shine, home you're treated better than us, the roads of skyrim are treacherous, etc.

But it might cause issues with anyone who uses that line in their own mods, sure enough.

I'm a bit surprised the condition doesn't work to stop it, actually. Maybe it has something to do with the fact that it's a "goodbye" dialogue, like maybe goodbyes use slightly different rules? I can't imagine why Bethesda would do that, but frankly I can't imagine why Bethesda would do a lot of strange things. ;)

You could try to double-down on it, maybe add him to a custom faction and exclude that faction, or put a custom keyword on him and exclude that keyword, just to make sure.

Posted
15 minutes ago, Content Consumer said:

It shouldn't harm the caravan merchants much, I don't think - I think they've got like four or five different lines they can say on goodbye. Warm sands, may the sun shine, home you're treated better than us, the roads of skyrim are treacherous, etc.

But it might cause issues with anyone who uses that line in their own mods, sure enough.

I'm a bit surprised the condition doesn't work to stop it, actually. Maybe it has something to do with the fact that it's a "goodbye" dialogue, like maybe goodbyes use slightly different rules? I can't imagine why Bethesda would do that, but frankly I can't imagine why Bethesda would do a lot of strange things. ;)

You could try to double-down on it, maybe add him to a custom faction and exclude that faction, or put a custom keyword on him and exclude that keyword, just to make sure.

Like... Keyword AllaKedrisNOTMERCHANT or sumpin?

 

I just now tried removing him from the caravan faction.  He no longer says the Business line, though he still has other random chatter (and the random chatter I gave him.)  So that, for whatever odd reason, worked.

 

But I must have touched something else when I was in the CK mucking about, because now Visit your spousehouse doesn't complete, no matter how much I run around that cell.

 

If it's not one thing it's another, huh?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...