Jump to content

How to call the function of quest in script?


pxd2050

Recommended Posts


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

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

 

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

thank you for your reply

I 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

 

 

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

thank you for your reply

I 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 work

Thank you very much

Link to comment
Share on other sites

  • Recently Browsing   0 members

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