Need help with a "fetch x number of y" quest

Post » Sat Mar 02, 2013 4:20 pm

I haven't tried to do this kind of quest before, and have found to be a little out of my skill range. The quest is similar to other "fetch a bunch of this stuff" quests, in fact I basically copied the quest script for FreeformRiften04 (getting 20 of nirnroot, deathbell, and nightshade for Ingun Black-Briar) and switched out all the variables for my quest.

So far I have gotten the quest to start, and the global variables in the quest objective display correctly (eg. "Find 9 bottles of wine (0/9)"). Problem is I apparently haven't scripted it correctly to update when the player picks up the stuff.

Here is my quest script. It compiles without errors, but like I said, it doesn't update when the quest items are picked up. The player actually needs to get three things (bread, wine, and beef), but it's fairly repetitive so I'll just put the wine part:

Spoiler
Scriptname ST02AQuestScript extends QuestQuest Property pST02AQuest  Auto  ConditionalFormList Property pST02AWineList  Auto  ConditionalGlobalVariable Property pST02AWineCount  Auto  ConditionalGlobalVariable Property pST02AMeatCount  Auto  ConditionalGlobalVariable Property pST02ABreadCount  Auto  ConditionalPotion Property FirebrandWine Auto ConditionalPotion Property FoodSolitudeSpicedWine Auto ConditionalPotion Property FoodWineAlto Auto ConditionalPotion Property FoodWineAltoA Auto ConditionalPotion Property FoodBeef Auto ConditionalPotion Property FoodBread01A Auto ConditionalFunction Winecount()float CurrentCount = Game.GetPlayer().GetItemCount(pST02AWineList)pST02AWineCount.Value = http://forums.bethsoft.com/topic/1447091-need-help-with-a-fetch-x-number-of-y-quest/CurrentCountUpdateCurrentInstanceGlobal(pST02AWineCount)if CurrentCount &--#62;= 9  pST02AQuest.SetObjectiveCompleted(0,1)  pST02AQuest.SetObjectiveDisplayed(5,true,true)elseif CurrentCount &--#60; 9  pST02AQuest.SetObjectiveCompleted(0,0)  pST02AQuest.SetObjectiveDisplayed(5,0)  pST02AQuest.SetObjectiveDisplayed(0,true,true)endifendFunction

If you could point out what I've missed that would be helpful. I am assuming the "UpdateCurrentInstanceGlobal" is supposed to update the quest objective when a bottle of wine is picked up, but am I wrong about that?
User avatar
flora
 
Posts: 3479
Joined: Fri Jun 23, 2006 1:48 am

Return to V - Skyrim