Jump to content

Recommended Posts

Posted (edited)
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
Posted

Sounds like in the script everything was aimed towards the player and not towards a player veritable who is wearing it.
Possibly change that to a generic player veritable you set each time the amulet is equipped. Should fix that.

Posted

I strongly suspect the slowfall effects are being achieved by messing with the game settings, which are global, and the relevant enchantment isn't checking to make sure it's being worn by a player.

Posted

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:

 

 

  Reveal hidden contents

Which you could change to:
  Reveal hidden contents
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.
Posted (edited)

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
Posted

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. :)
Posted

Looks good except you don't need to do Target = akTarget in those. You only need to do that if you need to use the target actor in other events. As those scripts only have 1 event, that's unnecessary.

  • Recently Browsing   0 members

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