zogthemighty Posted May 7, 2016 Share Posted May 7, 2016 Scriptname ZogUnequipTest extends ObjectReference import Actor Event OnActivate(ObjectReference akActionRef) Debug.Notification("You've picked me up") EndEvent Event OnEquipped(Actor akActor) Debug.Notification("You've equipped me and I'm going to unequip myself!") akActor.UnequipItem(Self, false, false) Debug.Notification("I should be unequipped now") EndEventThe messages are shown, but item doesn't get unequipped. I think "self" is not referring to the weapon to which I've attached the script - what's the correct way to do this? Link to comment Share on other sites More sharing options...
mazz0 Posted May 7, 2016 Share Posted May 7, 2016 I'd like to know this too! Link to comment Share on other sites More sharing options...
ubuntufreakdragon Posted May 7, 2016 Share Posted May 7, 2016 Native Calls e.g. using self are normally not possible for inventory items only persistent items remain accessible in inventory.The easiest way to workaround this is to add a Const Property linking to the BaseItem and running unequip on this Property. Link to comment Share on other sites More sharing options...
zogthemighty Posted May 7, 2016 Author Share Posted May 7, 2016 Native Calls e.g. using self are normally not possible for inventory items only persistent items remain accessible in inventory. The easiest way to workaround this is to add a Const Property linking to the BaseItem and running unequip on this Property. Yeah, we (I'm actually Mazz0 typing this on Zog's account) tried setting up a property, but got lots of errors, probably because we weren't using the correct Type and Value. Do you know what we should use for that? I tried Form with the weapon's FormID as the value, and ObjectReference, got errors like "Unknown user flag". Thanks for your help with this by the way (and with our other question) :smile: Link to comment Share on other sites More sharing options...
ubuntufreakdragon Posted May 7, 2016 Share Posted May 7, 2016 (edited) this works a bit different: Papyrus doesn't know anything about the handled objects, so it work like this: you tell Pap there is an object A of this type eg. weapon than in your esp you attach the script to an object B and tell the object B which object A is.the code looks like this if you are using a weapon.Weapon Property PropertyName_UseTheWeaponsEditorIdAsNameToEnableAutoFill Auto ConstThan you attach the script and select the matching object in CK Edited May 7, 2016 by ubuntufreakdragon Link to comment Share on other sites More sharing options...
mazz0 Posted May 8, 2016 Share Posted May 8, 2016 this works a bit different: Papyrus doesn't know anything about the handled objects, so it work like this: you tell Pap there is an object A of this type eg. weapon than in your esp you attach the script to an object B and tell the object B which object A is.the code looks like this if you are using a weapon.Weapon Property PropertyName_UseTheWeaponsEditorIdAsNameToEnableAutoFill Auto ConstThan you attach the script and select the matching object in CKThanks, we'll try that! Does this mean you have to have one script per weapon, since the EditorID is hard coded into the script? So you couldn't write a script to apply a certain trait and use it for multiple weapons? Link to comment Share on other sites More sharing options...
ubuntufreakdragon Posted May 8, 2016 Share Posted May 8, 2016 you only need to use the Editor id if you want to use the auto fill feature, so this allows the CK to directly link the correct weapon automatically, if you want a more variable script you can use any other name and have to link it manually when attaching the Script. Link to comment Share on other sites More sharing options...
Recommended Posts