Everything nwnscript is event based.
So you have identified that the event / trigger you want is when an item is added to a container.
This event is specifically referred to as the OnDisturbed event of a container.
// put this OnDisturbed of a container.
void main()
{
object oItem=GetInventoryDisturbItem();
object oPC=GetLastDisturbed();
int nType=GetInventoryDisturbType();
switch (nType)
{
case INVENTORY_DISTURB_TYPE_ADDED:
//Put your identify code here
SetIdentified(oItem,TRUE);
//End of Identify code
break;
case INVENTORY_DISTURB_TYPE_REMOVED:
break;
case INVENTORY_DISTURB_TYPE_STOLEN:
break;
}
}
So there is 3 main ways inventories can be disturbed.
items added, removed, or stolen.
I've assumed you wanted this to fire when items are added- as seen above.
Because identification is a single routine/function call, I wouldn't really worry about the checking to see if the item is identified already or not.
If its already identified, is it really so bad that we re-identify it?
http://www.nwnlexico...e=SetIdentified
nwnlexicon might be slightly out dated, but its still your friend.
I recommend it for reference.
Even people who are script guru's refer to it, as the nwnscript language is much to large for anyone person to remember it all.