orphanage scripting help

Post » Wed Dec 23, 2009 2:13 am

I'm going to modify a pre-existing companion script for my Children of Morrowind dependent orphanage mod, allowing the player to "adopt" a kid if they want. Here is how I want this to work:

Kids in the orphange have the default kid topics from that mod.
Player goes to headmistress to adopt.
If the player's bounty is 0, headmistress will allow option, if bounty is 1 or more headmistress will not allow.
Player buys one or more adoption licenses from her barter screen.
Player takes the license to the matching kid.
If the kid's disposition is under 80 they will refuse to recognize the license.
If the kid likes the player, will get the companion options.

The license objects are mostly done at this point (parchments). Do I just add them to headmistress inventory and turn on bartering? Also, how would I put disposition checks and item checks into the companion activation script for the kids? And, is it possible to set the adoption license barter screen so the price does not change with the headmistress disposition? How do I block barter option if there is abounty? There may be more questions later but for now this may be enough info to make the system work. Also, what do you think is a fair price for an adoption license? Thanks for the help!
User avatar
ZANEY82
 
Posts: 3314
Joined: Mon Dec 18, 2006 3:10 am

Post » Tue Dec 22, 2009 6:46 pm

Also, it won't let me add a barter interface to the headmistress. Do the objects need to be in her inventory for the option to become available?
User avatar
Tyrel
 
Posts: 3304
Joined: Tue Oct 30, 2007 4:52 am

Post » Tue Dec 22, 2009 12:33 pm

Also, it won't let me add a barter interface to the headmistress. Do the objects need to be in her inventory for the option to become available?


Barter and which items the seller sell is controlled by the character's class. You can examine the existing classes under the character menu and assign one of those or create a new class. Either way the Auto-calc Buys/Sells check box for books must be checked for this NPC to sell the parchements.
User avatar
Jessie
 
Posts: 3343
Joined: Sat Oct 14, 2006 2:54 am

Post » Tue Dec 22, 2009 7:36 pm

Okay, she has barter. Can I set it so the price does not change with her disposition? Also, how would I set it so she will refuse to sell if the player has a bounty? Is there a way to remove the items from her inventory if she gets killed (preventing adoption through violence?)
User avatar
Nice one
 
Posts: 3473
Joined: Thu Jun 21, 2007 5:30 am

Post » Tue Dec 22, 2009 10:14 am

Can I set it so the price does not change with her disposition?

No. Unless you sell the item through Dialog, not the normal Barter window.
Also, how would I set it so she will refuse to sell if the player has a bounty?

You would have to make her a specific Greeting that dose a PC Crime Level check on the Player. If Crime Level >= 1 use Goodbye in the Results window to prevent the ability to Barter.

Is there a way to remove the items from her inventory if she gets killed (preventing adoption through violence?)

Place all her for-sale items in containers that are hidden from the player (like below the floor or beyond the walls,) instead of in her personal inventory. (remember that Merchants will sell items from containers that they have Ownership of)
Then when she's dead, all her wares will be inaccessible because they are not on her body.
User avatar
Da Missz
 
Posts: 3438
Joined: Fri Mar 30, 2007 4:42 pm

Post » Tue Dec 22, 2009 1:03 pm

The headmistress end of things is now completely functional. Now I'm working on the dialog for adoption. I have on my prototype, if you have the adoption license for a child they will receive the adoption topic, which will return one of two options based on disposition. However, every time I talk to the test kid I get the lower-disposition adoption refusal dialog, even though I set the disposition for the adoption confirmation dialog at 80 and the kid had 100. How do I fix that?
User avatar
Alexander Horton
 
Posts: 3318
Joined: Thu Oct 11, 2007 9:19 pm

Post » Tue Dec 22, 2009 3:04 pm

Also, how would I set it so she will refuse to sell if the player has a bounty?


Place a greeting in the service refusal dialog that test for the headmistress' id and bounty > 0. By doing it correctly the player will still be able to talk to the NPC but will be unable to make a purchase. If you just use the goodbye result then all of the NPC's dialog will be unavailable.
User avatar
Cash n Class
 
Posts: 3430
Joined: Wed Jun 28, 2006 10:01 am

Post » Tue Dec 22, 2009 11:35 am

