scriptname cohTransformTiming extends Quest{Controls the Timing for transformation.};calling properties, spells, globals, and importing the maths. import Math float property cohGetMoonPhase auto float property cohPhaseDay auto bool property cohCanTransform auto bool property cohbmvar auto bool property IsFirstChange auto Spell property WerewolfChange auto GlobalVariable Property GameHour auto GlobalVariable Property GameDaysPassed auto GlobalVariable Property PlayerIsWerewolf auto GlobalVariable Property PlayerWerewolfShiftbacktime auto MagicEffect Property WerewolfChangeEffect auto ; The script should run once every in game minute in this state, otherwise the flavor texts could be desychronized.Event OnInit()RegisterForUpdate(1)EndEvent Event OnUpdate(); Determining Moon Phase Below...Not yet implimented. int timeOfDay = GameHour.GetValueint() int DaysPassed = GameDaysPassed.GetValueint(); Ignore PhaseDay, not functioning in this iteration of the script.;/List of moon phases returned by cohGetMoonPhase.0 = full moon1 = 3/4 waning2 = half waning3 = 1/4 waning4 = new moon5 = 1/4 waxing6 = half waxing7 = 3/4 waxing/;;Not sure what cohPhaseDay should return, though one is an adequete placeholder.debug.Notification(TimeOfDay) If TimeOfDay >= 20 || TimeOfDay < 6 || TimeOfDay == 0Utility.WaitGameTime ( 0.05 ) cohCanTransform == trueelse cohCanTransform == falseendif; Hell, it's morphing time! if ( PlayerIsWerewolf.GetValue() == 1 && cohCanTransform == true ) && IsFirstChange == true && game.getplayer().HasMagicEffect(WerewolfChangeEffect) == 0 debug.notification("The player can transform!!!") PlayerWerewolfShiftbacktime.SetValue(10000) WerewolfChange.Cast(Game.GetPlayer(), Game.GetPlayer()) Utility.WaitGameTime ( 0.05 ) Debug.Notification ("Generic Flavor Text") elseif PlayerIsWerewolf.GetValue() == 1 && cohCanTransform == true && IsFirstChange == false && game.getplayer().HasMagicEffect(WerewolfChangeEffect) == 0 PlayerWerewolfShiftbacktime.SetValue(10000) WerewolfChange.Cast(Game.GetPlayer(), Game.GetPlayer()) Utility.WaitGameTime ( 0.05 ) Debug.MessageBox ("First Post Transform Flavor Text") elseif PlayerIsWerewolf.GetValue() == 1 && game.getplayer().HasMagicEffect(WerewolfChangeEffect) == 1 && cohCanTransform == false PlayerWerewolfShiftbacktime.SetValue(1)endifEndEventThe properties window for said script is here:
[img]http://i1173.photobucket.com/albums/r593/InfinityArch/NewBitmapImage3.jpg[/img]
The first time I made a papyrus fragment, I put in a debug flag, and for whatever reason, it didn't even run, which was pretty disappointing, though the script was basically "RegisterForUpdate(1)" and the debug flags. Before you ask, the quest is start game enabled and the stage this fragment was attached to was defined as the "startup" stage. Kmyquest was also set to the correct script.
After I found out about OnInit(), which is how I got the script proper to start running,I tried to put an event in the payrus fragment that would make it run on the start of the game...(after which I would return the main script to an OnUpdate() event.
Event OnInit()RegisterForUpdate(1)debug.notification("Script Initiated")EndEventBut it returned an error.
Starting 1 compile threads for 1 files...Compiling "QF_cohTimingQuest_01001562"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_cohTimingQuest_01001562.psc(12,0): mismatched input 'Event' expecting ENDFUNCTIONc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_cohTimingQuest_01001562.psc(17,0): missing EOF at 'EndFunction'No output generated for QF_cohTimingQuest_01001562, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on QF_cohTimingQuest_01001562
I'm not even sure I need the Papyrus Fragment, but I have literally no other ideas as to why the script isn't returning the global variables properly. If anyone has any insight on this problem, I'd be very grateful if you would share it.
