javaplaza Posted September 23, 2019 Share Posted September 23, 2019 (edited) actor property targetNPC auto quest property myQuest auto int property myStage auto spell property SPELL001 auto spell property SPELL002 auto spell property SPELL003 auto Event OnSpellCast(Form akSpell) Spell spellCast = akSpell as Spell if spellCast && spellCast == SPELL001 debug.messagebox("Success!") myQuest.setStage(myStage) Utility.Wait(0.2) targetNPC.ForceActorValue("Aggression", 0) targetNPC.StopCombat() endIf if spellCast && spellCast == SPELL002 debug.messagebox("Success!") myQuest.setStage(myStage) Utility.Wait(0.2) targetNPC.ForceActorValue("Aggression", 0) targetNPC.StopCombat() endIf if spellCast && spellCast == SPELL003 debug.messagebox("Success!") myQuest.setStage(myStage) Utility.Wait(0.2) targetNPC.ForceActorValue("Aggression", 0) targetNPC.StopCombat() endIf endEvent Ive got a quest that requires the player to perform a higher level spell to advance to the next quest stage. Similar to gaining entry to the college of winterhold, but from a list of master level spells only. Here is the script,attached to the Alias (which is at the top of the alias list) Specific Reference : 'PlayerRef' But its not firing. Ive tried 2 of the spells from the list. (Icy Spear, and Unrelenting Force) Any help would be really amazing. I'm not sure where I've gone wrong - thanks. Edited September 23, 2019 by javaplaza Link to comment Share on other sites More sharing options...
javaplaza Posted September 23, 2019 Author Share Posted September 23, 2019 edit ; the list is actually much longer but i chose to edit it down to 3 spells for the sake of the post. Link to comment Share on other sites More sharing options...
foamyesque Posted September 24, 2019 Share Posted September 24, 2019 What is the *full* text of the script, including the scriptname & extends piece? Are the properties filled and filled with the correct spells? Link to comment Share on other sites More sharing options...
javaplaza Posted September 24, 2019 Author Share Posted September 24, 2019 yes all the properties are filled correctly. Scriptname DFLTOSpellChecker extends ReferenceAliasactor property targetNPC autoquest property myQuest autoint property myStage autospell property SPELL001 autospell property SPELL002 autospell property SPELL003 autospell property SPELL004 autospell property SPELL005 autospell property SPELL006 autospell property SPELL007 autospell property SPELL008 autospell property SPELL009 autospell property SPELL010 autospell property SPELL011 autospell property SPELL012 autospell property SPELL013 autospell property SPELL014 autospell property SPELL015 autospell property SPELL016 autospell property SPELL017 autospell property SPELL018 autospell property SPELL019 autospell property SPELL020 autospell property SPELL021 autospell property SPELL022 autospell property SPELL023 autospell property SPELL024 autospell property SPELL025 autospell property SPELL026 autospell property SPELL027 autospell property SPELL028 autospell property SPELL029 autospell property SPELL030 autospell property SPELL031 autospell property SPELL032 autospell property SPELL033 autospell property SPELL034 autospell property SPELL035 autospell property SPELL036 autospell property SPELL037 autospell property SPELL038 autospell property SPELL039 autospell property SPELL040 autoEvent OnSpellCast(Form akSpell)Spell spellCast = akSpell as Spell;shoutif spellCast && spellCast == SPELL040debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIf;destructionif spellCast && spellCast == SPELL001debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL002debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL003debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL004debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL005debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL006debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL007debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL008debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL009debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIf;illusionif spellCast && spellCast == SPELL010debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL011debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL012debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL013debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL014debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL015debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL016debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIf;resorationif spellCast && spellCast == SPELL017debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL018debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL019debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL020debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL021debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL022debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIf;conjurationif spellCast && spellCast == SPELL023debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL024debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL025debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL026debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL027debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL028debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL029debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL030debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL031debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL032debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL033debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIf;alterationif spellCast && spellCast == SPELL034debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL035debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL036debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL037debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL038debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIfif spellCast && spellCast == SPELL039debug.messagebox("Success!")myQuest.setStage(myStage)Utility.Wait(0.2)targetNPC.ForceActorValue("Aggression", 0)targetNPC.StopCombat()endIf endEvent Link to comment Share on other sites More sharing options...
foamyesque Posted September 24, 2019 Share Posted September 24, 2019 Have you tried using the sqv console command to check the quest's status and make sure that the quest is started and the aliases filled correctly? Link to comment Share on other sites More sharing options...
javaplaza Posted September 24, 2019 Author Share Posted September 24, 2019 (edited) i have! the quest functions, ive been working it for a few months now. So yes, its started. When I shout / use one of those spells, I don't get a message box and i also check the stage in console before quitting the game when testing. Edited September 24, 2019 by javaplaza Link to comment Share on other sites More sharing options...
javaplaza Posted September 24, 2019 Author Share Posted September 24, 2019 are you saying the script looks fine? :huh: Link to comment Share on other sites More sharing options...
foamyesque Posted September 24, 2019 Share Posted September 24, 2019 are you saying the script looks fine? :huh: Yes, the code looks like it should execute. Albeit it's wordy; I'd stick the spells in a FormList, use HasForm on that FormList, and then have just one if statement. Alternatively, if you want the explicit list in the properties instead (I don't think it's good practice, but whatever), I'd bundle the repeated debug.messagebox("Success!") myQuest.setStage(myStage) Utility.Wait(0.2) targetNPC.ForceActorValue("Aggression", 0) targetNPC.StopCombat() Into a function, and then call that from the if blocks. Means you can change the behaviour of all of them at once by editing the code in just one place, which improves debugging reliability and code comprehension. Have you tried putting in a debug notification call before the if blocks in OnSpellCast()? Something like Debug.Notification("Casting spell..."), just to see if the event fires at all? Link to comment Share on other sites More sharing options...
javaplaza Posted September 24, 2019 Author Share Posted September 24, 2019 Yes, the code looks like it should execute. Albeit it's wordy; I'd stick the spells in a FormList, use HasForm on that FormList, and then have just one if statement. Alternatively, if you want the explicit list in the properties instead (I don't think it's good practice, but whatever), I'd bundle the repeated i dont know what that would look like, but i sure would love to try it out! Have you tried putting in a debug notification call before the if blocks in OnSpellCast()? Something like Debug.Notification("Casting spell..."), just to see if the event fires at all? i have not - and thats a great idea. I'll test it as soon as I'm home in a few minutes. Link to comment Share on other sites More sharing options...
javaplaza Posted September 24, 2019 Author Share Posted September 24, 2019 also i havent mentioned i need this to have an if statement to make sure im on a certain quest stage. i dont want to mess with spellcast && spellcast... where would i add that? Link to comment Share on other sites More sharing options...
Recommended Posts