I can't get this quest to start!

Post » Sat Nov 17, 2012 3:34 am

I cannot get this quest to start for the life of me. I'm calling it from another script using the command PlayerVampireNeedsQuest(start)

Is there anything in the script here that would shut it off or make it not run? I can't get a single debug message to fire. It was working, I commented out a couple lines so I could play a non vampire character for a while, as it seemed to be starting up on its own before and working fine. I got back to my vampire character to work on unholy darkness and now I can't get this damn thing to work. Am I missing something obvious?

I even added a stage 10, (never had one before), and set priortity to 50, had no priority before and it ran fine. I can't figure out why it won't poll and do anything.

Scriptname PlayerVampireNeedsQuestScript  extends QuestFloat Property LastCoffinSleepTime AutoFloat Property HowLongWithoutCoffinSleep AutoFloat Property CurrentGameTime AutoGlobalVariable Property GameDaysPassed AutoInt DoOnceSpell Property VampireCoffinSleepBonus AutoSpell Property VampireCoffinDeprivation01 AutoSpell Property VampireCoffinDeprivation02 AutoSpell Property VampireCoffinDeprivation03 AutoSpell Property VampireCoffinDeprivation04 AutoFaction Property VampirePCRankFaction AutoPlayerVampireQuestScript Property PlayerVampireQuest  Auto  Event OnInit()    if game.GetPlayer().GetFactionRank(VampirePCRankFaction) <0        debug.messagebox("player rank less than 0, screwing the entire needs quest")        unregisterforupdate()debug.notification("oninit from needs failed to register for updates because the vampire rank svcks")    else    RegisterForSingleUpdate(0.1);commented out to stop this [censored] from running when starting a new character, for now.    debug.notification("oninit from needs quest fired") RegisterForSleep()    endifEndEvent Event OnUpdate()    RegisterForSingleUpdate(15);this is definitely seconds;commented out to stop from running on new char    CurrentGameTime = (GameDaysPassed.GetValue() * 24) ;Convert Days into Hours.    HowLongWithoutCoffinSleep = (LastCoffinSleepTime - CurrentGameTime) * -1    debug.notification("HowLongWithoutCoffinSleep is " +HowLongWithoutCoffinSleep)    if HowLongWithoutCoffinSleep >= (64 * (game.GetPlayer().GetFactionRank(VampirePCRankFaction) + 1) * 0.5)        AddCoffinWeakness04()    elseif HowLongWithoutCoffinSleep >= (48 * (game.GetPlayer().GetFactionRank(VampirePCRankFaction) + 1) * 0.5)        AddCoffinWeakness03()    elseif HowLongWithoutCoffinSleep >= (32 * (game.GetPlayer().GetFactionRank(VampirePCRankFaction) + 1) * 0.5)        AddCoffinWeakness02()    elseif HowLongWithoutCoffinSleep >= (16 * (game.GetPlayer().GetFactionRank(VampirePCRankFaction) + 1) * 0.5)        AddCoffinWeakness01()    elseif HowLongWithoutCoffinSleep >= (14 * (game.GetPlayer().GetFactionRank(VampirePCRankFaction) + 1) * 0.5) && DoOnce == 0        debug.Notification("You begin to yearn for your coffin.")        DoOnce = 1    endif    If PlayerVampireQuest.Feedcount < 10 && (CurrentGameTime >6 && CurrentGameTime <16)        Debug.notification("you feel compelled to sleep");todo add a paralyze function here    Endif    ;debug.notification("coffin sleep math works out to "+(game.GetPlayer().GetFactionRank(VampirePCRankFaction) + 1) * 0.5)EndEventEvent OnSleepStop(bool abInterrupted)    if abInterrupted        LastCoffinSleepTime =  (GameDaysPassed.GetValue() * 24)        ;debug.notification("the player was woken abnormally, and LastCoffinSleepTime is " +LastCoffinSleepTime)        AddCoffinSleepBonus();commented out until I can get a proper vampire check    else        LastCoffinSleepTime =  (GameDaysPassed.GetValue() * 24);todo add some kind of thing that makes you have to sleep to subtract coffin deprivation        ;debug.notification("the player woke normally, and LastCoffinSleepTime is " +LastCoffinSleepTime)        AddCoffinSleepBonus();commented out until I can get a proper vampire check    endIfendEventFunction AddCoffinWeakness01()    debug.notification("adding coffin weakness")    Game.GetPlayer().AddSpell (VampireCoffinDeprivation01)EndFunctionFunction AddCoffinWeakness02()    debug.notification("adding coffin weakness")    Game.GetPlayer().RemoveSpell (VampireCoffinDeprivation01)    Game.GetPlayer().AddSpell (VampireCoffinDeprivation02)EndFunctionFunction AddCoffinWeakness03()    debug.notification("adding coffin weakness")    Game.GetPlayer().RemoveSpell (VampireCoffinDeprivation02)    Game.GetPlayer().AddSpell (VampireCoffinDeprivation03)EndFunctionFunction AddCoffinWeakness04()    debug.notification("adding coffin weakness")    Game.GetPlayer().RemoveSpell (VampireCoffinDeprivation03)    Game.GetPlayer().AddSpell (VampireCoffinDeprivation04)EndFunctionFunction AddCoffinSleepBonus()    Game.GetPlayer().RemoveSpell (VampireCoffinDeprivation01)    Game.GetPlayer().RemoveSpell (VampireCoffinDeprivation02)    Game.GetPlayer().RemoveSpell (VampireCoffinDeprivation03)    Game.GetPlayer().RemoveSpell (VampireCoffinDeprivation04)    ;Game.GetPlayer().addSpell (VampireCoffinSleepBonus)    Game.GetPlayer().removeSpell (VampireCoffinSleepBonus);did this for temp fix to get rid of bonus on humans    DoOnce = 0EndFunction
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Fri Nov 16, 2012 8:40 pm

Mole, do you mean you are using:

PlayerVampireNeedsQuest.Start()
?


I can't see anything obviously out of whack with your script (though I find them difficult to read, if I haven't written them ;))
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am

Post » Sat Nov 17, 2012 6:05 am

Mole, do you mean you are using:

PlayerVampireNeedsQuest.Start()
?


I can't see anything obviously out of whack with your script (though I find them difficult to read, if I haven't written them :wink:)
Oh yeah, sorry... that is a typo, or more or less a brain fart when I typed it in. I checked the other script and it is calling it with this: PlayerVampireNeedsQuest.start()

Its like for some reason the registerForSingleUpdate isn't working, or there is something maybe wrong with my quest to where it's not running in the background. I guess I'll try IsRunning to see if the quest is running or not.
User avatar
Hannah Whitlock
 
Posts: 3485
Joined: Sat Oct 07, 2006 12:21 am

Post » Sat Nov 17, 2012 11:53 am

Ok I figured it out. Apparently OnInit only works if the quest is STOPPED and then RESTARTED. Loading the game does not call OnInit. So this quest was somehow already running the whole time, but since I had commented out the registerforupdates it wasn't really doing anything, and uncommenting them didn't work because the onINit wasn't firing due to the quest running.
User avatar
Roberto Gaeta
 
Posts: 3451
Joined: Tue Nov 06, 2007 2:23 am

Post » Fri Nov 16, 2012 8:59 pm

Yeah, I keep thinking OnInit is a game-start thing. It's not, it's a thing-starting thing.

Glad you solved it, mole :)
User avatar
Alexandra walker
 
Posts: 3441
Joined: Wed Sep 13, 2006 2:50 am


Return to V - Skyrim