Previous Threads:
Have a quick question? Need a quick answer? If you have not had any luck with the http://www.creationkit.com/Main_Page, post away and hopefully someone will have the answer(s) you seek.
Previous Threads:
These things are because Armor objects don't actually exist in the loaded game. Every piece of armor you are able to interact with (read: run a script on) is actually an ObjectReference, which doesn't extend Armor.
If you're trying to use armor methods on an object, you would probably have to do something like this in the script:
((self as Form) as Armor).ArmorFunction()
Also, keep in mind that you'll be editing the base form with whatever ArmorFunction() you use in that case, not the specific object reference which the script is attached to. If you want to edit only the objectReference, you are limited to using the methods of ObjectReference (or WornObject) script.
Thanks. And I am very aware of that. I got the Maintenance Quest thing worked out. =)
I am using the removeItem script to remove all potions from the player. I do this by first removing those items from the vanilla game that I placed in a formlist, so
player.removeItem(allPotions, 99999, tempchest)
where allPotions is a formlist. THe problem is, this isn't adding the potions to the tempchest, although it is removing them from the player. I have setupTempChest as either an alias.getReference or as an objectReference property, both of which point to the right chest, but, still no luck. Is it impossible to move items using remove item with a formlist?
try:
player.removeItem(allPotions, 99999, akOtherContainer = tempchest)
Should be:
player.removeItem(allPotions, 99999, true, tempchest)
edit: or what egocarib said
((self as Form) as Armor).RemoveSlotFromMask(0x00000002) doesn't work.
Error: Cannot call RemoveSlotFromMask() on a None object, aborting function call
Edit: LOL nevermind. I should have stored the return value then called SetSlotMask
Edit again: Nevermind again. That doesn't explain the error though.
I think that sorta worked, it's telling me I am removing potions the player does not actually have. Not sure why.
Using player.removeItem(allPotions, 99999, true, tempchest) would prevent messages from appearing.
Hmm, regarding the armor error, maybe you should try self.GetBaseObject().ArmorFunction() instead?
I understand that, what I am confused on is why when I do see the message it is saying that it is removing items the player does not have and sometimes in large quantities.
I have never seen those messages because I always use the setting to hide the message. I am assuming it's just a issue inherent in using form lists in the RemoveItem function and it's merely informing you of the attempt to remove them and not what's actually removed. In any case, I doubt there is anything that can be done to avoid the incorrect message while using a form list in the RemoveItem function.
I guess, I just found it strange, and I was a little worried. It seems to be working correctly, it's just odd.
self.GetBaseObject().RemoveSlotFromMask(0x00000002) won't compile.
Armor _armor_ = (self.GetBaseObject() as armor)
_armor_.RemoveSlotFromMask(0x00000002)
Gives errors:
Error: Unable to call GetBaseObject - no native object bound to the script object, or object is of incorrect type
Error: Cannot call RemoveSlotFromMask() on a None object, aborting function call
What does (self.GetBaseObject() as armor).RemoveSlotFromMask(0x00000002) do?
It's probably error seeing as (self.GetBaseObject() as armor) is returning None.
Self is just useless in this case and probably just useless.
I have to make the the item a property of itself.
Edit: and type the property as Armor
Edit Again: Armor Property _t_TZ_Test_Helmet Auto
What is your script extending? It will have to be extending ObjectReference for that to work (self must be of type ObjectReference).
It is extending ObjectReference.
Edit: Doesn't matter. I got the script to work as intended finally after wasting hours on "self" but it didn't work out like I wanted. I could really use a better understanding of this slot business.
What I am learning is that if you have an armor item with slots different than it's armor addon then the item will be invisible. Which begs the question what is http://www.gamesas.com/user/929079-asterra/ doing with slot masks that gets the results http://www.gamesas.com/topic/1499078-quick-questions-quick-answers-thread-36/page-7#entry23598222? I think that answer might prove helpful to me if only to help me understand the limitations of the engine.
Also it seems that there is slot information in the nif files and that the armor addon must also use the same slots as assigned in the nif.
I have tried making a helmet that uses slot 49 and it doesn't show up. The armor addon points to the nif file, so that's not it.
Is it even possible to have models take up the same space? How is that people talk about clipping at all?
Edit: I was incorrect about the "if you have an armor item with slots different than it's armor addon then the item will be invisible" I am not sure why I got the results I did, but I just made a the helmet work... sort of... Both the Helmet and it's armor addon use slot 49, but the armor uses only slot 49 wear the addon uses 31-Hair, 41, Longhair and 43 ears. These slots are what was used in the original vanilla armor addon (not 49 ofc). The problem is that it doesn't show up with another helmet equipped. I was trying to make an item that simply changes the look but has no armor value, while allowing one to wear armor (underneath).