Jump to content

Photo

Script help: Enchanted item changes jump height

scripting jump height creation kit skyrim special edition disenchant script

  • Please log in to reply
7 replies to this topic

#1
WondraBox

WondraBox

    Newbie

  • Members
  • Pip
  • 12 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.loversla...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.

 



#2
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,360 posts

It looks like that script should be working. Did you attach it to the magic effect that's on your enchantment? You also don't need the OnPlayerLoadGame and OnCellLoad events.



#3
WondraBox

WondraBox

    Newbie

  • Members
  • Pip
  • 12 posts

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!



#4
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,360 posts

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.



#5
WondraBox

WondraBox

    Newbie

  • Members
  • Pip
  • 12 posts

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.



#6
WondraBox

WondraBox

    Newbie

  • Members
  • Pip
  • 12 posts

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, 21 July 2020 - 04:27 AM.


#7
ReDragon2013

ReDragon2013

    Old hand

  • Members
  • PipPipPip
  • 537 posts

If you do not have installed SKSE, script will not compile.

 

https://www.creation...ingFloat_-_Game

You are using "Skyrim Special Edition" there is another forum here on Skyrim Nexus:

https://forums.nexus...f4b&c=4040,4045
https://forums.nexus...it-and-modders/



#8
WondraBox

WondraBox

    Newbie

  • Members
  • Pip
  • 12 posts

Oh snap! i thought i was on the SE forum! Sorry about that. i will go over there then, thanks!

and yes I do have SKSE.







Also tagged with one or more of these keywords: scripting, jump, height, creation, kit, skyrim, special edition, disenchant, script

Page loaded in: 1.059 seconds