Jump to content

Recommended Posts

Posted

I've been working on a mod that toggles all quest essential items so they can be dropped (here), and I've managed to hunt down most of the items and untick "quest item".

 

What I would like to do is use some scripts to set it so that when you remove the item from your inventory, it removes the quest from your list, and the reverse; where grabbing the item restarts the quest where it should be.

Here is the script I've been trying to use:

 

Scriptname DroppablePelagiusHipbone extends ObjectReference

Event OnContainerChanged(ObjectReference NewContainer, ObjectReference OldContainer)
if FromQuest.GetStage() < StageToStopQuestItem ; Are we a quest item at the current stage?
	if OldContainer == Game.GetPlayer()
		FromQuest.SetActive(false)
	elseif NewContainer == Game.GetPlayer()
		FromQuest.SetActive(true)
		FromQuest.SetObjectiveDisplayed(ObjectiveToDisplayOnPickup,True,True)
		if StageToSetOnPickup >= 0
			FromQuest.SetStage(StageToSetOnPickup)
		endif
	endif
else ; Nope, we're not a quest item at this stage.

endif
EndEvent

Quest Property FromQuest  DA15
Int Property StageToStopQuestItem = 99999 Auto
Int Property StageToSetOnPickup = -1 20
Int Property ObjectiveToDisplayOnPickup 10

 

I've been using Pelagius' Hipbone to experiment, and I'm using a modified version of the quest-item script I found here, but it currently doesn't do anything at all. My scripting experience is limited to a smattering of C# and javascript, and I'm fresh to papyrus (although I understand the syntax well enough), so any help would get me along nicely.

 

Bonus Question: if you know a way to search for aliases in the creation kit outside of their owners please tell me!

Posted
Now, why on earth would you do that in a hardcoded manner? If I were you I'd search for the quest item keyword and make the item containing the word droppable. That way it'll be compatible with any mod.
Posted (edited)

Now, why on earth would you do that in a hardcoded manner? If I were you I'd search for the quest item keyword and make the item containing the word droppable. That way it'll be compatible with any mod.

 

Some items only seem to be marked as a Quest Item in the aliases of the quests they're in, like pelagius' hipbone for instance. Unless I'm missing something? I need items to toggle the visibility of their related quests on drop and pickup

 

For clarity: I've already manually toggled every quest item I could find, which shouldn't interfere with other mods

Edited by h0rsel0ver
Posted (edited)

Your script won't compile. Here's a corrected version.

 

Scriptname DroppablePelagiusHipbone extends ObjectReference

Event OnContainerChanged(ObjectReference NewContainer, ObjectReference OldContainer)
       if FromQuest.GetStage() < StageToStopQuestItem ; Are we a quest item at the current stage?
               if OldContainer == Game.GetPlayer()
                       FromQuest.SetActive(false)
               elseif NewContainer == Game.GetPlayer()
                       FromQuest.SetActive(true)
                       FromQuest.SetObjectiveDisplayed(ObjectiveToDisplayOnPickup,True,True)
                       if StageToSetOnPickup >= 0
                               FromQuest.SetStage(StageToSetOnPickup)
                       endif
               endif
       else ; Nope, we're not a quest item at this stage.

       endif
EndEvent

Quest Property FromQuest  auto
Int Property StageToStopQuestItem = 99999 Auto
Int Property StageToSetOnPickup = -1 auto
Int Property ObjectiveToDisplayOnPickup = 10 auto

 

Compiles, but whether it works ingame is another matter.

You'll need to use the Properties button to assign a quest to "FromQuest".

Edited by steve40
Posted (edited)

Thank you very much steve40

What I've gleaned looking at yours is that the "auto"s have to stay at the end of each property line, and that those properties are set manually in CC? I'll play around a bit and see what I've missed

 

Edit: Well it compiles, and I've learned a bit more about papyrus, but it doesn't do what I want it to, so if anyone else has experience with quest scripting please chime in. I feel like I'm missing something simple

Edited by h0rsel0ver
  • Recently Browsing   0 members

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