Add respawning item to merchant as result to quest

Post » Mon Aug 05, 2013 12:09 pm

After about a solid day of dialogue writing and what not my quest is working perfectly, except for this one thing. In the dialogue result box I put

hh_aqiirschest-> additem "hh_specialpotion" -5

hh_aqqiirschest being the merchants chest and hh_specialpotion being the item I wish to be respawning in their inventory. It sort of worked, except the merchant carries something like 65k instances of the item, instead of 5 respawning instances. I also tried just adding 5 without the negative but then of course he only stocks 5 and they don't respawn. Any ideas?

User avatar
Alexis Acevedo
 
Posts: 3330
Joined: Sat Oct 27, 2007 8:58 pm

Post » Mon Aug 05, 2013 6:05 pm

I see a spacing error in that code, try

hh_aqiirschest->additem "hh_specialpotion" -5

the 'fix' aka -> should never have spaces around it.

User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Mon Aug 05, 2013 5:48 pm

Ah, fixed that. Not sure why I did that, I didn't in any of my other dialogue stuff. Anyway, it still gives the merchant 65k hh_specialpotion.

User avatar
Sophie Miller
 
Posts: 3300
Joined: Sun Jun 18, 2006 12:35 am

Post » Mon Aug 05, 2013 2:32 pm

hmm....I have a feeling you cannot give a negative number to him via script, however what you could maybe try is this....make a new container for him with the potions in it set to -5 and assigned to him as owner with a script on it disabling it until the event happens that you want to happen, at which time the container gets enabled. No idea if this would work..but it is an idea.

Edit: script for chest

Begin hh_aqiirschest2_scriptShort ChestEnableShort DoOnceIf ( DoOnce == 0 )	If ( ChestEnable == 0 )		Disable	Else		Enable	Endif	Set DoOnce to 1EndifEnd hh_aqiirschest2_script

Put these lines in the dialog results box (assuming you named your new chest hh_aqiirschest2):

set hh_aqiirschest2.ChestEnable to 1set hh_aqiirschest2.DoOnce to 0
User avatar
Adam
 
Posts: 3446
Joined: Sat Jun 02, 2007 2:56 pm

Post » Mon Aug 05, 2013 12:57 pm

Yup, that works. Thanks a lot! First quest in my mod is done! I'll credit you for your scripting contribution, never would have got that on my own.

User avatar
Iain Lamb
 
Posts: 3453
Joined: Sat May 19, 2007 4:47 am

Post » Mon Aug 05, 2013 10:36 am

Glad I could Help :D

User avatar
Tanika O'Connell
 
Posts: 3412
Joined: Fri Jan 26, 2007 1:34 am

Post » Mon Aug 05, 2013 3:43 pm

Oh wait, no. Damn. The script you wrote works properly, in that the chest won't appear until I complete that dialogue option, but for some reason, even though there is no instance of the chest or the potion besides this one, it still appears in his inventory. I'm going to try making it so that Aq'Iir owns the cell instead of the chest, that way he won't own the chest or it's contents until it appears and therefore shouldn't be able to sell it.

edit: can you set cell ownership in Morrowind?

User avatar
Lil'.KiiDD
 
Posts: 3566
Joined: Mon Nov 26, 2007 11:41 am

Post » Mon Aug 05, 2013 8:06 pm

You can't add ownership to cells, only objects the PC can pick up or activate.

I think your problem may be that disabled chest does exist but just inactive, but from your observations, it seems disabled containers can be accesses :confused:

I think its better to placing it rather than disabling it shhould be better solution.

And, if its your first time scripting, get http://planetelderscrolls.gamespy.com/View.php?id=6083&view=Mods.Detail. It helps you to understand basics of scripting and we can help you better :D

User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am


Return to III - Morrowind