Jump to content
Heavy Traffic ×

[LE] Script help: Enchanted item changes jump height


Recommended Posts

Hello, I am looking for some help once again. I want to make an enchanted item (boots) that change the jump height ONLY of the person wearing them. I also would like the enchantment to be able to be disenchanted and learnable so the player can put it on other items. I found some scripting of someone who was doing a similar thing. They got their coding to work, but I cant figure out why it wont compile when I use it. Here is their script:

 

Scriptname Fairy3rdPhaseJump extends activemagiceffect

GlobalVariable Property JumpHeight Auto


Event onEffectStart(Actor akTarget, Actor akCaster)
JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
Game.SetGameSettingFloat("fJumpHeightMin", 200.0)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
Game.SetGameSettingFloat("fJumpHeightMin", JumpHeight )
EndEvent

Event OnCellLoad()
;JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
Game.SetGameSettingFloat("fJumpHeightMin", 200.0)
EndEvent


Event OnPlayerLoadGame()
JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
Game.SetGameSettingFloat("fJumpHeightMin", 200.0)
EndEvent


I found this script on Lovers Lab (go figure)..... Here is the link to the forum. I could not figure out what I was missing and re-read the forum a few times. : https://www.loverslab.com/topic/104441-some-scripting-help/

And when I copied this script into my mod I did not copy the script name, I used my own. I am basically looking for a formula that I can just plug some numbers into and change the jump height of the player while they are wearing the enchanted item. All I really need is the jump height. I know how to turn off fall damage via enchant so that part is covered.

Link to comment
Share on other sites

So if I get rid of those last two paragraphs :

Event OnCellLoad()
;JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
Game.SetGameSettingFloat("fJumpHeightMin", 200.0)
EndEvent


Event OnPlayerLoadGame()
JumpHeight.SetValue( Game.GetGameSettingFloat("fJumpHeightMin") )
Game.SetGameSettingFloat("fJumpHeightMin", 200.0)
EndEvent



It should work if get rid of these two paragraphs right? Is there any other tinkering that I need to remove? Like the quotations are good and everything? It should work as exactly written? Let me try it later today and I will let you know if it works after removing those two sections of code. Thank you for looking over it for me!

Link to comment
Share on other sites

Actually I just read your original post. This script would only change the jump height for the player I believe, as it changes the game setting. I'm not sure if it's possible to change the jump height for NPC's or not. I did see an error in the script too, it should be:

 

Scriptname Fairy3rdPhaseJump extends activemagiceffect

GlobalVariable Property JumpHeight Auto

Event onEffectStart(Actor akTarget, Actor akCaster)
    JumpHeight.SetValue(Game.GetGameSettingFloat("fJumpHeightMin"))
    Game.SetGameSettingFloat("fJumpHeightMin", 200.0)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    Game.SetGameSettingFloat("fJumpHeightMin", JumpHeight.GetValue())
EndEvent

 

You also would have to make the JumpHeight global variable in the CK. If you didn't want to use the global variable you could do this instead:

 

Scriptname Fairy3rdPhaseJump extends activemagiceffect

Float JumpHeight

Event onEffectStart(Actor akTarget, Actor akCaster)
    JumpHeight = Game.GetGameSettingFloat("fJumpHeightMin")
    Utility.Wait(0.25)
    Game.SetGameSettingFloat("fJumpHeightMin", 200.0)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    Game.SetGameSettingFloat("fJumpHeightMin", JumpHeight)
EndEvent

Again this will only change the jump height of the player I believe. You could also try changing the magic effect's archetype to value modifier, and setting the Assoc. Item 1 to Jumping Bonus. I'm not sure if that works but it's worth a shot.

Link to comment
Share on other sites

I basically just need it to change the players jump height. I believe there is a console command that people like to use to alter their jump height, but that changes the players and all NPC's jump height, and I dont really want that. I just want to alter the players jump height while wearing the enchant and then for it to go back to normal once the enchanted item is removed.

Link to comment
Share on other sites

Sorry it took me so long to get back to you. So I tried both sets of code you left and neither one compiled. I really dont know why they didnt. I copied them in exactly as you posted (minus the script name because I used my own script name). I apologize for my lack in papyrus coding knowledge. Its very confusing to me.

And yes, I did put the script on a magic effect, it just will not compile.


this is the error i received for the first script you gave:

Starting 1 compile threads for 1 files...
Compiling "IncreaseMaxJumpHeight"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\IncreaseMaxJumpHeight.psc(7,9): SetGameSettingFloat is not a function or does not exist
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\IncreaseMaxJumpHeight.psc(7,9): cannot call the member function SetGameSettingFloat alone or on a type, must call it on a variable
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\IncreaseMaxJumpHeight.psc(11,9): SetGameSettingFloat is not a function or does not exist
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\IncreaseMaxJumpHeight.psc(11,9): cannot call the member function SetGameSettingFloat alone or on a type, must call it on a variable
No output generated for IncreaseMaxJumpHeight, compilation failed.


I dont know if this helps or not.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on IncreaseMaxJumpHeight

Edited by WondraBox
Link to comment
Share on other sites

Link to comment
Share on other sites

  • Recently Browsing   0 members

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