Difference between revisions of "House for Sale Tutorial"

4,002 bytes added ,  05:13, 5 November 2009
m
internal links
imported>GhanBuriGhan
(Added to quest tutorials cat.)
imported>Qazaaq
m (internal links)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Needed for the Purchase A House Quest
==Preparations==
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 an [[NPC]] who will sell the house.
*Make a house [[key]].
*Make a [[quest]].
See [[Creating a House]] for more information on how to make it.


-House
==Preparing the house==
First of all you need to set the lock on your house door to "Needs a Key". Change the key to the one that you made earlier (preparations section).<br>
You house is going to be split up into sections (e.g. Kitchen, Living Room, Dining Room).<br>
In each section you need to set a parent. Highlight an item in your section.<br> Double-click on it and check the ''Persistent Reference'' box. Give the item a Reference Editor ID, e.g. ''BedroomParentRef''.<br> Double-click on the another thing in the same section. Go to ''Enable Parent'' then press ''Select Reference in Render Window''.<br>
You can now see your [[Render Window]]. Double click on the Parent that you made earlier. Repeat this on the other sets so that each set is linked to their own parent.<br><br>
Now your house is ready.


-Interior
==The NPC==
The NPC needs some [[dialogue]].<br>
Go to [[Quest]] and then to the [[Topics Tab]].<br>
Right-click in the empty list and press ''add topic''.<br>
Then you add ''HouseDecline'' and ''HouseInquiry''.<br>
Go back to the ''addtopic''list, right-click and press ''new topic''.<br>
Make one topic called ''Housebuy<TOWNNAMEHERE>'' and one called ''HouseTooMuch<TOWNNAMEHERE>''.<br><br>
Before you continue you need to choose a price for the house.<br><br>
Now select ''HouseBuy''. In the ''topic text'' you write something like this: "''I'll gladly pay 3,000 gold for it''" (If your house costs 3000, of course).<br> Then go to the list beneath the ''topic text''. Right-click and select ''new''. <br>In the Response text you write something like this: "''Good choice, here is your key.''" <br>If you have audio files, add them now. <br>Press ''Ok''.<br>
In the ''Result Script'' write:
[[SetStage]] ''<QUESTNAME>'' 10
In the [[Condition]]s list you right-click and press new.<br>
Set the ''Condition Function'' to [[GetGold]], leave the ''Function Parameters'' empty, set Comparison to ''>='' and the value to the price of your house, then check  ''Run on target''.<br> Then add a new Condition, Function: [[GetIsID]], Parameters: <Your NPC's name>, Comparison: ==, Value: 1 and leave ''Run on Target'' unchecked. <br>Select ''HouseDecline'' add a new response.<br> Add a text like this: "''Come back if you change your mind.''".<br>
Then add the audio.<br> Add another ''GetIsID'' condition just like you did the second time on the previous Topic.<br>
Select ''HouseInquiry''. Add a new response with a text like this: "''I've been looking for this special house.''".<br> Add audio.<br>
In the conditions you add the same ''GetIsID'' condition as the last topic. <br>Then you add a new condition: Function: [[IsCellOwner]], Parameters:<The cell of your house> Player, Comparison: == and Value: 0. <br>Then add a third condition: Function: [[GetDisposition]], Comparison: >= and Value: (How much the NPC needs to like you before they offer you the house). <br>In the ''Choices'' List, add ''HouseBuy'', ''HouseDecline'' and ''HouseTooMuch''.<br>
Select ''HouseTooMuch'', write ''I can't afford 3,000 gold.'' in the ''Topic Text''.<br> Add a new response with text like this: "''What a shame. I guess I have to look for another buyer.''".<br> Add audio. <br>Add a condition, the usual GetIsID condition.<br><br>
Now the dialogue is finished.


-A HouseForSale door (ie. HouseForSaleBartholm) (HouseBartholmScript runs on this object)
==The furnishing==
First create a scroll for each set of furniture and name them something like: ''House BedRoom'' or ''House DiningRoom''.<br>In the scroll you write what this set of furniture will add to your house. Something like this:


-Furnished with All purchase furnishings linked to one parentobject. (ie the rug is the parent of the chair, table, books on the table, etc. named something to the effect of ParentStudyAreaBartholm, ParentStorageAreaBartholm, etc.)
<blockquote>This entitles the bearer to:<br/>
1 Bed<br/>
1 Carpet<br/>
1 Bookshelf with books<br/>
1 Set of Drawers<br/>
1 Stool</blockquote>


-A vendor (the person you purchase furniture from)
Add this script to the scroll:


-A house quest giver. (the person you buy the house from)
Scriptname HouseFurnReceipt1Script
short Doonce
begin OnAdd player
if ( Doonce == 0 )
SetItemValue 0
set Doonce to 1
endif
end


-A container object hidden in the vendors cell with all the receipts for purchased furniture (give it a reference name its refered to in the house furniture script)
Then add a value to the scroll.<br>
You can make the next part a few different ways, i will show one of them.<br>
First choose the seller of the sets, you can use the seller of the house or someone else. <br>Select the Merchant cointainer to this Npc. Then add this to it's Script (you need to edit it):


-A Receipt (actually a book) for each Furnishable Area (ie. House Bedroom Area) with the HouseFurnReceiptScript linked to it.
short once
begin gamemode
if getstage (YOUR QUEST NAME) >= 10
if once == 0
additem (FIRST SET ID) 1
additem (SECOND SET ID) 1
                        ; Do this on all of the sets                     
