pxd2050 Posted February 12, 2021 Share Posted February 12, 2021 ScriptName outfit__020012CB Extends ObjectReference ;;;this is a bastardisation of two separate scripts put together to reduce the number of esps I have to make;;; Event OnLoad() GoToState("BathStrip") EndEvent State BathStrip Event OnTriggerEnter(ObjectReference triggerRef) If (triggerRef as Actor) (GetOwningQuest() as outfit__MainQuest).Strip(triggerRef) EndIf EndEvent Event OnTriggerLeave(ObjectReference triggerRef) If (triggerRef as Actor) (GetOwningQuest() as outfit__MainQuest).UnStrip(triggerRef) EndIf EndEvent EndState Starting 1 compile threads for 1 files... Compiling "outfit__020012CB"... C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(11,4): GetOwningQuest is not a function or does not exist C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(11,21): cannot cast a none to a outfit__mainquest, types are incompatible C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(11,43): type mismatch on parameter 1 (did you forget a cast?) C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(17,4): GetOwningQuest is not a function or does not exist C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(17,21): cannot cast a none to a outfit__mainquest, types are incompatible C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(17,43): type mismatch on parameter 1 (did you forget a cast?) No output generated for outfit__020012CB, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on outfit__020012CB help How to call the function of quest? Link to comment Share on other sites More sharing options...
dylbill Posted February 12, 2021 Share Posted February 12, 2021 I don't think you can use GetOwningQuest on an objectreference script. Instead, make the quest script a property directly. outfit__MainQuest Property OutfitScript Auto ;choose the quest that the outfit__MainQuest is attached to when filling in the creation kit. ;;;this is a bastardisation of two separate scripts put together to reduce the number of esps I have to make;;; Event OnLoad() GoToState("BathStrip") EndEvent State BathStrip Event OnTriggerEnter(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.Strip(triggerRef) EndIf EndEvent Event OnTriggerLeave(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.UnStrip(triggerRef) EndIf EndEvent EndState Link to comment Share on other sites More sharing options...
dylbill Posted February 12, 2021 Share Posted February 12, 2021 Or, if the quest is in another esp that you're trying to reference, you can use GetFormFromFile: https://www.creationkit.com/index.php?title=GetFormFromFile_-_Game Link to comment Share on other sites More sharing options...
pxd2050 Posted February 12, 2021 Author Share Posted February 12, 2021 I don't think you can use GetOwningQuest on an objectreference script. Instead, make the quest script a property directly. outfit__MainQuest Property OutfitScript Auto ;choose the quest that the outfit__MainQuest is attached to when filling in the creation kit. ;;;this is a bastardisation of two separate scripts put together to reduce the number of esps I have to make;;; Event OnLoad() GoToState("BathStrip") EndEvent State BathStrip Event OnTriggerEnter(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.Strip(triggerRef) EndIf EndEvent Event OnTriggerLeave(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.UnStrip(triggerRef) EndIf EndEvent EndStatethank you for your replyI try,but don't work Starting 1 compile threads for 1 files...Compiling "outfit__020012CB"...C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(13,16): type mismatch on parameter 1 (did you forget a cast?)C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(19,16): type mismatch on parameter 1 (did you forget a cast?)No output generated for outfit__020012CB, compilation failed. Link to comment Share on other sites More sharing options...
pxd2050 Posted February 12, 2021 Author Share Posted February 12, 2021 I don't think you can use GetOwningQuest on an objectreference script. Instead, make the quest script a property directly. outfit__MainQuest Property OutfitScript Auto ;choose the quest that the outfit__MainQuest is attached to when filling in the creation kit. ;;;this is a bastardisation of two separate scripts put together to reduce the number of esps I have to make;;; Event OnLoad() GoToState("BathStrip") EndEvent State BathStrip Event OnTriggerEnter(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.Strip(triggerRef) EndIf EndEvent Event OnTriggerLeave(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.UnStrip(triggerRef) EndIf EndEvent EndStatethank you for your replyI try,but don't work Starting 1 compile threads for 1 files...Compiling "outfit__020012CB"...C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(13,16): type mismatch on parameter 1 (did you forget a cast?)C:\SkyrimSE\Data\Source\Scripts\outfit__020012CB.psc(19,16): type mismatch on parameter 1 (did you forget a cast?)No output generated for outfit__020012CB, compilation failed. I change " triggerRef as Actor" State BathStrip Event OnTriggerEnter(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.Strip(triggerRef as Actor) EndIf EndEvent Event OnTriggerLeave(ObjectReference triggerRef) If (triggerRef as Actor) OutfitScript.UnStrip(triggerRef as Actor) EndIf EndEvent EndState It workThank you very much Link to comment Share on other sites More sharing options...
dylbill Posted February 12, 2021 Share Posted February 12, 2021 No problem :) Link to comment Share on other sites More sharing options...
Recommended Posts