PaladinKyle Posted May 18, 2014 Share Posted May 18, 2014 (edited) I'll just cut to the chase, I need a script where when I equip a certain item, my jump height will increase to a specific value. Then, when I remove the item my jump height will return to default. This is what I have just from exploring the internet, trying to put things together. It's probably completely broken. Scriptname JumpHeightIncreaseSpaceJumpEquip extends activemagiceffect ObjectReference Property SpaceJumpBoots Auto Event OnObjectEquipped(Form akBaseRef, ObjectReference akActionRef) if Armor == SpaceJumpBoots Game.GetPlayer().setgs fjumpheightmin 1000 endIf endEvent Event OnObjectUnequipped(Form akObjectRef, ObjectReference akActionRef) if Amor == SpaceJumpBoots Game.GetPlayer().setgs fjumpheightmin 76 endif Endevent Thanks. Credits will be give to whoever creates the script. Edited May 18, 2014 by Kyle8497 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 18, 2014 Share Posted May 18, 2014 (edited) Try this. It needs to go on the player alias on a start game enabled quest. It also requires SKSE. You will need to test compilation as well as performance ScriptName JumpHeightIncreaseSpaceJumpEquip Extends ReferenceAlias Armor Property SpaceJumpBoots Auto Float Property NewJumpHeight Auto Float OldJumpHeight Float CurrentJumpHeight Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) If akBaseObject == SpaceJumpBoots OldJumpHeight = Game.GetGameSettingFloat("fJumpHeightMin") Game.SetGameSettingFloat("fJumpHeightMin",NewJumpHeight) CurrentJumpHeight = NewJumpHeight EndIf endEvent Event OnObjectUnequipped(Form akObjectRef, ObjectReference akActionRef) If akObjectRef == SpaceJumpBoots Game.SetGameSettingFloat("fJumpHeightMin",OldJumpHeight) CurrentJumpHeight = OldJumpHeight EndIf EndEvent Event OnPlayerLoadGame() If CurrentJumpHeight <= 0 Game.SetGameSettingFloat("fJumpHeightMin",CurrentJumpHeight) EndIf EndEvent EDIT: Needed to add a check in the OnPlayerLoadGame event else it would have set the jump height to 0 whenever a new game session was started. Edited May 18, 2014 by IsharaMeradin Link to comment Share on other sites More sharing options...
PaladinKyle Posted May 19, 2014 Author Share Posted May 19, 2014 I will try it out as soon as I can, thanks. Link to comment Share on other sites More sharing options...
PaladinKyle Posted May 19, 2014 Author Share Posted May 19, 2014 Try this. It needs to go on the player alias on a start game enabled quest. It also requires SKSE. Can you go in depth a little bit more on what you mean by this? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 20, 2014 Share Posted May 20, 2014 Read the Set Up a Reference Alias section on the Dynamically Attaching Scripts tutorial. That explains how to set up a quest with a reference alias for the player. Once that is done, you would apply the script to this alias. In order to compile the script, SKSE needs to be fully installed including the PSC files (if you followed Gopher's video it should all be set up as needed). Link to comment Share on other sites More sharing options...
PaladinKyle Posted May 20, 2014 Author Share Posted May 20, 2014 IsharaMeradin, I can't just attach the script to the boots themselves? And how do I compile for SKSE? Just normally through the CK? By the way, when I tried to compile your script, it compiled successfully. Although, I changed a few things around in the code because I though I needed to, and I also set the properties for the SpaceJumpBoots and the NewJumpHeight. Can you please review it? It still complied successfully with the changes I made. Also, it doesn't work in game, I assume that's because I need to make a 'player alias'. ScriptName JumpHeightIncreaseSpaceJumpEquip Extends ReferenceAlias Armor Property SpaceJumpBoots Auto Float Property NewJumpHeight Auto Float OldJumpHeight Float CurrentJumpHeight Event OnObjectEquipped(Form akBaseObject, ObjectReference akActionRef) If akBaseObject == SpaceJumpBoots OldJumpHeight = Game.GetGameSettingFloat("fJumpHeightMin") Game.SetGameSettingFloat("fJumpHeightMin",NewJumpHeight) CurrentJumpHeight = NewJumpHeight EndIf endEvent Event OnObjectUnequipped(Form akBaseObject, ObjectReference akActionRef) If akBaseObject == SpaceJumpBoots Game.SetGameSettingFloat("fJumpHeightMin",OldJumpHeight) CurrentJumpHeight = OldJumpHeight EndIf EndEvent Event OnPlayerLoadGame() If CurrentJumpHeight <= 0 Game.SetGameSettingFloat("fJumpHeightMin",CurrentJumpHeight) EndIf EndEvent Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 20, 2014 Share Posted May 20, 2014 The reason I said it should be put on the player alias is that the INI setting change is not persistent. It has to be reset on game load. The only event that can catch that is OnPlayerLoadGame which is only triggered by the player. Also change this line... I must not have been thinking clearly at the time...If CurrentJumpHeight <= 0toIf CurrentJumpHeight > 0 Link to comment Share on other sites More sharing options...
PaladinKyle Posted May 23, 2014 Author Share Posted May 23, 2014 (edited) I changed a few things around to make it compile successfully but it still doesn't work in game. Check out the new script: Scriptname SpaceJumpBootsHigherJump extends ReferenceAlias ReferenceAlias Property Player Auto Bool Property SpaceJumpBoots Auto Float Property NewJumpHeight Auto Float OldJumpHeight Float CurrentJumpHeight Event OnObjectEquipped(Form akBaseObject, ObjectReference akActionRef) If akBaseObject == SpaceJumpBoots OldJumpHeight = Game.GetGameSettingFloat("fJumpHeightMin") Game.SetGameSettingFloat("fJumpHeightMin",NewJumpHeight) CurrentJumpHeight = NewJumpHeight EndIf EndEvent Event OnObjectUnequipped(Form akBaseObject, ObjectReference akActionRef) If akBaseObject == SpaceJumpBoots Game.SetGameSettingFloat("fJumpHeightMin",OldJumpHeight) CurrentJumpHeight = OldJumpHeight EndIf EndEvent Function OnPlayerLoadGame() If CurrentJumpHeight > 0 Game.SetGameSettingFloat("fJumpHeightMin",CurrentJumpHeight) EndIf EndFunction Edited May 23, 2014 by Kyle8497 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 24, 2014 Share Posted May 24, 2014 Bool Property SpaceJumpBoots Auto <-- this is wrong Armor Property SpaceJumpBoots Auto <-- needs to be this If akBaseObject == SpaceJumpBoots <-- both lines of this If akBaseObject as Armor == SpaceJumpBoots <-- adjusted to this -- my fault, I forgot to put that in originally. Link to comment Share on other sites More sharing options...
lofgren Posted May 24, 2014 Share Posted May 24, 2014 Is messing around with the ini settings really necessary? Is the JumpingBonus actor value nonworking? Link to comment Share on other sites More sharing options...
Recommended Posts