Jump to content

Quest marker no longer works after setting enable


Recommended Posts

I'm fairly new to scripting so I apologise if this is basic.

 

I have an npc that you have to go talk to, and he has a marker set to show you where he is. It was working fine, as expected. I then changed him to disabled by default as I only want him to exist once the quest starts. I then added an extra stage in-between the start of the quest and when he spawns just to ensure that he definitely exists before the stage where the marker appears.

 

I tested it and he does enable as intended and everything works except his quest marker no longer works, even though I made sure to take extra precautions to ensure he exists when the marker does.

 

 

I'm wondering maybe I need to set a condition on the marker?

 

 

 

I've also included the code for when he spawns and the quest

Scriptname LegateSerelliusPropertyScript extends ObjectReference  

Quest Property MyQuest  Auto

Int Property MyStage Auto

Auto State Initial   ;starts when the mod gets initialized

Event OnCellAttach()

  if (MyQuest.GetStage() >= MyStage)

    Self.Enable()

    GoToState("DONE")

  endif

EndEvent

EndState


MyQuest is set to the quest he's linked too and MyStage is 15, this is the fragment for stage 15.

;Spawns the Legate

Debug.Notification("Quest at Stage 15")

Debug.Notification("Legate Serellius now exists")

SetObjectiveCompleted(10)

Debug.Notification("Objective 10 completed")

SetStage(20)

Debug.Notification("Set stage to stage 20")



Stage 20 is when the marker should show up

Any ideas?

 

Edited by CrimsonLeader89
Link to comment
Share on other sites

Firstly, I wouldn't bother with a script to enable him other than a papyrus fragment in the quest.

 

Put him in as you've done and set him to initially disabled then. In the quest his alias must be flagged as 'Allow Disabled', or else the alias won't fill. Then in the appropriate quest stage, simply add these lines into the papyrus fragment for that stage:

 

Alias_LegateSeptimusSerellius.TryToEnable()

SetObjectiveDisplayed(20)

 

That will then enable him and the quest marker should appear. If it doesn't, add a set stage line or use a Utility.Wait(#) inbetween those 2 lines to allow the game time to enable him before asking it to display the objective. # is the time to wait before setting the objective to be displayed. 0.1 to 0.5 seconds should do.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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