I have this block of code in my OnUnEquip module event:
if (GetBaseItemType(oItem) == BASE_ITEM_ARROW || BASE_ITEM_BOLT || BASE_ITEM_BULLET || BASE_ITEM_SHURIKEN || BASE_ITEM_THROWINGAXE) //Check if the last unequipped is a projectile weapon of any kind.
{
//Get Item Properties and declare them as ints to be called by IPGetItemHasProperty later in the equip script. ignore temporaries because they add too many variables.
itemproperty iProperty = GetFirstItemProperty(oItem)
while(GetIsItemPropertyValid(iProperty))
{
int iPropertyType1 = GetItemPropertyType(iProperty); //The general idea here is that every loop through, this codeblock will declare individual ints for every
int iPropertySubType1 = GetItemPropertySubType(iProperty); //item property and it's subtype, checking against the last declared one to make sure they are not the same.
int iPropertyParam1 = GetItemPropertyParam1(iProperty);
int iPropertyParam1Value = GetItemPropertyParam1Value(iProperty);
SendMessageToPC(oPC, IntToString(iPropertyType1));
SendMessageToPC(oPC, IntToString(iPropertySubType1));
SendMessageToPC(oPC, IntToString(iPropertyParam1));
SendMessageToPC(oPC, IntToString(iPropertyParam1Value));
if(iPropertyType1)
{
int iPropertyType2 = GetItemPropertyType(iProperty);
int iPropertySubType2 = GetItemPropertyType(iProperty);
int iPropertyParam2 = GetItemPropertyParam1(iProperty);
int iPropertyParam2Value = GetItemPropertyParam1Value(iProperty);
SendMessageToPC(oPC, IntToString(iPropertyType2));
SendMessageToPC(oPC, IntToString(iPropertySubType2));
SendMessageToPC(oPC, IntToString(iPropertyParam2));
SendMessageToPC(oPC, IntToString(iPropertyParam2Value));
if(iPropertyType2)
{
int iPropertyType3 = GetItemPropertyType(iProperty);
int iPropertySubType3 = GetItemPropertyType(iProperty);
int iPropertyParam3 = GetItemPropertyParam1(iProperty);
int iPropertyParam3Value = GetItemPropertyParam1Value(iProperty);
SendMessageToPC(oPC, IntToString(iPropertyType3));
SendMessageToPC(oPC, IntToString(iPropertySubType3));
SendMessageToPC(oPC, IntToString(iPropertyParam3));
SendMessageToPC(oPC, IntToString(iPropertyParam3Value));
if(iPropertyType3)
{
int iPropertyType4 = GetItemPropertyType(iProperty);
int iPropertySubType4 = GetItemPropertyType(iProperty);
int iPropertyParam4 = GetItemPropertyParam1(iProperty);
int iPropertyParam4Value = GetItemPropertyParam1Value(iProperty);
SendMessageToPC(oPC, IntToString(iPropertyType4));
SendMessageToPC(oPC, IntToString(iPropertySubType4));
SendMessageToPC(oPC, IntToString(iPropertyParam4));
SendMessageToPC(oPC, IntToString(iPropertyParam4Value));
if(iPropertyType4)
{
int iPropertyType5 = GetItemPropertyType(iProperty);
int iPropertySubType5 = GetItemPropertyType(iProperty);
int iPropertyParam5 = GetItemPropertyParam1(iProperty);
int iPropertyParam5Value = GetItemPropertyParam1Value(iProperty);
SendMessageToPC(oPC, IntToString(iPropertyType5));
SendMessageToPC(oPC, IntToString(iPropertySubType5));
SendMessageToPC(oPC, IntToString(iPropertyParam5));
SendMessageToPC(oPC, IntToString(iPropertyParam5Value));
}
}
}
}
iProperty = GetNextItemProperty(oItem); //Loop over.
}
}
}
The goal for this code is to prevent the loop from overwriting any of the declared ints, so that each integer matches an individual property (And property subtype, and param1 and param1value). However in testing I noticed this:
The item tested has the following properties:
Unfortunately, this presents a roadblock in what I intended to do with this script: compare the values obtained from each individual property to compare against the properties on other items later.
Can anyone tell me if I am implementing this code wrong, if I've run into an engine bug of some kind, or if there are workarounds to dodge this '225'??
Cheers!
-JediMindTrix
EDIT: I realized shortly after posting this that the SendMessageToPC's should've all been in the final if statement, so I moved them and added a break; It appears that as I had hoped, nothing was being overwritten.