Jump to content

khmp

Supporter
  • Posts

    25
  • Joined

  • Last visited

Everything posted by khmp

  1. Neophyte to papyrus scripting would be an understatement. Gleaning as I go. Not knowing enough and still plunging into the dark unknown. I am attempting to make a generic sorting routine for items. Similar to the Schoolhouse Base mod by Mike Hancho, et al of course. While I love them and the idea behind them - I wanted to go a bit deeper. Something that is "mostly generic" and by only being given an item's properties, sort it effectively. For example: "Ah that's Super Bouncing Stretch Armstrong Mk2 from Mk2 Destructo mod. The Form ID says it's a weapon and more specifically a mine. Let me put that in the mine box. No need for a form list or prior knowledge of the mod's existence to get that stuff on lock." If this has been done before can you point the way otherwise please continue reading. My question: Is there an easy way to determine whether or not the object you are looking at (rCurrentObject in the code) is equipped on your character? That's the gist of my issue. Here's the relevant snippet: short nPos ; Position in the container through which we are iterating short nFormItemType ; Type of the item we are currently on during iteration (Form Type ID) ref rCurrentObject ; The current object we are looking in the player's inventory set nPos to player.GetNumItems while (nPos) ; Define the position thereby the object we want to examine let nPos -= 1 set rCurrentObject to player.GetInventoryObject nPos set nFormItemType to GetType rCurrentObject ; Form Type ID comparison tests if (nFormItemType == 24) ; Armor Check ; Are we wearing this piece of armor? ;... endif loopMy fear is that I will have to compare the object against each equipment slot (20) for each and every item that is considered armor. While certainly doable I cringe at long potentially unnecessary if elseif elseif elseif...zzz statements. I figured I would ask for advice before going to sleep and cross my fingers. If you see something out of place please feel free to correct or question. :blush: <- guarded optimist?
  2. has not set their status
×
×
  • Create New...