Picked this off the Omnibus but it's not working. I'm looking to destroy any item in the inventory of the player that starts with "emma". So one item is tagged "emma512345", another "emma5345", etc. As the player finds torn diary pages, the OnAquired event fires, and removes the mentioned above tagged items with an updated diary book.
Rather than posting the entire OnAquire event, I've just included what I found posted by Jassper and inserted where I require it.
object oRemove = GetFirstItemInInventory(GetFirstPC());
while(GetIsObjectValid(oRemove))
{
if(GetStringLowerCase(GetStringLeft(GetTag(oRemove),4)) == "emma")
DestroyObject(oRemove);
oRemove = GetNextItemInInventory();
}
Everything before and after the loop works when the item is aquired, but the already existing tagged items in the inventory starting with "emma" are not destroyed.
No clue why.
Thanks,
FP!