AslanKebab Posted April 18, 2018 Share Posted April 18, 2018 Hello, I have created a dagger that changes enchantment depending on which hand is holding it. But as I cannot make use of SKSE in the mod I´m working on, So I had to basically create two of the same dagger with different Enchantments on each item. Actor Property PlayerREF Auto weapon Property DaggerLeftHand Auto weapon Property DaggerRightHand Auto Event OnEquipped (Actor AkActor) if (Game.GetPlayer().GetEquippedWeapon(true) == DaggerRightHand) Debug.Notification("Player has Dagger equipped in their Left hand"); PlayerREF.AddItem(DaggerLeftHand, 1, true); PlayerREF.EquipItem(DaggerLeftHand); Debug.Notification("DaggerLeftHand Equipped"); PlayerREF.UnequipItem(DaggerRightHand); PlayerREF.RemoveItem(DaggerRightHand); Debug.Notification("DaggerRightHand Removed"); elseIf (Game.GetPlayer().GetEquippedWeapon() == DaggerLeftHand) Debug.Notification("Player has Dagger equipped in their Left hand"); PlayerREF.AddItem(DaggerRightHand, 1, false); PlayerREF.EquipItem(DaggerRightHand); Debug.Notification("DaggerRightHand Equipped"); PlayerREF.UnequipItem(DaggerLeftHand); PlayerREF.RemoveItem(DaggerLeftHand); Debug.Notification("DaggerLeftHand Removed"); endIf endEvent I can get the basics to work but I´m experiencing two "bugs" due to the way I´m doing it. Mainly: - The Enchantment Charge amount resets, every time the player switches between holding the Dagger in the left hand and The right hand.- The Lefthanded version of the dagger, get instantly switched to the right hand when equipping it to the left. as the Equipitem function does that by default. so the player forced to switch it twice to the left before it works as intended... I am aware that half the reason I´m running into these problems, is that our mod does not have SKSE integration, So what I am asking for is suggestions how I could work around this.Switching Enchantments and equipping items specifically in a slot would have made everything easier.... One way would be to not have to add and remove the items while hiding one of them in the inventory.....though not sure how I would reach the "playable" flags in the editor through scripting. -.- When it comes to equipping the weapon in the right hand by Default I´ve tried changing the equipment type to the left hand on the item in the editor but that doesn´t help. doing internet searches seems to suggest that equipping it as a shield would work better but I have no way that I am aware of to change back the equipment type after that if I need to....(i might not as haven´t tried it yet...) I am Fairly new to items scripting in the creation kit so I might have missed something while going over the creation kit wiki. And would really appreciate any help you guys could provide. Thanks in advance. Link to comment Share on other sites More sharing options...
candlepin Posted April 18, 2018 Share Posted April 18, 2018 Use both enchantments on the same weapon. Set your enchantment conditions based on a new global variable (very easy). E.g. left hand enchantment condition of global == 0, right hand enchantment only if global == 1. Add both enchantments to the weapon. Then add a script to the weapon that changes the global variable depending on the hand in which it is equipped (global = 0 if left, = 1 if right). Link to comment Share on other sites More sharing options...
FrankFamily Posted April 18, 2018 Share Posted April 18, 2018 (edited) Imo you are greatly overcomplicating the matter, just have one enchantment with two magic effects with conditions as candlepin has suggested but moreover you don't even need a global or scripts: I'm certain you can determine with conditions only whether a specific weapon is in the right hand or left hand because I did just that for my Ice Blade mod. I can't check at the moment but from what I recall GetEquipped doesn't work for items in the left hand, i.e. it will return false when you have the weapon in the left hand. Given this conditions will only be checked when you attack someone with it and therefore we know you have it equipped then GetEquipped becames "IsMyWeaponInTheRightHand" for all intents and purposes. You could implement an extra check to make sure you indeed have the weapon equipped via WornHasKeyword condition and a custom keyword on your weapon (or any other method of knowing if you have the weapon equipped regardless of hand which there are a few) but as said, if this is checked you must have it equipped. So, you just need to use "GetEquipped MyCustomWeapon == 0.0" for the effect on the left hand and "GetEquipped MyCustomWeapon == 1.0" edit: if this doesn't work I could check what I actually did, it's possible I'm misremembering the condition function that should be used for this but I'm 90% confident it was this. Edited April 18, 2018 by FrankFamily Link to comment Share on other sites More sharing options...
AslanKebab Posted April 19, 2018 Author Share Posted April 19, 2018 Imo you are greatly overcomplicating the matter, just have one enchantment with two magic effects with conditions as candlepin has suggested but moreover you don't even need a global or scripts: I'm certain you can determine with conditions only whether a specific weapon is in the right hand or left hand because I did just that for my Ice Blade mod. I can't check at the moment but from what I recall GetEquipped doesn't work for items in the left hand, i.e. it will return false when you have the weapon in the left hand. Given this conditions will only be checked when you attack someone with it and therefore we know you have it equipped then GetEquipped becames "IsMyWeaponInTheRightHand" for all intents and purposes. You could implement an extra check to make sure you indeed have the weapon equipped via WornHasKeyword condition and a custom keyword on your weapon (or any other method of knowing if you have the weapon equipped regardless of hand which there are a few) but as said, if this is checked you must have it equipped. So, you just need to use "GetEquipped MyCustomWeapon == 0.0" for the effect on the left hand and "GetEquipped MyCustomWeapon == 1.0" edit: if this doesn't work I could check what I actually did, it's possible I'm misremembering the condition function that should be used for this but I'm 90% confident it was this. I'm sorry for the Delayed Response Thanks to your advice I managed to get it to work perfectly, here is what I did. I used the GetEquippedItemType condition and checked that the player is Not holding the weapon in right hand when the left-hand enchantment is to be applied and vice-versa, to make it work. Thanks again, you guys taught me more than a week's worth of digging in the creation kit by myself. Link to comment Share on other sites More sharing options...
Recommended Posts