Jump to content

can't get npc's to equip items


theuseless

Recommended Posts

I'm trying to make it so that an npc in my mod equips a certain item. I wish for this npc to wear the item, one of the meshes from Alexander's Wings. I have looked into the scripting functions list and can't figure out anything better than the following code:

 

scn AlexanderWingsEquipScript

ref tempRef
ref wings

begin onLoad

set tempref to getcontainer
set wings to getself

if tempref != player

tempref.equipitem wings

endif

end

 

It doesn't work. I can't figure out how to make the codes work properly. If anybody has help or ideas that point me in the right direction, kudos will be given.

 

I would like to make it so that the script is uniform for any object. I was trying to call the getself function but can't figure out if it works or not. None of the scripts that I have tried to write work and I have searched high and low for an answer here on the forums.

 

-edit-

 

I will gone from the real world for a week or two but will definitely give kudos when I get back to any and all contributors. I will also PM the author of Alexander's Wings, Alexander Wolf, and let him know that the final script was attributed to any contributors.

Link to comment
Share on other sites

First, are the wings actually part of the same plugin that your NPC is part of? If not, your NPC will never equip them because you can't use items from one mod in another without going through Mod De-Isolation. Second, what is your script attached to? Third, What kind of item is this set up as? If you set the wings item up as an Amulet and give it an enchantment, your NPC should equip it without scripting being necessary.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...