Jump to content

Recommended Posts

Posted (edited)

I am trying to get what I figured was a very simple Quest to work in Skyrim. I have got everything working as far as conversations go but for some reason the Quest wont progress once it reaches the function

 

I jacked the mod nearly verbatim from a help website

 

So my quest is HFP1quest, Item4 is supposed to just be a bear pelt. Once the player has 3 in inventory the quest is supposed to progress. However, in its current state it won't progress. It just sits there thinking I still have yet to collect 3 pelts, even though I have.

So I am thinking that either the command to start the function at stage 10 is not working

 

SetObjectiveDisplayed(10)

Game.GetPlayer().AddItem(Alias_PeltList.GetReference(), 1)

HFP1S2.ArtQuestItemCount()

 

or the connection between the function and the stage command (which I put in the quest script) is no good

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

;NEXT FRAGMENT INDEX 4

Scriptname QF_HFP1quest_020012C7 Extends Quest Hidden

 

;BEGIN ALIAS PROPERTY Art

;ALIAS PROPERTY TYPE ReferenceAlias

ReferenceAlias Property Alias_Art Auto

;END ALIAS PROPERTY

 

;BEGIN ALIAS PROPERTY PeltList

;ALIAS PROPERTY TYPE ReferenceAlias

ReferenceAlias Property Alias_PeltList Auto

;END ALIAS PROPERTY

 

;BEGIN FRAGMENT Fragment_2

Function Fragment_2()

;BEGIN CODE

SetObjectiveDisplayed(10)

Game.GetPlayer().AddItem(Alias_PeltList.GetReference(), 1)

HFP1S2.ArtQuestItemCount()

;END CODE

EndFunction

;END FRAGMENT

 

;BEGIN FRAGMENT Fragment_3

Function Fragment_3()

;BEGIN CODE

Game.GetPlayer().AddItem(Gold001, 300)

;END CODE

EndFunction

;END FRAGMENT

 

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

 

MiscObject Property Gold001 Auto

 

HFP1script2 Property HFP1S2 Auto

Or that the function itself is wrong

Scriptname HFP1script2 extends Quest Conditional

 

Quest Property HFP1quest Auto

 

Int Property CountTotaled Auto Conditional

MiscObject Property Item4 Auto

 

Function ArtQuestItemCount()

 

Float CurrentCountMC = Game.GetPlayer().GetItemCount(Item4)

 

 

If CurrentCountMC >= 3

HFP1quest.SetObjectiveCompleted(10,1)

HFP1quest.SetObjectiveDisplayed(20,1)

CountTotaled = 1

Else

HFP1Quest.SetObjectiveDisplayed(10,true,true)

CountTotaled = 0

EndIf

 

EndFunction

If someone could shed some light on this that would be amazing. I don't know enough about scripting to trouble shoot and figure out what could be a problem. I do know everything complies fine and according to the website what I have should work.
Also as a side note if someone knows a script for the NPC to take the 3 pelts from the player once the quest is complete that would be awesome! I dont know how to do that either.
Edited by DreezNation
Posted

@ NexusComa - Thanks for trying to help, but these are general examples that do not help shed light on where I am having a problem. Mine is specific to getting this function to activate.

 

I cannot really take the information there and apply it to mine because those quests are all working with an alias, but mine is dealing with bear pelts which are not specific.

 

Looking at my quest in game using sqv I notice my quest stages activate, but the function is not working.

 

My stage 10 script box contains the following fragments (HFP1S2 is an abbreviated reference to my script which is linked in my quest script)

 

Game.GetPlayer().AddItem(Alias_PeltList.GetReference(), 1)

HFP1S2.ArtQuestItemCount()

 

The following property is in my quest script.

 

HFP1script2 Property HFP1S2 Auto

This as far as I know should then make my script run
But it does not.
I am looking for someone to point out an error, or offer a different way to accomplish this task.
Posted (edited)

I'd recommend reverse engineering a vanilla "go get me these items" quest, such as http://www.uesp.net/wiki/Skyrim:Few_and_Far_Between (CK ID: FreeformRiften04)

and here (below at explamples) explains how to get the objective to change as you colect the items, like "Retrieve cool stuff (1/3)"

http://www.creationkit.com/Text_Replacement

 

btw scripts are easier to read if you put the code tags instead of yellow text, nothing important but easier to the eye.

Edited by FrankFamily
Posted (edited)

You can remove anything in a script that starts with a ; even though it tells you not to. The ; is a rem statement.

As is it makes reading a simple script crazy hard ...

Edited by NexusComa
Posted

Ug, I feel defeated. So I have been trying to pick apart the suggested quest

 

 

  On 4/11/2016 at 10:53 PM, FrankFamily said:

I'd recommend reverse engineering a vanilla "go get me these items" quest, such as http://www.uesp.net/wiki/Skyrim:Few_and_Far_Between (CK ID: FreeformRiften04)

and here (below at explamples) explains how to get the objective to change as you colect the items, like "Retrieve cool stuff (1/3)"

http://www.creationkit.com/Text_Replacement

 

btw scripts are easier to read if you put the code tags instead of yellow text, nothing important but easier to the eye.

But it is not very easy. There are extra stages and extra things going on in the quest that make it impossible for me to keep it all straight. When I look at the functions and the fragments I can't sort out what does what.

Posted (edited)

Ok, i'm going to comment the relevant scripts for its functionality.

 

This is the main script of the quest:

Scriptname FFR04QuestScript extends Quest  