Well I want "criminal" players to be unable to talk to her, because she is responsible for taking care of a bunch of children, so I'll leave it as is. I also fixed the issue with the test kid's disposition. I should have a working prototype within the hour.
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Tue Dec 22, 2009 10:54 pm

Adoption system functional for all kids! I still have to fix a few of the companion settings and tweak some of the scripts. I'm also implementing a feature where if you kill any of the staff, none of the kids will talk to you, except the ones who have already finalized adoption. During my test I realized it is possible to adopt every kid in the orphanage, leaving it empty. How would I go about changing the staff dialog if every kid is gone?

Love my Templar Argonian and Ebony Orc guards! (orphanage was funded personally by the Duke)

Screenshots coming on the WIP thread in Mods subforum hopefully tomorrow.
User avatar
Cagla Cali
 
Posts: 3431
Joined: Tue Apr 10, 2007 8:36 am

Post » Tue Dec 22, 2009 11:00 am

Adoption system functional for all kids! I still have to fix a few of the companion settings and tweak some of the scripts. I'm also implementing a feature where if you kill any of the staff, none of the kids will talk to you, except the ones who have already finalized adoption. During my test I realized it is possible to adopt every kid in the orphanage, leaving it empty. How would I go about changing the staff dialog if every kid is gone?

Love my Templar Argonian and Ebony Orc guards! (orphanage was funded personally by the Duke)

Screenshots coming on the WIP thread in Mods subforum hopefully tomorrow.

I like your idea very much, the more CoM mods the better!

How many kids are there? If there are say more than 20, you could use a global counter 'KidsAdopted', so every time you talk to a kid with their matching licence, the counter goes up like that: Set KidsAdopted To ( KidsAdopted + 1 ). This way you can have different dialogue options depending on how many kids were adopted using the filter global / KidsAdopted > [number here]. That being said, I tend to use global variables too often and there is probably a better way...
User avatar
Kelly Upshall
 
Posts: 3475
Joined: Sat Oct 28, 2006 6:26 pm

Post » Tue Dec 22, 2009 12:53 pm

Almost functional! Dialogue end done, just need to add the default kid behavior scripts and companion scripts. One final question: If I wanted to play a custom music in the orphanage, how would I make it so the music starts when the player enters the building and stops when the player leaves?
User avatar
Roy Harris
 
Posts: 3463
Joined: Tue Sep 11, 2007 8:58 pm

Post » Tue Dec 22, 2009 11:50 pm

Got music working. However, to do so I had to script it to the door, causing the door not to send the player to its door marker, so I had to have the script place the player outside instead. Now any companions (including adopted children) are stuck inside. How would I go about having the door script check for companions and place them with the player?
User avatar
Laura-Jayne Lee
 
Posts: 3474
Joined: Sun Jul 02, 2006 4:35 pm

Post » Tue Dec 22, 2009 2:14 pm

Sorry double post due to browser glitch
User avatar
Adriana Lenzo
 
Posts: 3446
Joined: Tue Apr 03, 2007 1:32 am

Post » Tue Dec 22, 2009 12:38 pm

Got music working. However, to do so I had to script it to the door, causing the door not to send the player to its door marker, so I had to have the script place the player outside instead. Now any companions (including adopted children) are stuck inside. How would I go about having the door script check for companions and place them with the player?

Post your music script. It sounds like you went about implementing it in an odd way.
The only script that you would need on any door would be to resume normal music when exiting your building. This doesn't mess up the teleport function.
User avatar
XPidgex Jefferson
 
Posts: 3398
Joined: Fri Sep 08, 2006 4:39 pm

Post » Tue Dec 22, 2009 10:44 pm

I don't think there is a line of code for normal music, just the streammusic command which plays a specific file. I have the start music command in a global script that checks to see if the player is in the interior cell when they move cells. There is no command to stop music, so I use the streammusic command on the door to play a one-second silence track on exit, after which normal music resumes.
User avatar
Marine Arrègle
 
Posts: 3423
Joined: Sat Mar 24, 2007 5:19 am

Post » Tue Dec 22, 2009 11:09 pm

It works now! I looked at another mod's script that involved automatically teleporting companions and realized there was a command I was completely ignoring! The music now starts when you enter the building, and stops when you leave, and your companions come with you. Now on to fix some follow issues and I'm getting very near the open testing phase!
User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm


Return to III - Morrowind