Jump to content

Updating Quest when grabbing an item.


Roarian

Recommended Posts

So I've got 90%of this quest done - basically it's a branching quest in which you are asked to fetch one of two items (your choice) and depending on what you pick, you get a different reward - one geared towards destruction/conjuration mages, the other more towards restoration/illusion. (It's a College quest.)

 

I've got the two items all ready - base items are just basic stuff, and I've made Aliases for both on which I set a script to try and update the questlog. I can get the dialogue with the questgivers to work just fine, and if I consolecommand my way past this objective, the wrapup also functions as intended. The problem is in between : the items in question are automatically placed in appropriate dungeons via the Radiant system, and they show up just fine. Problem is, picking them up does nothing. The script I've been using is basically the one from the tutorial; I've tried a few others like OnItemAdded but none of them seem to actually work.

 

Does anyone have a basic scriptlet to use for picking up some predefined item and triggering a journal update? I must be doing something very simple wrong but clearly I'm missing it.

 

Thanks,

 

Jeron

Link to comment
Share on other sites

I'd expect something like this to work:

ScriptName SetStageOnPickup

Quest property QuestToUpdate auto
int property QuestStage auto

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)

if (akNewContainer == Game.GetPlayer())
	QuestToUpdate.SetStage(QuestStage)
endif

EndEvent

Note that the properties will need to be assigned in the editor. I've written this script for general use, so you can reuse it in a similar scenario if you ever need to.

 

What are you using currently?

 

Cipscis

Link to comment
Share on other sites

I'd expect something like this to work:

ScriptName SetStageOnPickup

Quest property QuestToUpdate auto
int property QuestStage auto

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)

if (akNewContainer == Game.GetPlayer())
	QuestToUpdate.SetStage(QuestStage)
endif

EndEvent

Note that the properties will need to be assigned in the editor. I've written this script for general use, so you can reuse it in a similar scenario if you ever need to.

 

What are you using currently?

 

Cipscis

 

Testing that now. I was trying to use the defaultscript for this purpose - for some reason it's not working, though. As I said, I have no clue if it's a bug on my end or just something I'm doing wrong. :P

Link to comment
Share on other sites

I'd expect something like this to work:

ScriptName SetStageOnPickup

Quest property QuestToUpdate auto
int property QuestStage auto

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)

if (akNewContainer == Game.GetPlayer())
	QuestToUpdate.SetStage(QuestStage)
endif

EndEvent

Note that the properties will need to be assigned in the editor. I've written this script for general use, so you can reuse it in a similar scenario if you ever need to.

 

What are you using currently?

 

Cipscis

 

Testing that now. I was trying to use the defaultscript for this purpose - for some reason it's not working, though. As I said, I have no clue if it's a bug on my end or just something I'm doing wrong. :P

 

Well, that's not working either. For no reason I can discern, the stage won't progress. I've checked with GetStage, it's still at 25 when it should be at 30. :confused:

Link to comment
Share on other sites

The properties have all been set up correctly, I assume? Try adding a Debug.Notification call in there to make sure the code is running.

 

Cipscis

 

Properties seem fine - the quest and the stage it should be set to. I put in some debug:notification prompts but they don't appear ingame. Evidently I'm still missing something.

 

It's great that these things happen now - when I still haven't gotten a huge pile of stuff. If it works now, I can just reuse the code for any similar quest in the future. :P

Link to comment
Share on other sites

Hmm, the script is definitely attached to the object that the player needs to pick up, right?

 

Cipscis

 

Yup, the script is attached to the quest item - base item being a misc scroll with an alias that makes it a quest object and also has the script. The marker points to it just fine, but when picking it up it just stays there. Script isn't run, evidently. I have no idea what I'm doing wrong.

Edited by Roarian
Link to comment
Share on other sites

  • Recently Browsing   0 members

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