kesabelus Posted March 8, 2017 Share Posted March 8, 2017 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 More sharing options...
deadbeeftffn Posted March 8, 2017 Share Posted March 8, 2017 AFAIk it should be something like Event Quest.OnSetStage(...)Without "Quest" the function will only catch local events, but not remote events. Though i'm not sure if it is Quest, ReferenceAlias or anything else. You have to try... Link to comment Share on other sites More sharing options...
chucksteel Posted March 8, 2017 Share Posted March 8, 2017 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 More sharing options...
kesabelus Posted March 8, 2017 Author Share Posted March 8, 2017 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 questC:\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 More sharing options...
deadbeeftffn Posted March 9, 2017 Share Posted March 9, 2017 Try Event Quest.OnStageSet(Quest theQuest, int stageID, int auiItemID)For handling remote events, the first parameter must match the type of the calling script. Link to comment Share on other sites More sharing options...
kesabelus Posted March 9, 2017 Author Share Posted March 9, 2017 You have an excellent sense of timing. I was about to finalise my update, minus this script, but that worked like a charm. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts