eviltwinNE Posted March 5, 2012 Share Posted March 5, 2012 I have a mod that make the dragon priest mask be able to warp from anywhere in skyrim to the dragon priest sanctuary and then back to your original location. I'm trying to make it usable once a day but something isnt working with the hoursSinceLastUse variable and i cant figure it out. This is my script and im not much of a programmer so if something is really goofy here thats why. Scriptname DunLabyrinthianWoodenMaskModSCRIPT extends ActiveMagicEffect {Script that handles the use of the wooden Bromjunaar mask as a key to the sanctuary} objectReference property SanctuaryMarker auto{Where to put the player when the mask is used as a key}location property DragonPriestSanctuaryLocation auto{The sanctuary Cell}imageSpaceModifier property AzuraFadeToBlack auto{Use a basic fade-to-black for the transition}imageSpaceModifier property FadeToBlackBackImod autoSound Property TransitionSFX Auto objectReference property maskActual auto{Point explicity to the unique, placed reference of the mask in the world} ObjectReference selfRefObjectReference warpMarkerbool property firstRun = true autofloat lastUseTimefloat hoursSinceLastUse EVENT OnEffectStart(Actor Target, Actor Caster) selfRef = caster if caster == game.GetPlayer() && !firstRunhoursSinceLastUse = 24 * (Utility.GetCurrentGameTime() - lastUseTime) endif debug.trace("hoursSinceLastUse = " + hoursSinceLastUse) if caster == game.getPlayer() && !game.getPlayer().IsInCombat() && ((hoursSinceLastUse > 24.0) || firstRun)firstRun = falsewarpMarker = game.getPlayer().PlaceAtMe(Game.GetForm(00000032))AzuraFadeToBlack.apply()TransitionSFX.play(caster)utility.wait(2.5)caster.moveTo(SanctuaryMarker)FadeToBlackBackImod.apply()AzuraFadeToBlack.remove() endif endEVENT EVENT onEffectFinish(Actor Target, Actor Caster)if Caster == game.getPlayer() && game.getPlayer() .isInLocation(DragonPriestSanctuaryLocation) == TRUE;when player removes the mask in sanctuary, return to SkyrimAzuraFadeToBlack.apply()TransitionSFX.play(caster)utility.wait(2.5)game.getPlayer().MoveTo(warpMarker)FadeToBlackBackImod.apply()AzuraFadeToBlack.remove()if caster.getItemCount(maskActual) < 1; safety catch - if the player dropped the mask in the sanctuary, add it to inventory so it doesn't get lost.caster.addItem(maskActual)endifhoursSinceLastUse = 0.0debug.trace("hoursSinceLastUse = " + hoursSinceLastUse)lastUseTime = Utility.GetCurrentGameTime()debug.trace("lastUseTime = " + lastUseTime) endifwarpMarker.Delete()endEVENT Link to comment Share on other sites More sharing options...
Recommended Posts