Entrisen Posted October 3, 2016 Share Posted October 3, 2016 So I haven't heard of anyone ask about this before, and it's something I think would be nice. Though I don't know if doing so would break the game or something. Is there a way to, say, take an NPC owned home, like Iringir's house in Dawnstar, and making it a home that is purchasable for the Player. The way I roleplay, I would love to just buy a house without being a thane, and I think having a house inside each city would be cool, and these would just be nice simple homes. Is there any way to get this done safely, without breaking anything? Thanks for any advice. Link to comment Share on other sites More sharing options...
GreatSilentOne Posted October 5, 2016 Share Posted October 5, 2016 You can use a script to activate the house purchase and add the player to the proper factions to give them ownership of the house. Their beds are likely set to belong to the NPCs themselves, however, and transferring ownership to the player might break the NPC's daily packages. At the same time, simply unsetting the bed's ownership altogether could solve that (the player, the NPC, and anyone else who was nearby would be able to use the bed, since it would have no ownership). If any of those options answer your question, I can give some more information on how to accomplish that (assuming you don't know) a bit later. I have some scripts already written which accomplish something similar, but I don't have them on this computer at the moment. Link to comment Share on other sites More sharing options...
Entrisen Posted October 8, 2016 Author Share Posted October 8, 2016 You can use a script to activate the house purchase and add the player to the proper factions to give them ownership of the house. Their beds are likely set to belong to the NPCs themselves, however, and transferring ownership to the player might break the NPC's daily packages. At the same time, simply unsetting the bed's ownership altogether could solve that (the player, the NPC, and anyone else who was nearby would be able to use the bed, since it would have no ownership). If any of those options answer your question, I can give some more information on how to accomplish that (assuming you don't know) a bit later. I have some scripts already written which accomplish something similar, but I don't have them on this computer at the moment.I appreciate the advice here- In the last few days I decided it was best that I made my own player homes, and I feel i've done quite well as it's pretty simple and straightforward. I would very much be greatful to you if you could help me out with this one thing though, making my custom home purchasable. I am at a complete loss, and I've done a search online high and far and I somehow cannot find a solution to this. I would love to have the homes i make have to be bought. I've created a key, and all that, but when it comes to scripting, I'm an absolute beginner. I've taken a look at the House Purchase Quest to get an idea, but i'm still confused. Thanks for any help :) Link to comment Share on other sites More sharing options...
GreatSilentOne Posted October 9, 2016 Share Posted October 9, 2016 Here's an example script. I don't have much time right now to do more than paste it in right now, I'll try to get back and explain it further if you need. The script is attached to the door of the house (you can attach it to any object that can be activated, though), and executes whenever the door is activated (the player tries to open it). Ignore the part about enabling male or female housecarls and skip down to where it says "if (!HousePurchased)" Scriptname WHBuyHouseScript extends ObjectReference Message Property WHBuyHouseBox Auto Message Property WHSelectGender Auto Key Property HouseKey Auto Cell Property HouseInterior Auto Faction Property PlayerFaction Auto MiscObject Property Gold Auto Actor Property HousecarlM Auto Actor Property HousecarlF Auto ObjectReference Property EnableMarker Auto ObjectReference Property EnableGuestRoom Auto Quest Property Favor257 Auto bool HousePurchased = false bool HousecarlSpawned = false ;Script will run every time door is activated Event OnActivate(ObjectReference akActionRef) ;Checks if the housecarl has been enabled/if player is thane if(!HousecarlSpawned && Favor257.GetStage() == 200) int ibutton = WHSelectGender.show() ;0 = male, 1 = female. Yes, it's binary. if(ibutton == 0) HousecarlM.Enable() else HousecarlF.Enable() endif EnableGuestRoom.Enable() HousecarlSpawned = true endif ;Will not run if house is already purchased if (!HousePurchased) ;The ! is called the "not operator" in Computer Science. So, "if HousePurchased is false" int ibutton = WHBuyHouseBox.show() ;WHBuyHouseBox pops up and asks if the player wants to buy the house ;I think this is the Papyrus equivalent of a switch statement? ;I admittedly looked most of this code up, but I can explain it if you need me to if ibutton == 0 if (Game.GetPlayer().GetItemCount(Gold) >= 1000) Game.GetPlayer().RemoveItem(Gold, 1000) Game.GetPlayer().AddItem(HouseKey) HouseInterior.SetFactionOwner(PlayerFaction) EnableMarker.Disable() HousePurchased = true elseif(Game.GetPlayer().GetItemCount(Gold) < 1000) ;Hopefully self-explanatory Debug.Notification("Not enough gold!") endif else ;Papyrus wouldn't compile without an else for the if. This doesn't do anything. endif endif EndEvent It's used in this mod, for reference: http://www.nexusmods.com/skyrim/mods/76481/? Link to comment Share on other sites More sharing options...
Entrisen Posted October 9, 2016 Author Share Posted October 9, 2016 Here's an example script. I don't have much time right now to do more than paste it in right now, I'll try to get back and explain it further if you need. The script is attached to the door of the house (you can attach it to any object that can be activated, though), and executes whenever the door is activated (the player tries to open it). Ignore the part about enabling male or female housecarls and skip down to where it says "if (!HousePurchased)" Scriptname WHBuyHouseScript extends ObjectReference Message Property WHBuyHouseBox Auto Message Property WHSelectGender Auto Key Property HouseKey Auto Cell Property HouseInterior Auto Faction Property PlayerFaction Auto MiscObject Property Gold Auto Actor Property HousecarlM Auto Actor Property HousecarlF Auto ObjectReference Property EnableMarker Auto ObjectReference Property EnableGuestRoom Auto Quest Property Favor257 Auto bool HousePurchased = false bool HousecarlSpawned = false ;Script will run every time door is activated Event OnActivate(ObjectReference akActionRef) ;Checks if the housecarl has been enabled/if player is thane if(!HousecarlSpawned && Favor257.GetStage() == 200) int ibutton = WHSelectGender.show() ;0 = male, 1 = female. Yes, it's binary. if(ibutton == 0) HousecarlM.Enable() else HousecarlF.Enable() endif EnableGuestRoom.Enable() HousecarlSpawned = true endif ;Will not run if house is already purchased if (!HousePurchased) ;The ! is called the "not operator" in Computer Science. So, "if HousePurchased is false" int ibutton = WHBuyHouseBox.show() ;WHBuyHouseBox pops up and asks if the player wants to buy the house ;I think this is the Papyrus equivalent of a switch statement? ;I admittedly looked most of this code up, but I can explain it if you need me to if ibutton == 0 if (Game.GetPlayer().GetItemCount(Gold) >= 1000) Game.GetPlayer().RemoveItem(Gold, 1000) Game.GetPlayer().AddItem(HouseKey) HouseInterior.SetFactionOwner(PlayerFaction) EnableMarker.Disable() HousePurchased = true elseif(Game.GetPlayer().GetItemCount(Gold) < 1000) ;Hopefully self-explanatory Debug.Notification("Not enough gold!") endif else ;Papyrus wouldn't compile without an else for the if. This doesn't do anything. endif endif EndEvent It's used in this mod, for reference: http://www.nexusmods.com/skyrim/mods/76481/?I appreciate all of that. Although, I'm confused honestly. I went to the door and made a new script, went to the source and pasted this in but there are errors and so I went back and thought, duh, I need to add in the correct ID's for the specific house key i'm using and the specific interior cell I want. So I did that, and it says they are all undefined. I'm so lost. I know you are busy, and i'll eventually figure this out. Just takes time messing around with it. Thanks for your help. Link to comment Share on other sites More sharing options...
GreatSilentOne Posted October 10, 2016 Share Posted October 10, 2016 (edited) Run through the first few episodes of this series to get the basics. I wish I could help you more directly, because it's really not that hard to explain, but it's the kind of thing you need to see for yourself. Darkfox does a pretty good job of explaining the stuff, and starts from the basics. Just watch what he does closely. https://www.youtube.com/watch?v=KeP05l7O77E You're probably experiencing issues with your properties. After you write the script, you need to right click on the script in the Creation Kit, and click "Edit Properties." Fill those in to the best of your ability. Since you probably don't need most of the ones from my script, you can go ahead and delete the ones you can't fill. If it still doesn't work, post your edited script (using mine as-is obviously won't work), and a brief explanation of how you plan on implementing the purchase (such as prerequisite quests, killing someone, cost, what items needed to be added to the player's inventory when they buy it). Edited October 10, 2016 by GreatSilentOne Link to comment Share on other sites More sharing options...
Recommended Posts