Jump to content

Scripting Help


On963

Recommended Posts

Does anyone know What I am doing Wrong.

 

Script

===============================================================

Scriptname Enclavequest001 extends ObjectReference Const
Quest Property Enclave001 auto const
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if akNewContainer == Game.GetPlayer() Enclave001.SetStage(20)
endIf
endEvent
===============================================================
Output
===============================================================
Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "Enclavequest001"...
C:\Users\On963\AppData\Local\Temp\PapyrusTemp\Enclavequest001.psc(6,38): required (...)+ loop did not match anything at input 'Enclave001'
No output generated for Enclavequest001, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.

===============================================================

Link to comment
Share on other sites

I think each statement needs to be on its own line.

Scriptname Enclavequest001 extends ObjectReference Const

Quest Property Enclave001 Auto Const Mandatory

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
    if (Game.GetPlayer() == akNewContainer)
        Enclave001.SetStage(20)
    endIf
endEvent
Link to comment
Share on other sites

Your comparing a container (akNewcontainer) to a quest stage (Enclave001). If you want to set a stage when an item changes containers then you shoud compare the akNewContainer with a Objectreference property for your container.

For example:

ObjectReference Property YourContainer Auto
Quest Property Enclave001 Auto
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
    If akNewContianer == YourContainer
        Enclave001.SetStage(20)
    EndIf
EndEvent
Edit: Scrivener07's script will also work if you want to set the stage when the item gets moved to the players inventory.
Link to comment
Share on other sites

Game.GetPlayer() is fine in every situation where you would only call it once, like all the Getxxx functions out there, including GetReference() (by assigning it to ObjectReference or Actor, depending on the type), but even then there is a way to efficiently use that by assigning it to an actor variable and using that variable throughout. But yeah, it's exactly 1000 times slower than the actor property.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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