ChewNTobacca Posted June 10, 2022 Author Share Posted June 10, 2022 Here we go. I've created the trigger box in the area of desire and attached the script "defaultSetStageTRIGSpecificActor" with the variables defined in the Activator. In the 'scripts' tab of the 'Quest' dialog, I have the following two scripts: Scriptname ClearpineQuest01Script extends Quest key property QuestKey auto {reference to Quest object} and ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 16 Scriptname QF_ClearpineQuest01_052B4AA3 Extends Quest Hidden ;BEGIN ALIAS PROPERTY QuestGiver ;ALIAS PROPERTY TYPE ReferenceAlias ReferenceAlias Property Alias_QuestGiver Auto ;END ALIAS PROPERTY ;BEGIN ALIAS PROPERTY MapMarker ;ALIAS PROPERTY TYPE ReferenceAlias ReferenceAlias Property Alias_MapMarker Auto ;END ALIAS PROPERTY ;BEGIN ALIAS PROPERTY ObjectContainer ;ALIAS PROPERTY TYPE ReferenceAlias ReferenceAlias Property Alias_ObjectContainer Auto ;END ALIAS PROPERTY ;BEGIN ALIAS PROPERTY Object ;ALIAS PROPERTY TYPE ReferenceAlias ReferenceAlias Property Alias_Object Auto ;END ALIAS PROPERTY ;BEGIN ALIAS PROPERTY ObjectLocation ;ALIAS PROPERTY TYPE LocationAlias LocationAlias Property Alias_ObjectLocation Auto ;END ALIAS PROPERTY ;BEGIN FRAGMENT Fragment_2 Function Fragment_2() ;BEGIN CODE ;key has been found, return to questgiver SetObjectiveCompleted(20, 1) SetObjectiveDisplayed(30, 1) ;END CODE EndFunction ;END FRAGMENT ;BEGIN FRAGMENT Fragment_0 Function Fragment_0() ;BEGIN AUTOCAST TYPE ClearpineQuest01Script Quest __temp = self as Quest ClearpineQuest01Script kmyQuest = __temp as ClearpineQuest01Script ;END AUTOCAST ;BEGIN CODE ;player has spoke to questgiver and is asked to retrieve key SetObjectiveCompleted(10, 1) SetObjectiveDisplayed(20, 1) Alias_MapMarker.GetRef().AddtoMap() ;END CODE EndFunction ;END FRAGMENT ;BEGIN FRAGMENT Fragment_14 Function Fragment_14() ;BEGIN CODE ;quest startup stage, player has discovered the cabin, now speak to questgiver SetObjectiveDisplayed(10, 1) ;END CODE EndFunction ;END FRAGMENT ;BEGIN FRAGMENT Fragment_4 Function Fragment_4() ;BEGIN CODE ;key has been returned and quest is complete SetObjectiveCompleted(30, 1) Stop() ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Obviously the first is the one I created to reference the key, and the second is the one created by the CK. I've double-triple-checked to be sure the properties are defined in the same aspect as the trigger script. Everything is functional and playable. I just want to add the detail of the probability that the player has found the key before locating the cabin or speaking to the quest giver (due to the nature, this would be likely). I want to add a check after the player has spoken to the quest giver NPC during stage 10 (at the same point where the map marker is placed), by using the following command: If Game.GetPlayer().GetItemCount(ClearpineCabinKey) >= 1 SetStage(20) EndIf and that's where I keep running into the same compiler error of the key being undefined: Starting 1 compile threads for 1 files... Compiling "QF_ClearpineQuest01_052B4AA3"... D:\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\QF_ClearpineQuest01_052B4AA3.psc(54,33): variable ClearpineCabinKey is undefined No output generated for QF_ClearpineQuest01_052B4AA3, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on QF_ClearpineQuest01_052B4AA3 Remains to be where I'm stuck, no matter what I try. Thanks again for trying to help. Link to comment Share on other sites More sharing options...
TyburnKetch Posted June 10, 2022 Share Posted June 10, 2022 I am struggling to understand your set up but i will give it a go. The issue i see is the defined property name of the key needs to be the same name as used in the itemcount function line. Currently I believe you have it called QuestKey as the property name but ClearpineCabinKey in your condition line, Also I believe the key property needs to be part of the quest fragment script as a reference alias, if it is not already. What is the alias_object property? Is it the key? If not add the key as a reference alias if you do not have it already. Link to comment Share on other sites More sharing options...
ChewNTobacca Posted June 10, 2022 Author Share Posted June 10, 2022 Thanks again for your reply. I apologize for making your brain hurt! I have tried both ways in the condition line, and different methods of setting up the properties and property names. But I will try again, since I forget exactly what I've done when. The key is set up in the fragment script posted above, as ReferenceAlias Property Alias_Object Auto and is defined in the quest aliases tab in CK to point to the key. Again the quest is fully playable, unless the player finds the key before the quest giver NPC. Which is why I'm trying to add the condition to check player's inventory. I will tinker with it some more and post the results. Link to comment Share on other sites More sharing options...
ChewNTobacca Posted June 12, 2022 Author Share Posted June 12, 2022 I did get the erroneous fragment to compile. I replaced this condition If Game.GetPlayer().GetItemCount(QuestKey) >= 1 SetStage(20) EndIf (and variations thereof) with this condition If Game.GetPlayer().GetItemCount(Alias_Object.GetReference()) >= 1 SetStage(20) EndIf and all was well. I think. However, during testing I unveiled another problem, which may be a whole different topic, unless there's an easy explanation... My trigger seems to be haywire. If I load up any of my 'clean' saves (before the plugin file was even created) and go right to the cell with the trigger, it works great and everything goes as planned. But after a short time of wandering around Tamriel, the trigger stops functioning. With or without this plugin active.For ease of testing, I disabled my plugin and did some exploring, cleared a few dungeons, etc. When I turn the plugin back on and load the later save, the trigger simply does not fire. Also, if I load the same clean save and do some things in-game, working my way to the trigger, it again does not fire when I get there. To be mores specific, I temorarily narrowed the options of location for the quest key (Alias_ObjectLocation) down to six dungeons. Then I disabled my plugin and went and cleared the remainder of the six and re-saved. Upon reactivating the plugin, the trigger doesn't fire. Link to comment Share on other sites More sharing options...
Recommended Posts