scarycave Posted October 3, 2012 Share Posted October 3, 2012 I'm trying to get an Ai package working where an actor gets a random item, then run a different package.Npc picks up the nearest weapon (Does not equip), then walks off. Picture an angry mob going to a weapon rack and then storming off after mud-crabs or something. Link to comment Share on other sites More sharing options...
kingtitan Posted October 4, 2012 Share Posted October 4, 2012 Use this mod. Probably one of the more useful spells for checking companions and NPC Ai. http://oblivion.nexusmods.com/mods/17497 Link to comment Share on other sites More sharing options...
Oblis Posted October 4, 2012 Share Posted October 4, 2012 I m using GetItemCount to check if an npc carries and item.Use it in a if statement. Here is an example: if NPC.GetItemCount NPCClassWarriorToken == 0 ; Checks If the npc doesnt have the token in his inventory .... .... endif if NPC.GetItemCount NPCClassWarriorToken == 1 ; Checks If the npc has the token in his inventory .... .... endif Link to comment Share on other sites More sharing options...
scarycave Posted October 6, 2012 Author Share Posted October 6, 2012 Is the token something that has to be added manually? I'm trying to get it for a package to work. If the actor doesn't have a weapon I have him run a find any weapon package. I want the Npc to run a new package once he has the weapon. Link to comment Share on other sites More sharing options...
WarRatsG Posted October 9, 2012 Share Posted October 9, 2012 If you mean any weapon at all, you could use "GetEquippedObject 16 != 0". This would check if they have a weapon actually equipped, but is not a surefire way of knowing if they are carrying an unequipped weapon. The only 100% successful method I can think of is Inventory Ref-Walking. You will need to know how to use a ForEachstatement and study up on your inventory references ;) Link to comment Share on other sites More sharing options...
scarycave Posted October 10, 2012 Author Share Posted October 10, 2012 (edited) It worked like a charm. (:D)Thanks guys. I just need to find a way to get the packages to work properly now. I have it set up so if GetFactionRank dummyfinditemfaction > 0 && GetFactionRank dummyfinditemfaction < 4 set pCont to Self set invPos to 0 set invCount to pCont.GetNumItems While invPos < invCount set pInvObj to (pCont.GetInventoryObject invPos) set invPos to invPos + 1 Loop if (pInvObj.IsWeapon == 1 || pInvObj.IsArmor ==1 || pInvObj.IsAmmo == 1) SetFactionRank dummyfinditemfaction 4 Evp endif Endif The problem is keeps doing the same package over and over, the return package never runs. Edited October 10, 2012 by scarycave Link to comment Share on other sites More sharing options...
Recommended Posts