Page 1 of 1

Making Cursed Item

PostPosted: Wed Feb 08, 2017 12:15 am
by saharen beauty

I'm wanting to make an item (an amulet) that is Cursed, and cannot be unequipped for a mod I'm developing. I've been trying some things and I came up with this, but I'm not sure this example works:



Also, it's standard Skyrim, not SE.




Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
If akBaseObject as Armor == YourArmorItem
MakeImpossibleToRemove(akBaseObject)
ElseIf akBaseObject as Weapon == YourWeaponItem
MakeImpossibleToRemove(akBaseObject)
EndIf
EndEvent

Function MakeImpossibleToRemove(Form CurrentObject)
Self.GetActorReference().UnequipItem(CurrentObject,false,false)
Utility.Wait(0.1)
Self.GetActorReference().EquipItem(CurrentObject,true,false)
EndFunction

What exactly am I doing wrong here, it just isn't working in game.


Making Cursed Item

PostPosted: Wed Feb 08, 2017 1:04 am
by Charity Hughes

The CK Wiki is not working for me right now, so I can't provide exact code... But you could do two things :



One, whenever the item is unequipped (which should be... OnUnEquipped(Actor Target)I mem serves), the script triggers the 'Target' to re-equip the item.



Or Two, on first-equip, have a Script UnEquip and then Re-Equip with the 'Block UnEquip Flag' set (which I believe is what is set for the Werewolf transform, but I'm not at my CK to check.



Based on what you posted above (and given it's been AGES since I did any proper Skyrim Modding), I think the issue is that you are using the wrong event... Try what you have with "OnEquipped(Actor Target)" -- I *Think* on OnObjectEquipped applies to Actors, rather than the items themselves, which would mean your Function never fires (But without the Wiki working, I can't confirm :/ )


Making Cursed Item

PostPosted: Tue Feb 07, 2017 6:01 pm
by Ymani Hood



What I have done (which is part of what I wanted to do), is I got a warning message to pop up when equipping it, now I just need to make it so they can't unequip it if they say yes.



Scriptname scaCursedItem extends ObjectReference

Actor Property PlayerREF Auto
Armor Property scaCItem Auto
Message Property cursedWarning Auto

Event OnEquipped(Actor akActor)
if (akActor == PlayerREF)
menu()
EndIf
EndEvent

Function menu(Int aiButton = 0)
aiButton = cWarningMessage.Show()
if aiButton == 0
Debug.Notification("Do not equip Cursed Item.")
ElseIf aiButton == 1
Debug.Notification("Equip Cursed Item.")
EndIf
EndFunction

So, any hints on where I take it from here?