Issues spawning a quest item in a container.

Post » Tue May 21, 2013 2:21 am

Edit: Thanks Thingyperson for your reply. It ends up that it is working, and it was just the game glitching out.

Okay, so the deal is I deleted Hod's End Table next to his bed in his house in Riverwood.

I made a custom container for this quest even though now that I look back it seems that this was not necessary.

For my quest, under Quest Aliases

I have a *Specific Reference type alias pointing directly to Hods Endtable named HodsTable

I also have an alias to the item that is supposed to be in the endtable called Jameelsremains This alias is a *Create Reference to Object alias of a custom item I made called Jameels Remains and it is Level:Easy Created In:HodsTable

On my quest, when a stage is met (Stage 20), which IS being met, I have a papyrus script for that stage as follows

SetObjectiveDisplayed(20)Alias_HodsTable.getRef().AddItem(Alias_JameelsRemains.getRef())
User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Mon May 20, 2013 5:38 pm

First of all...

Deleting is very bad. If that end table is present in someone's save file and he tries to load it with your mod enabled, or if some other mod tries to edit that same end table, the game will crash. A better way to get rid of object references is to move them under the floor or flag them as "initially disabled".

Secondly, using the "create reference in" fill type will create the item as soon as the quest starts, so your extra quest script fragment isn't necessary.

Why isn't it working? Well, I can't say for sure, but check the order of your aliases in the alias tab; they are filled from top to bottom. The end table alias should be above the Jameel's Remains alias.

User avatar
Richard
 
Posts: 3371
Joined: Sat Oct 13, 2007 2:50 pm

Post » Mon May 20, 2013 10:29 pm

I didn't know that, thanks for your info.

It fixed itself for some odd reason, but here's my next question.

I added this script into the Item to pick up from the endtable to advance the quest to the next stage.

 Scriptname GetStolenChickenScript extends ObjectReference   Quest Property ChickenQuest  Auto   Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)if (ChickenQuest.GetStage() == 20) ChickenQuest.SetStage(30)endifEndEvent

This, however is not advancing the quest to the next stage even though it compiles fine. Am I using the wrong event?

User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am

Post » Tue May 21, 2013 2:28 am

Yes, use OnContainerChanged like so:

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)	if (newContainer == Game.GetPlayer())                if (ChickenQuest.GetStage() == 20)                        ChickenQuest.SetStage(30)                endif	endifEndEvent
Also, I recommend attaching the script to the item's alias rather than the base object, that way you have everything in one place. Additionally, you can forgo the ChickenQuest property and instead use the GetOwningQuest() function, like so:

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)	if (newContainer == Game.GetPlayer())                if (GetOwningQuest().GetStage() == 20)                        GetOwningQuest().SetStage(30)                endif	endifEndEvent
Try going through the quest design tutorial on the creation kit wiki; it helped me a lot.
User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am

Post » Mon May 20, 2013 8:11 pm

Ty so much i'll check out

User avatar
Sherry Speakman
 
Posts: 3487
Joined: Fri Oct 20, 2006 1:00 pm


Return to V - Skyrim