Quest Property pFFR04Quest Auto Conditional ; property for the quest itself to call setobjectivedisplayed and such
GlobalVariable Property pFFR04NirnCount Auto Conditional
GlobalVariable Property pFFR04NightshadeCount Auto Conditional
GlobalVariable Property pFFR04DeathbellCount Auto Conditional
Ingredient Property pNirnroot Auto Conditional
Ingredient Property pNightshade Auto Conditional
Ingredient Property pDeathbell Auto Conditional

; now the functions for updating the globals, the 3 are similar, just point at different objectives, items, etc.

Function Nirncount()

float CurrentCount = Game.GetPlayer().GetItemCount(pNirnroot) ; get count
pFFR04NirnCount.Value = CurrentCount ; set global
UpdateCurrentInstanceGlobal(pFFR04NirnCount) ; for it to display the change this has to be called
; now depending on the count update the objectives : http://www.creationkit.com/SetObjectiveDisplayed_-_Quest
if CurrentCount >= 20
pFFR04Quest.SetObjectiveCompleted(10,1)
pFFR04Quest.SetObjectiveDisplayed(15,true,true)
elseif CurrentCount < 20
pFFR04Quest.SetObjectiveCompleted(10,0)
pFFR04Quest.SetObjectiveDisplayed(15,0)
pFFR04Quest.SetObjectiveDisplayed(10,true,true) 
endif

endFunction

Function NightshadeCount()

float CurrentCount = Game.GetPlayer().GetItemCount(pNightshade)

pFFR04NightshadeCount.Value = CurrentCount
UpdateCurrentInstanceGlobal(pFFR04NightshadeCount)
if CurrentCount >= 20
pFFR04Quest.SetObjectiveCompleted(20,1)
pFFR04Quest.SetObjectiveDisplayed(25,true,true)
elseif CurrentCount < 20
pFFR04Quest.SetObjectiveCompleted(20,0)
pFFR04Quest.SetObjectiveDisplayed(25,0)
pFFR04Quest.SetObjectiveDisplayed(20,true,true) 
endif

endFunction

Function DeathbellCount()

float CurrentCount = Game.GetPlayer().GetItemCount(pDeathbell)

pFFR04DeathbellCount.Value = CurrentCount
UpdateCurrentInstanceGlobal(pFFR04DeathbellCount)
if CurrentCount >= 20
pFFR04Quest.SetObjectiveCompleted(30,1)
pFFR04Quest.SetObjectiveDisplayed(35,true,true)
elseif CurrentCount < 20
pFFR04Quest.SetObjectiveCompleted(30,0)
pFFR04Quest.SetObjectiveDisplayed(35,0)
pFFR04Quest.SetObjectiveDisplayed(30,true,true) 
endif

endFunction

Fragments mainly handle quest progression, removing the items once done and giving rewards, if quest is failed by killing the questgiver etc. There's also the alias of the quest giver to get death events and such. Not specific to the "pick some items for me" type of quest, you can check this tutorial:

http://www.creationkit.com/Bethesda_Tutorial_Planning_the_Quest

it covers all the setup for a quest, alias, the typical fragment scripting...

 

Another vital part is the player alias and it's script:

 

Scriptname FFR04PlayerScript extends ReferenceAlias  

FFR04QuestScript Property pFFR04QS Auto Conditional ; this property is for calling DeathbellCount() and the other similar functions
Ingredient Property pNirn Auto Conditional
Ingredient Property pDeathbell Auto Conditional
Ingredient Property pNightshade Auto Conditional
Quest Property pFFR04Quest Auto Conditional ; this one is for the getstagedone()
;both pFFR04Quest and pFFR04QS point to the quest but one is quest type the other for the custom quest script, FFR04QuestScript.

Event OnInit() ; to get the events we need to add the filters
AddInventoryEventFilter(pNirn)
AddInventoryEventFilter(pDeathbell)
AddInventoryEventFilter(pNightshade)
endEvent

; now when it detects we picked/dropped an item it updates the count
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)

if pFFR04Quest.GetStageDone(20) == 1
if pFFR04Quest.GetStageDone(30) == 0
if akBaseItem == pNirn
pFFR04QS.NirnCount()
endif
endif
endif

if pFFR04Quest.GetStageDone(20) == 1
if pFFR04Quest.GetStageDone(50) == 0
if akBaseItem == pDeathbell
pFFR04QS.DeathbellCount()
endif
endif
endif

if pFFR04Quest.GetStageDone(20) == 1
if pFFR04Quest.GetStageDone(40) == 0
if akBaseItem == pNightshade
pFFR04QS.NightshadeCount()
endif
endif
endif

endEvent

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)

if pFFR04Quest.GetStageDone(20) == 1
if pFFR04Quest.GetStageDone(30) == 0
if akBaseItem == pNirn
pFFR04QS.NirnCount()
endif
endif
endif

if pFFR04Quest.GetStageDone(20) == 1
if pFFR04Quest.GetStageDone(50) == 0
if akBaseItem == pDeathbell
pFFR04QS.DeathbellCount()
endif
endif
endif

if pFFR04Quest.GetStageDone(20) == 1
if pFFR04Quest.GetStageDone(40) == 0
if akBaseItem == pNightshade
pFFR04QS.NightshadeCount()
endif
endif
endif

endEvent
And you need to add the globals to the "text display globals" box. The objectives are like this one:
Find 20 nirnroot for Ingun Black-Briar (<Global=FFR04NirnCount>/<Global=FFR04NirnTotal>) ; Find 20 nirnroot for Ingun Black-Briar (2/3) for example
Edited by FrankFamily
Posted (edited)

Thank you frank! You are amazing! These little explainers were exactly what I needed!

 

 

 

 

Holy s#*&#33;, just looked at your profile! I love your mods!

Edited by DreezNation
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...