House for Sale Tutorial

Revision as of 14:21, 3 May 2009 by imported>BugUsNot (→‎The furnishing)

Here comes a tutorial about how you make your own House for Sale.

Preparetions

Before we can start you need to do this:

  • Make the Exterior of the house.
  • Make a cell for the Interior, name it House for Sale.
  • Make the interior of the House and decorate it.
  • Make a Npc who will sell the house.
  • Make a House Key
  • Make a Quest

Preparing the house

First, add two doors, one in the interior and the other one in the Exterior. Link them together and set the lock to Need A Key and choose your key as the correct key.
Then decide what decoration who will come with each set of things.
In each set you need a parent, just pick one of the thing in the set.
Double-click on it and check the Persistent Reference box,give it an Referece ID too. Example: BedroomParentRef.
Double-click on the other things in the same set and go to Enable Parent then press Select Reference in Render Window.
Double-click on the Parent of the set. Then repeat this on the other set so each set is linked to their own parent.

Now Your house is ready.

The Npc

The Npc needs some dialogues.
Go to the Quest and go to Topics.
Right-click in the empty list and press add topic.
Then you add HouseDecline and HouseInquiry.
Go back to the addtopiclist, right-click and press new topic.
Make one topic called Housebuy(the name of your town) and one called HouseTooMuch(the name of your town).

Before you continues. You need to choose a price on the house.

Now select HouseBuy. In the topic text you whrite something like this: "I'll gladly pay 3,000 gold for it" (If your house cost 3000, of course).
Then go to the list beneath the topic text. Right-click and select new.
In the Response text you whrite something like this: "Good choice, here is your key..."
Then add the audio, if you don't want to record your own voice you can unpack some voices from oblivion.
Press Ok.
In the Result Script write:

SetStage (The name of your Quest) 10

In the Conditions list you right-click and press new.
Set the Condition Function to GetGold, leave the Function Parameters empty, set Comparision to >= and the value to the price of your house, then check the Run on target.
Then add a new Condition, Function: GetisId, Parameters: (Your Npc), Comparison: ==, Value: 1 and Run on Target: Unchecked.
Select HouseDecline add a new response.
Add a text like this: "I'd prefer to only discuss the property with serious buyers.".
Then add the audio.
Add a condition like the second one on the previouse Topic.
Select HouseInquiry. Add a new response with a text like this: "I've been looking for just the right owner for a special home I have.".
Add audio.
In the conditions you add the same condition as the last topic.
Then you add a new condition: Function: IsCellOwner, Parameters:(The cell of your house) Player, Comparison: == and Value: 0.
Then add a third condition: Function: GetDisposition, Comparison: >= and Value: (How much the Npc needs to like you before He/She Offer you the house).
In the Choices List, add HouseBuy, HouseDecline and HouseTooMuch.
Select HouseTooMuch, whrite I can't afford 3,000 gold. in the Topic Text.
Add a new response with a text like this: "What a shame. I guess I have to look for another buyer.".
Add audio.
Add a condition, the usual GetIsID condition.

Now the dialouges is finished.

The furnishing

First create a scroll for each set of furniture and name them like: House BedRoom or House DinningRoom.
In them you write what this set of furniture will add to your house. Something like this:
This will upgrade your house with:

1 Bed
1 Carpet
1 Bookshelf with 1 book
1 Drawers with 3 clothes
1 Stool

Add this script on them:

Scriptname HouseFurnReceiptScript

short Doonce

begin OnAdd player

if ( Doonce == 0 )
	SetItemValue 0
	set Doonce to 1
endif

end

Then add a value to them.
You can make the next part on different ways, i will show one of them.
First choose the seller of the set's, you can use the seller of the house or someone else.
Select the Merchant cointainer to this Npc. Then add this to it's Script:

short once

begin gamemode
	if getstage (QuestName) >= 10
		if once == 0
			additem (Id of the first Set) 1
			additem (Id of the second Set) 1
                       ; Do this on all of the sets                       
			set once to 1
		endif
	endif
end

The Quest

Make a Quest Script and add it to your Quest.
This is the script you will need:

scn aaabuyinghouse

short TotalCount ;counts how many furniture set you have bouught
short Doonce1    ;check if you have bought the first thing
short Doonce2    ;check if you have bought the second thing
;add "Short Doonce3" if you have 3 items

float fQuestDelayTime

begin gamemode

;Kill script if conditions aren't met

if ( GetStage housearea2 < 10 )
	Return
endif

if getstage (Questname) == 10 && player.getincell   (HouseCell)   == 1
	setstage (Questname) 20
endif



 
;These are the variable triggers that are set when a voucher is acquired

if ( Player.GetItemCount (first set of furniture ID) == 1 ) && ( Doonce1 == 0 )
	(first parent).Enable
	set TotalCount to ( TotalCount + 1 )
	set Doonce1 to 1
endif

if ( Player.GetItemCount (Second set of furniture ID) == 1 ) && ( Doonce2 == 0 )
	(second parent)..Enable
	set TotalCount to ( TotalCount + 1 )
	set Doonce2 to 1
endif

;Ends Quest if All Bought

if ( TotalCount == 2 )    ;change the "2" to the number of things you have.
	setstage (Quest Name) 30
	set fQuestDelayTime to 0
endif

end

Go to Quest Stages and add stage 10, 20 and 30. Select stage 10.
Make a new log Entry with the text: "I just bought a house in (The name of your town).".
In the Result Script whrite this:

(first parent).disable
(second parent).disable
;do this on all the parents
Player.RemoveItem Gold001 (the price of your house)
Player.AddItem (Your key ID) 1
SetCellOwnership (HouseCell)
SetCellFullName (HouseCell) "(The name of your town) House"
ModPCMiscStat 15 1
set (Questname).fQuestDelayTime to 1

Select stage 20 and make a new Log Entry with the text: "Now that I've arrived at my new house in (Your town), I may want to head over to (The Npc To sell the furniture) at (where he is) to secure some furnishings for it."

Select Stage 30 and make a new log entry with the text: "I've now bought everything (The Npc To sell the furniture) has for my house in (Your Town).". Check the Complete Quest to finish the quest.

And now you have made a House for sale.