Jump to content

Trouble Enabling an Object


Recommended Posts

Hey everyone, I'd like a holotape to enable after a quest stage has been set. Normally I'd just use a quest fragment at the stage I want, but the stage in question is from a vanilla quest and I don't want to mess with vanilla quests unless I have to. So I attached this script to my custom quest:

Scriptname HolotapeSpawnScript extends Quest

Quest Property MQ102 Auto Const

ReferenceAlias Property HolotapeAlias Auto Const

Function Startup()
	If (MQ102.GetStageDone(50) == 1)
		HolotapeAlias.GetRef().Enable()
	Else 
		RegisterForRemoteEvent(MQ102, "OnStageSet")
	EndIf
EndFunction

Event OnStageSet(int stageID, int auiItemID)
	If (stageID == 50)
		HolotapeAlias.GetRef().Enable()
		UnRegisterForRemoteEvent(MQ102, "OnStageSet")
	EndIf
EndEvent

It compiles just fine, but only the first part works. If I load a save that's already reached stage 50 of MQ102, the holotape spawns. If I load a save before stage 50 and play through that stage, nothing happens.

 

Anyone know what's going on? Or an alternative way to get this to work?

Link to comment
Share on other sites

In my Gnomepocolypse mod I use GetStageDone checks to check on vanilla quests and I have ran into the same problem. To get around this issue I also place triggers that also check the quest stage.

 

when the game loads my quest checks the vanilla quest and if the condition is met a message displays and objects get enabled. (My trigger gets disabled) If the vanilla quests stages have not been met then the trigger is in place so when the player does finish the quests stage they can then hit the trigger that checks the stage again and enables my objects and starts my quests.

 

This may be kind of a hacky workaround but, I'm not a good scripter and this was the easiest way for me to make things work the way I wanted.

 

if you use this method remember to make sure your trigger disables itself or the player may get spammed, I made this mistake, my trigger displays a pop-up message and wasn't disabling itself so every time the player hit the trigger they got another message.

Link to comment
Share on other sites

Thank you both for your answers. I quickly tried

Event Quest.OnStageSet(int stageID, int auiItemID)

but when compiling it had these errors:

 

C:\Users\Ellaine\AppData\Local\Temp\PapyrusTemp\NateHolotapeSpawnScript.psc(17,0): First parameter must match the object type the event is coming from, which is quest
C:\Users\Ellaine\AppData\Local\Temp\PapyrusTemp\NateHolotapeSpawnScript.psc(17,0): the parameter types of function quest.onstageset in the empty state on script nateholotapespawnscript do not match the original script quest

Link to comment
Share on other sites

  • Recently Browsing   0 members

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