set once to 1
endif
endif
end


-A script HouseBartholmFurnScript for the furnishings (it enables purchases once you have bought you house and completes the quest once you have purchased all available upgrades) (quest script linked to the house for sale quest)
==The Quest==
Make a Quest Script and add it to your Quest.<br>
This is the script you will need (again, you need to edit):


-A script HouseBartholmScript to advance the quest once you have visited your new house. (ie. I've seen my new house now I want furniture... point me towards the furniture store) (object script)
scn aaa(initials)buyinghouse
 
-A quest for the House for Sale (HouseBartholm runs HouseBartholmFurnScript)
short TotalCount ;counts how many furniture sets you have bought
 
short Doonce1    ;checks if you have bought the first set
+ Quest Data: runs HosueBartholmFurnScript
short Doonce2    ;checks if you have bought the second set
 
;add "Short Doonce3" if you have 3 sets, and so on
+ Quest Stages: 3 (bought house, visited house need furniture, purchased all available upgrades)
 
+ Quest Targets: Point to house3sale door and furniture vendor
 
+ Quest Topics:
HouseByBartholm- sets stage 1
HouseDecline
HouseInquiry- adds choices HouseBuyBartholm, HouseDecline,HouseTooMuchBartholm
HouseTooMuchBartholm
 
 
*Note: I do not mention the conditions, result scripts, & checks in the quest. (Actually I did but my dog sat on my surge protector and I’m not motivated to write them a second time) Refer to the game’s topics and infos to make sure you have everything linked correctly. Use the copy all conditions and paste them into your infos and then change their references to your town, house, door, furniture vendor, etc.
 
 
 
Scriptname HouseBartholmFurnScript
   
   
short TotalCount
short MerchSetup
short Doonce1
  float fQuestDelayTime
  float fQuestDelayTime
   
   
Line 51: Line 94:
  ;Kill script if conditions aren't met
  ;Kill script if conditions aren't met
   
   
  if ( GetStage HouseBartholm < 10 )
  if ( GetStage housearea2 < 10 )
  Return
  Return
  endif
  endif
   
   
  ;Merch Container Stuff
  if getstage (YOUR QUEST NAME) == 10 && player.getincell  (YOUR HOUSE CELL)  == 1
setstage (YOUR QUEST NAME) 20
endif
   
   
if ( GetStage HouseBartholm == 10 ) && ( MerchSetup == 0 )
HouseBartholmAddonsRef.Enable
HouseBartholmAddonsRef.SetOwnership ZorbagraUzgash
set MerchSetup to 1
endif
   
   
 
  ;These are the variable triggers that are set when a voucher is acquired
  ;These are the variable triggers that are set when a voucher is acquired
   
   
  if ( Player.GetItemCount HouseBartholmBedroomAreaReceipt == 1 ) && ( Doonce1 == 0 )
  if ( Player.GetItemCount (FIRST FURNITURE SET ID) == 1 ) && ( Doonce1 == 0 )
  ParentBedroomAreaBartholm.Enable
  (FIRST PARENT).Enable
  set TotalCount to ( TotalCount + 1 )
  set TotalCount to ( TotalCount + 1 )
  set Doonce1 to 1
  set Doonce1 to 1
  endif
  endif
   
   
if ( Player.GetItemCount (SECOND FURNITURE SET ID) == 1 ) && ( Doonce2 == 0 )
(SECOND PARENT).Enable
set TotalCount to ( TotalCount + 1 )
set Doonce2 to 1
endif
;Add more if you have them
   
   
  ;Ends Quest if All Bought
  ;Ends Quest if All Bought
   
   
  if ( TotalCount < 11 )
  if ( TotalCount == 2 )   ;change the "2" to the number of things you have.
  if ( TotalCount == 10 )
  setstage (QUEST NAME) 30
setstage HouseBartholm 30
set fQuestDelayTime to 0
set fQuestDelayTime to 0
endif
  endif
  endif
   
   
  end
  end


Go to [[Quest Stages Tab]] and add stage 10, 20 and 30. Select stage 10. <br>Make a new Log Entry with the text: "''I just bought a house in <TOWN NAME HERE>.''".<br>
In the ''Result Script'' write this:
<FIRST PARENT NAME>.disable
<SECOND PARENT>.disable
;do this on all the parents
Player.RemoveItem Gold001 3000 ;(change the 3000 to your house price)
Player.AddItem <Your key ID> 1
SetCellOwnership <YOUR HOUSE CELL>
SetCellFullName <YOUR HOUSE CELL> "(The name of your town) House"
ModPCMiscStat 15 1
set <YOUR QUEST NAME>.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 NAME>, I may want to head over to <YOUR NPC WHO SELLS FURNITURE> at <FURNITURE NPC LOCATION> to secure some furnishings for it.''"<br><br>


Select Stage 30 and make a new log entry with the text: "''I've now bought everything <FURNITURE NPC> has for my house in <YOUR TOWN NAME HERE>.''".
Check the ''Complete Quest'' to finish the quest.<br><br>


ScriptName HouseBartholmScript
That concludes the "House for Sale" tutorial. Enjoy your new house!
Begin OnLoad
If GetStage HouseBartholm == 10
If Player.GetInCell BartholmHouseForSale == 1
SetStage HouseBartholm 20
EndIf
EndIf
End


[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:Quest_Tutorials]]
[[Category:Quest Tutorials]]
Anonymous user