Jump to content

Recommended Posts

I have some custom perks (which are based off of some of the perks from the vanilla perk trees) that are applied to the player via dialogue. I would like for these perks to last for a timed duration and then vanish once the time is up.

 

I used the following as a guide to put these together: BladesAbBlessing (magic effect), BladesBlessingAbility (spell), and MQBladesBlessing (perk).

 

BladesBlessingAbility (spell) has the time set for 5 days. There is a TimeAbilityScript attached to BladesAbBlessing (magic effect), but it does not seem to be working.

 

The custom perks are applied properly, their effects are functioning fine, but they do not vanish after the set amount of time has elapsed. The only other thing I can find that seems like it might be tied to them is the BladesBlessingTimer (global), but it does not seem to be connected to by any script or mentioned directly by any of the Blades entries I mentioned above. :unsure:

 

I just need for these perks to vanish after a set amount of time.

 

 

Any insight is appreciated. Thank you.

Edited by Lollia
Link to comment
Share on other sites

That has me confused too. Can confirm this happens irrelevant of globals - just had this happen to me with an ability. You can try to removespell(spell) after playing with times - but that didn't work for me either. In the end I wrote out the whole effect using utility.wait(), given that's better for shorter effects. Wish I knew why this happened!

Link to comment
Share on other sites

As far as I can see there is all right with "Dragonslayer's Blessing".

 Skyrim.esm
    [SPEL:000E76DF] - BladesBlessingAbility "Dragonslayer's Blessing"
        ability, constant effect, on self
    
        [MGEF:000E76E0] - BladesAbBlessing "Dragonslayer's Blessing"
        ; Perk to Apply: [PERK:000E6805] MQBladesBlessing

        [PERK:000E6805] MQBladesBlessing "Dragonslayer's Blessing"
        ; "Gives bonus 10% critical hit chance vs. dragons"

TimedAbilityScript

 

Scriptname TimedAbilityScript extends ActiveMagicEffect

  Spell Property pAbilityToRemove Auto        ; [SPEL:000E76DF] BladesBlessingAbility "Dragonslayer's Blessing"
  Int   Property pHoursToWait Auto            ; set to 120, (24 hours * 5 = 120) = 5 days


Event OnEffectStart(Actor akTarget, Actor akCaster)
; start timer
    RegisterForSingleUpdateGameTime(pHourstoWait)        ; wait ingame for 5 days
EndEvent

Event OnUpdateGameTime()
;     debug.trace(self + "OnUpdateGameTime")
    Game.GetPlayer().RemoveSpell(pAbilityToRemove)       ; remove the spell from player
EndEvent

 



What can be wrong?

(1) Your savegame has papyrus stack corruption, that means papyrus engine is not able to trigger events or run script code valid.
(2) You have a mod that is changing the script or is messing up with effect or spell.
(3) You have a mod that is changing the vanilla perk tree. It seems to clash with this vanilla perk.
(4) You have a mod that is changing vanilla game timer. That would be a really bad thing.

Edited by ReDragon2013
Link to comment
Share on other sites

As far as I can see there is all right with "Dragonslayer's Blessing".

 Skyrim.esm
    [SPEL:000E76DF] - BladesBlessingAbility "Dragonslayer's Blessing"
        ability, constant effect, on self
    
        [MGEF:000E76E0] - BladesAbBlessing "Dragonslayer's Blessing"
        ; Perk to Apply: [PERK:000E6805] MQBladesBlessing

        [PERK:000E6805] MQBladesBlessing "Dragonslayer's Blessing"
        ; "Gives bonus 10% critical hit chance vs. dragons"

TimedAbilityScript

 

Scriptname TimedAbilityScript extends ActiveMagicEffect

  Spell Property pAbilityToRemove Auto        ; [SPEL:000E76DF] BladesBlessingAbility "Dragonslayer's Blessing"
  Int   Property pHoursToWait Auto            ; set to 120, (24 hours * 5 = 120) = 5 days


Event OnEffectStart(Actor akTarget, Actor akCaster)
; start timer
    RegisterForSingleUpdateGameTime(pHourstoWait)        ; wait ingame for 5 days
EndEvent

Event OnUpdateGameTime()
;     debug.trace(self + "OnUpdateGameTime")
    Game.GetPlayer().RemoveSpell(pAbilityToRemove)       ; remove the spell from player
EndEvent

 

 

 

What can be wrong?

 

(1) Your savegame has papyrus stack corruption, that means papyrus engine is not able to trigger events or run script code valid.

(2) You have a mod that is changing the script or is messing up with effect or spell.

(3) You have a mod that is changing the vanilla perk tree. It seems to clash with this vanilla perk.

(4) You have a mod that is changing vanilla game timer. That would be a really bad thing.

 

 

 

 

Okay, I forgot something rather important, which was changing the ability from the script's Properties section over to the new custom one. I fixed that and started a new game to test, but the ability is still not being removed after five days.

 

This ability is based on the Physician perk from the vanilla Alchemy perk tree, so (since there is nothing to show up in the active effects panel) the only way I've been able to check that it is still active on the player is monitor the potency of their potions.

 

Without the ability, their health potions give 22 points of health. Once the ability is applied, the potions give 27. I tested with both the Wait timer, and also with another new game where I played through the days naturally without fast travel, waiting or sleeping, and the potions are still giving 27 points of health.

 

I when I choose "Edit Source" on the TimedAbilityScript, this is what comes up:

 

 

ScriptName TimedAbilityScript extends ActiveMagicEffect

Spell Property pAbilityToRemove Auto

Int Property pHoursToWait Auto

Event OnUpdateGameTime()

; debug.trace(self + "OnUpdateGameTime")

Game.GetPlayer().RemoveSpell(pAbilityToRemove)

 

EndEvent

Event OnEffectStart(Actor akTarget, Actor akCaster)

 

; start timer

RegisterForSingleUpdateGameTime(pHourstoWait)

 

EndEvent

Edited by Lollia
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...