I have a situation where a character has 3 sorts of clothes. I want to check what the character is wearing at the moment and store that for checking later. For some odd reason it doesn’t work as intended. The character has all the clothes in the inventory and is wearing one of the 3 clothes. However, when testing I get the message: “Lania doesn’t have the clothes”? Why is this? Am I using the GetItemInSlot function the wrong way? In that case, is there some other way to do this? (I already tried removing all the ClearAllActions to no effect)
Here’s my script (with my debug messages):
#include "ginc_companion"
void NotSelectable()
{
RemoveRosterMember("leniac");
//SetIsRosterMemberSelectable("leniac",FALSE);
}
void JumpLania(object oLania)
{
object oDestination = GetObjectByTag("laniastoragewp");
AssignCommand(oLania,ClearAllActions());
AssignCommand(oLania, JumpToObject(oDestination));
}
void main()
{
object oPC = GetFirstPC();
object oLania = GetObjectByTag("leniac");
object oWP = GetObjectByTag("acportalwp");
object oDestination = GetObjectByTag("laniastoragewp");
object oLaniaClothes = GetItemInSlot(INVENTORY_SLOT_CHEST,oLania);
object oLaniaClothing1 = GetObjectByTag("leniacloth1");
object oLaniaClothing2 = GetObjectByTag("leniacloth2");
object oLaniaClothing3 = GetObjectByTag("leniacloth3");
if(oLaniaClothes == oLaniaClothing1)
{
SendMessageToPC(oPC,"Lania clothes 1");
SetGlobalInt("LaniaClothLabyrinth1",1);
}
else if(oLaniaClothes == oLaniaClothing2)
{
SendMessageToPC(oPC,"Lania clothes 2");
SetGlobalInt("LaniaClothLabyrinth2",1);
}
else if(oLaniaClothes == oLaniaClothing3)
{
SendMessageToPC(oPC,"Lania clothes 3");
SetGlobalInt("LaniaClothLabyrinth3",1);
}
else
{
SendMessageToPC(oPC,"Lania doesn't have the clothes");
}
//SetIsRosterMemberSelectable("leniac",TRUE);
DelayCommand(0.2,AssignCommand(oLania,ClearAllActions()));
//DelayCommand(0.3,AssignCommand(oLania, ActionForceMoveToObject(oWP)));
DelayCommand(2.5,NotSelectable());
//DelayCommand(3.0, SetScriptHidden(oLania,TRUE));
DelayCommand(3.0, JumpLania(oLania));
}