Individual SlotMasks in an accumulated SlotMask

Post » Tue Nov 20, 2012 7:01 am

I was wondering if there is a convenient way to find this?

The purpose is to see if an item's slots are already taken up by an item in an array. So in the end, every item in the array can be equipped at the same time.

I was able to do it with some math, but it is a taxing formula be computed through several items.

This will spit out what individual slots are in the total slotmask of the armor.

Spoiler
int totalslot = Armor_.GetSlotMask()int s = 0While s < 32  int slot = math.pow(2,s)  If totalslot == slot	debug.notification(s) ;;; The total slot only contains one individual slot     s = 32  elseif totalslot >= slot	int test = (totalslot / slot) - ((totalslot % slot) / slot)	If test % 2 != 0	  debug.notification(s) ;;; The total slot contains this individual slot	endif  else	s = 32 ;;; The slot is greater then the total slot  endifs += 1endwhile

As I said its a bit taxing to run and it seems there would be a better way out there.

Thanks in advance
User avatar
jessica robson
 
Posts: 3436
Joined: Mon Oct 09, 2006 11:54 am

Return to V - Skyrim