irswat Posted July 15, 2017 Share Posted July 15, 2017 Say I have 50 unique items and when anyone of these items are found I want to flag them as found. I assume I would use an OnItemAdded event and use some type of inventory filter, but what is the most efficient way to do this? I don't want the script running constantly, and I don't want the script wasting time detecting anything except these 50 items. Suggestions? Another option I was considering was a small script using OnItemRemoved and then attaching it to the containers that the items are in. Is this the best way? Link to comment Share on other sites More sharing options...
XN0X0neX Posted July 15, 2017 Share Posted July 15, 2017 (edited) At first glance the only two ways to do this effectively would be to set up a quest then use either a global variable or register forupdate papyrus scripts attached to the items. Thats just my guess though. Prolly attach them to 50 different stages in the quest and just have the items register the update to the quest through script on itemadded then a getitemcount script like u mentioned. This is just a guess though dont take my advice to heart. Edited July 15, 2017 by XN0X0neX Link to comment Share on other sites More sharing options...
foamyesque Posted July 15, 2017 Share Posted July 15, 2017 Is it only the player picking these things up you're concerned about? E.g. if one of these unique items is a weapon and an NPC grabs it, you don't want to bother? And that you don't care if the player then drops it and picks it up again? My solution would be a quest alias on the player, with an inventory filter that updates whenever one of the items is picked up, thereby removing it from future consideration. There's a few ways to implement that. I'd try this one: 1. Because the CK doesn't like Form as a property, pass the stuff in with a FormList. OnInit, add an inventory filter based on that. That should guarantee that only the items you're interested in fire the event. Then change the script state to a listening one.2. Create an OnItemAdded event in the listening state. Do a sanity check to make sure the added form is in fact in the FormList, via HasForm. If it is, remove the inventory filter for that item and increment a counter.3. If that counter is the same size (or greater, in case of oddities!) as the size of the FormList, clear the alias. Link to comment Share on other sites More sharing options...
irswat Posted July 16, 2017 Author Share Posted July 16, 2017 thanks, I did throw all the items into a formlist and added an inventoryeventfilter with the form list oninit. I will flip a switch and remove the form from the form list. It's a treasure hunt so you only need to find the item once. These items are being displayed in a dynamic book/checklist which also contains clues. Link to comment Share on other sites More sharing options...
irswat Posted July 16, 2017 Author Share Posted July 16, 2017 here is the list I came up with:Alvante's GlovesAlvante's Hood (x2)Apron of the Master ArtisanBirthright of Astalon (x2)Black BendBlackwoord Ring of SilenceBoots of the Swift MerchantBrusef Amerlion's ArmorBrusef Smelion's BootsBrusef Amelion's GauntletsBrusef Amelion's HelmetBrusef Amelion's ShielfCirclet of OmnipotenceCirclet of VerdureCowl of the DruidDondoran's JuggernautDraconian MadstoneEscutcheon of ChorrolEye of SithisHands of Midnight (x2)Hands of the AtronachHelm of FerocityJewel of the RumareKnight of the Chorrol ArmorKnight of the Chorrol ShieldNPC BootsNPC Ebony ArmorNPC GauntletsNPC HelmetNPC ShieldQuicksilver Boots (x3)Rasheda's SpecialRing of DesiccationRing of Detect LifeRing of Eidolon's EdgeRing of the GrayRing of the OceanbornRing of the Vipereye (x3)Ring of TransmutationRing of WortcraftRobe of CreativitySorcerer's RingThe Deceivers FineryThe Deceivers Finers Worn Over Leather ArmorThe Deceivers Finers Worn Over Steel ArmorTower of the Nine (x2)Veil of the SeerWorn Ebony BootsWorn Ebony GauntletsWorn Ebony HelmetAkaviri SunderbladeAntique CutlassBattleaxe of HatredBlackwater BladeBlackwater Blade ReforgedBrusef Amelion's SwordCalliben's Grim RetortCaptain Kordan's SaberCursed Honorblade of ChorrolDagger of DisciplineFirst Mate's ScimitarFrostwyrmHatreds HeartHatreds SoulHonorblade of ChorrolRedwave (x3-RockshatterShadowhuntSinweaverSufferthornWitsplinterCaptain Rein's SkullDrained Sigil StoneTwo-Headed Septim Link to comment Share on other sites More sharing options...
irswat Posted July 16, 2017 Author Share Posted July 16, 2017 is the apocalypse armor from your mod? it starts with 000 Link to comment Share on other sites More sharing options...
foamyesque Posted July 16, 2017 Share Posted July 16, 2017 thanks, I did throw all the items into a formlist and added an inventoryeventfilter with the form list oninit. I will flip a switch and remove the form from the form list. It's a treasure hunt so you only need to find the item once. These items are being displayed in a dynamic book/checklist which also contains clues. You can't remove editor-added forms from a formlist, only script-added ones. That's why I used a counter. If you want to drive a book/checklist, you can create a second, empty formlist (or an array, but formlists tend to work better for passing information to various CK systems) and add the found forms to it as they're processed. Link to comment Share on other sites More sharing options...
irswat Posted July 16, 2017 Author Share Posted July 16, 2017 In a moment of clarity last night I decided against removing items from the formlist when they are found, but I can't remember why lol Link to comment Share on other sites More sharing options...
Recommended Posts