I haven't looked at quests much, but here it goes.
Can't you do the inverse, instead of attaching a script to some dragons, just let the quest-script or quest-fragment-scripts handle it?
Give the quest either some Actor properties or even simpler (and more flexible) a FormList which you populate with Actors, and operate on that.
I don't see any reason why each dragon has to disallow itself every 5 seconds to fly. Especially since it can't fly to begin with - see OnInit.
Also like RandomNoob already mentioned, every RegisterForAnything call should have an corresponding UnregisterForAnything call. I mean do know when the OnUpdate event won't be executed anymore?
Rant-ish: I know that Papyrus is case-insensitive (which I really hate), but registerforupdatefunction, ignoring that this function is completely useless and adds no value at all, its just ugly...
Well, about the unregisterforupdate(). This script is still a WIP. I knew I needed to add one, I just havn't done it yet. I just don't understand why a simple If statement isn't working. It's annoying me like crazy.
I tweaked the code... still doesn't work as intended, but so we're on the same page:
Scriptname MOD1NODRAGONFLIGHT extends Actor{Aazahzidbormah}Function registerforupdatefunction() registerForUpdate(5)endFunctionint groundcount = 0Event OnInit() registerforupdate(5) self.SetAllowFlying(false);endEventEvent OnUpdate()If (MOD1QPart1.GetStage() <= 32) if (groundcount < 7) groundcount = groundcount + 1; debug.Notification("IF Code Executed"); debug.Notification(groundcount); else MOD1QPart1.SetStage(33) debug.messagebox("ELSE Condition has been run") endif elseif (MOD1QPart1.GetStage() == 33); self.SetAllowFlying(true); self.EvaluatePackage(); debug.MessageBox("MOD1QPart1 stage 33. Aazahzidbormah in the air") unregisterforupdate();endifendEventActor Property MOD1Dragon1Aaz Auto Quest Property MOD1QPart1 AutoAlso, I should probably let you guys know that this script is kinda messy because it's a prototype. I'm trying to figure out exactly what I'm doing before I write the final script in clean fashion.
But alas, the problem remains. I have isolated it though. The "else" in the nested "if" statement works; however, for some reason "MOD1QPart1.SetStage(33)" isn't working, even though I have the property classified properly, and spelled properly.
P.S. With the case-sensitive thing, I understand. I have programmed and scripted MINOR things and a little bit on and off over many years. Sometimes I code very in a very specific form, but when I have a language like papyrus, I get lazy... That's why my C++ compiler hates me. I may get a set form and keep the ; at the end of my lines, so I don't forget 100 of them when I switch back to c++. Also, the reason for the function. I didn't want to have to cancel my register for update in the same event, as I am scripting an entire combat sequence, and I need my canceling timing to be as flexable as possible.