Jump to content

Recommended Posts

Posted

Good morning everybody!

 

I was trying to use a script that sets a quest to a stage when another quest reaches a certain stage.

But it won't compile ...

The script is attached to the quest that should be set, if that makes a difference ...

 

This is the error that the compiler gives me:

Compiling "NRHQ_SetQuestStageOnOtherQuestStage"...
C:\Users\XXXXX\AppData\Local\Temp\PapyrusTemp\NRHQ_SetQuestStageOnOtherQuestStage.psc(17,22): no viable alternative at input '('
No output generated for NRHQ_SetQuestStageOnOtherQuestStage, compilation failed.

Like almost every time, the compiler error isn't really helpful ...

 

Here is the script:

Scriptname NRHQ_SetQuestStageOnOtherQuestStage extends Quest
{Sets the quest stage of a quest to a certain value when a different quest reaches a certain stage.}

Quest Property QuestToSet Auto
{The quest that whill get setstage'ed}

Int Property StageToSet Auto
{The stage to set the queststage to}

Quest Property QuestToCheck Auto
{The quest to check the stage of}

Int Property QuestStageToCheckFor Auto
{The stage nr to check for}


RegisterForRemoteEvent(MyQuest, "OnSetStage")


Event Quest.OnStageSet(Quest  akSender, int auiStageID, int auiItemID)
   If (akSender == QuestToCheck) && (auiStageID == QuestStageToCheckFor)
      Self.UnRegisterForRemoteEvent(QuestToCheck, "OnStageSet")
      QuestToSet.setstage(StageToSet);
   Endif
EndEvent

I have read on the CK wiki that something like this won't compile:

RegisterForRemoteEvent(MyQuest, "OnDeath")

That makes sense, because a quest can't "die" ....

But using "OnSetStage" should work, right?

 

I am confused ....

 

Posted (edited)

Can't call a function like this, needs to be inside of another function or event.

 

That's a quest script so I would suggest using OnQuestInit:

Event OnQuestInit()
    RegisterForRemoteEvent(QuestToCheck, "OnSetStage")
EndEvent
Edited by DieFeM
Posted (edited)
  On 1/25/2021 at 4:12 AM, DieFeM said:

 

Can't call a function like this, needs to be inside of another function or event.

 

That's a quest script so I would suggest using OnQuestInit:

Event OnQuestInit()
    RegisterForRemoteEvent(QuestToCheck, "OnSetStage")
EndEvent

Yeah, but then it will only check it once (when the quest that the scirpt is attached to gets loaded).

 

I want it to "trigger" immediatley when the "quest that should be checked" reaches the specified stage.

 

 

EDIT:

 

Nevermind, only the "register for event" will be done once, so it is all good!

That is just telling the game "hey, you need to look out for this!"

And that only needs to happen once, like you said ...

Edited by YouDoNotKnowMyName
Posted
  On 1/25/2021 at 4:38 AM, YouDoNotKnowMyName said:

I still get this:

OntStageSet is not an event on quest or one if its parents

Oh ....

I just re read this post and noticed I misspelled it ....

 

I feel stupid now ...

  • Recently Browsing   0 members

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