Jump to content

[LE] Fixing Scripted Slowfall Effects Bug


Recommended Posts

Hey guys :smile:

I made a mod for Skyrim SE, it's here on nexus
https://www.nexusmods.com/skyrimspecialedition/mods/42113
The mod has amulets that you can disenchant and use the enchantment on most anything. The enchantment is animated dragon wings. NPC's can use them too. It is not a flight mod, because I made it for both XBox and PC, and XBox can't use SKSE, so no flight capability, the mod just has the animated wings and slowfall effects.
There was a bug reported that when an NPC is wearing the amulet, the player is getting the slowfall effects instead.
Now I created this mod originally for my husband, because he loved this other dragon wings mod here https://www.nexusmods.com/skyrim/mods/53271?tab=description
But it used potions and spells instead to activate and deactivate the wings, so I got permission to use this mod, and just connected the wings to the amulets instead.
So the bug is probably an issue from the original mod, I'm thinking it's coming from the scripting, which I didn't change at all in my mod. I just started learning scripting, so it's not really my thing, but I really want to fix this bug quickly for the people using it.

If anyone can give me advice, let me know and I'll upload or paste the scripts here. :smile:

Thanks guys, have a good one :smile:
Edited by anathemastudio
Link to comment
Share on other sites

Hey, I checked out the scripts and both NexusComa2 and foamyesque are right. It does change the game setting and uses game.getplayer(). Here's one of the scripts:

 

 

 

Scriptname _Anton_ADW_MagicEffect extends activemagiceffect  


Spell Property _Anton_AnimatedDragonWings_Spell Auto
GlobalVariable Property _Anton_AnimatedDragonWings_JumpHeight Auto


Event onEffectStart(Actor akTarget, Actor akCaster)

    _Anton_AnimatedDragonWings_JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
    Game.SetGameSettingFloat("fJumpHeightMin", 300.0)
    Game.GetPlayer().AddSpell( _Anton_AnimatedDragonWings_Spell, False)
    
EndEvent

Event OnCellLoad()
    ;_Anton_AnimatedDragonWings_JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
    Game.SetGameSettingFloat("fJumpHeightMin", 300.0)
    Game.GetPlayer().AddSpell( _Anton_AnimatedDragonWings_Spell, False)
    
EndEvent

Event OnPlayerLoadGame()

    _Anton_AnimatedDragonWings_JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
    Game.SetGameSettingFloat("fJumpHeightMin", 300.0)
    Game.GetPlayer().AddSpell( _Anton_AnimatedDragonWings_Spell, False)
    
EndEvent

Which you could change to:

Scriptname _Anton_ADW_MagicEffect extends activemagiceffect  

Spell Property _Anton_AnimatedDragonWings_Spell Auto
GlobalVariable Property _Anton_AnimatedDragonWings_JumpHeight Auto
Actor Target

Event onEffectStart(Actor akTarget, Actor akCaster)
    Target = akTarget
    
    If akTarget == Game.GetPlayer()
        _Anton_AnimatedDragonWings_JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
        Game.SetGameSettingFloat("fJumpHeightMin", 300.0)
    Endif 
    
    Target.AddSpell( _Anton_AnimatedDragonWings_Spell, False)
    
EndEvent

Event OnCellLoad()

     If Target == Game.GetPlayer()
         ;_Anton_AnimatedDragonWings_JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
        Game.SetGameSettingFloat("fJumpHeightMin", 300.0)
    Endif 
    
    Target.AddSpell( _Anton_AnimatedDragonWings_Spell, False)
    
EndEvent

Event OnPlayerLoadGame()

    If Target == Game.GetPlayer()
        _Anton_AnimatedDragonWings_JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
        Game.SetGameSettingFloat("fJumpHeightMin", 300.0)
    Endif 
    
    Target.AddSpell( _Anton_AnimatedDragonWings_Spell, False)
    
EndEvent

You would have to do something similar for all the scripts.
Link to comment
Share on other sites

Hi Dybill :), you're awesome with this stuff! You helped me with another scripting question for addiction involving a sword. :)

 

Awesome thanks guys for all your help, I really appreciate it and your time. I'm a complete noob to scripting, but this makes sense now and I can work with it, thanks to you all. :)

Edited by anathemastudio
Link to comment
Share on other sites

I've made the changes to that first script _Anton_ADW_MagicEffect and am now changing the others.

This one is
_Anton_ADW_MagicEffect_Counter

Scriptname _Anton_ADW_MagicEffect_Counter extends activemagiceffect  


GlobalVariable Property _Anton_AnimatedDragonWings_Switch Auto
Int SwitchState


Event onEffectStart(Actor akTarget, Actor akCaster)


SwitchState = _Anton_AnimatedDragonWings_Switch.GetValueInt()
If SwitchState >= 2
_Anton_AnimatedDragonWings_Switch.SetValueInt(0)
Else
SwitchState += 1
_Anton_AnimatedDragonWings_Switch.SetValueInt(SwitchState)
EndIf


EndEvent

Based on the changes to the _Anton_ADW_MagicEffect script, I'm thinking this script needs to be changed to say the following, if you have a chance, please let me know if I missed something here:

Scriptname _Anton_ADW_MagicEffect_Counter extends activemagiceffect  


GlobalVariable Property _Anton_AnimatedDragonWings_Switch Auto
Int SwitchState
Actor Target


Event onEffectStart(Actor akTarget, Actor akCaster)
Target = akTarget


SwitchState = _Anton_AnimatedDragonWings_Switch.GetValueInt()
If SwitchState >= 2
_Anton_AnimatedDragonWings_Switch.SetValueInt(0)
Else
SwitchState += 1
_Anton_AnimatedDragonWings_Switch.SetValueInt(SwitchState)
EndIf


EndEvent

And the last script is _Anton_ADW_MagicEffect_Dispel this is it here:

Scriptname _Anton_ADW_MagicEffect_Dispel extends activemagiceffect  


GlobalVariable Property _Anton_AnimatedDragonWings_Switch Auto
GlobalVariable Property _Anton_AnimatedDragonWings_JumpHeight Auto


Event onEffectStart(Actor akTarget, Actor akCaster)


Game.SetGameSettingFloat("fJumpHeightMin", _Anton_AnimatedDragonWings_JumpHeight.GetValue() )
_Anton_AnimatedDragonWings_Switch.SetValueInt(2)


EndEvent

Again, based on the changes to the first script, I'm thinking this one needs to say:

Scriptname _Anton_ADW_MagicEffect_Dispel extends activemagiceffect  


GlobalVariable Property _Anton_AnimatedDragonWings_Switch Auto
GlobalVariable Property _Anton_AnimatedDragonWings_JumpHeight Auto
Actor Target


Event onEffectStart(Actor akTarget, Actor akCaster)
    Target = akTarget


    If akTarget == Game.GetPlayer()
Game.SetGameSettingFloat("fJumpHeightMin", _Anton_AnimatedDragonWings_JumpHeight.GetValue() )
_Anton_AnimatedDragonWings_Switch.SetValueInt(2)
Endif  


EndEvent
I know coding for web dev, but this is new to me, so if you have a chance please let me know if I missed something with any of these. I'd really appreciate it. :)
Link to comment
Share on other sites

  • Recently Browsing   0 members

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