SirBeasty Posted April 12, 2018 Share Posted April 12, 2018 (edited) I have a few questions about scripting in papyrus and this being handled by a quest. First, I want to know how often a script may stop running if it is being told to loop until a requirement is met. I am trying to create a scripted quest that will add buffs to the player when they are doing certain things, like sneaking or fighting. The problem is, I am not sure how to have the quest wait until a requirement is fulfilled, where it will then provide a buff, without creating a while loop that runs until it is told to move onto the next stage.I looked at script fragments, but I believe that script fragments only run at the start of a quest stage and not at any other time. Second, I am having a problem with repeatable stages. Currently, I tell my script to update to a certain quest stage when the player picks up an item, and it should revert to a previous stage when the player drops the item, but this is not happening and is instead staying on the one stage. Third, I am having trouble getting reference aliases to work for the quests. Thank you for all your help. Edited April 12, 2018 by SirBeasty Link to comment Share on other sites More sharing options...
Rigmor Posted April 12, 2018 Share Posted April 12, 2018 Second, I am having a problem with repeatable stages. Currently, I tell my script to update to a certain quest stage when the player picks up an item, and it should revert to a previous stage when the player drops the item, but this is not happening and is instead staying on the one stage.You have to reset the quest on dropping the object and set the stage again to the one you want. I would make a new quest to handle this, so when he picks it up, you actvate the quest with the perk or buff, and if he drops it, you reset that quest to 0 (with nothing in the papyrus box, like shelving the buff. like turning a light switch on and off, without messing with your main quest.. It might sound a bit confusing, but going backwards and forwards on a single same quest, resetting, setstaging can get messy on loading and reloading saves. It does for me. Link to comment Share on other sites More sharing options...
SirBeasty Posted April 12, 2018 Author Share Posted April 12, 2018 I created a new quest, and I have gotten that one to start that will handle the other quest. However, the only way I could start the one quest was to attach the script to the bast object rather than the reference alias. I was wondering how to can attach it to the reference alias so that I can have the script inside the quest attached to the alias. Also, I cannot get the one quest to change the current quest stage of the other. This is the script attached to the handling quest: Scriptname SirBeastDaedricGemStartUp extends Quest ;------VariablesQuest Property DaedricGhostBoon Auto ;------Events Function DaedricGemBoonStartUp()DaedricGhostBoon.Start()DaedricGhostBoon.SetStage(130)EndFunction The function is then fired by a quest fragment. This script is attached to the object: Scriptname SirBeastDaedricGemScript extends ObjectReference ;----VariablesReferenceAlias Property XMarker Auto Actor Property Player Auto Quest Property DaedricGemStartUp Auto ;----Events Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) If(akNewContainer == Player)DaedricGemStartUp.SetStage(10)debug.trace("Item picked up and perk added.")EndIf EndEvent And this script is attached to the main quest. I will build the functions and fire them depending on which stage the quest is on: Scriptname SirBeastEviriBoonQuestScript extends Quest import utility ;--------Variables------MiscObject Property GhostGem Auto Actor Property Player Auto Quest Property EviriBoonQuest Auto Int Property EviriBoonStage AutoInt Property Random Auto Int Property coin Auto SPELL Property AttackBuff Auto SPELL Property DefenseBuff Auto SPELL Property ElementResist Auto SPELL Property CarryWeight Auto SPELL Property CombatBuff Auto SPELL Property CraftBuff Auto SPELL Property SpeechBuff Auto SPELL Property SpellBuff AutoSPELL Property TheftBuff Auto SPELL Property LastResort Auto SPELL Property VitalityBuff Auto SPELL Property ParalysisArea Auto ;----Events Function EviriBoonFunction()EviriBoonStage = EviriBoonQuest.getStage()if EviriBoonStage == 20debug.trace("Quest has started")coin = 1;While coin == 1 checkForCoin() ;EndWhileEndIfEndFunction function ControlFunction();utility.wait(3)random = utility.randomint(1, 5)if random == 1Debug.trace("Perk 1 was added")elseif random == 2Debug.trace("Perk 2 was added")elseif random == 3Debug.trace("Perk 3 was added")elseif random == 4Debug.trace("Perk 4 was added")elseif random == 5Debug.trace("Perk 5 was added")elseDebug.trace("No perk was added")EndIfEndFunction function CheckForCoin()if(Player.GetItemCount(GhostGem) == 0)coin = 0EndIfEndFunction function AddAttackBuffFunction()EndFunction function AddDefenseBuffFunction()EndFunction function AddElementResistFunction()EndFunction function AddCarryWeightFunction()EndFunction function AddCombatBuffFunction()EndFunction function AddCraftBuffFunction()EndFunction function AddSpeechBuffFunction()EndFunction function AddSpellBuffFunction()EndFunction function AddTheftBuffFunction()EndFunction function CastLastResortFunction()EndFunction function AddVitalityBuffFunction()EndFunction function CastParalysisAreaFunction()EndFunction Link to comment Share on other sites More sharing options...
SirBeasty Posted April 17, 2018 Author Share Posted April 17, 2018 (edited) Bump for all the other problems. Edited April 17, 2018 by SirBeasty Link to comment Share on other sites More sharing options...
Recommended Posts