PDA

View Full Version : To check a robe from other's dialog


GeorgNihilus
06-28-2008, 04:01 PM
Hi again :D ... now I try to check if the handmaiden is wearing certain robe, but not from her default dialog (handmaiden.dlg) but from an NPC dialog. The default game script to check worn robes may be this:

// c_obj_worn_body: Check if OBJECT_SELF is wearing ItemByTag in Body slot.
// INPUT: string param - tag of armor
// BMA-OEI 8/9/2004

int StartingConditional()
{
string sItem = GetScriptStringParameter();
object oItem = GetObjectByTag(sItem);
if ( GetIsObjectValid(oItem) )
{
if ( GetItemInSlot(INVENTORY_SLOT_BODY, OBJECT_SELF) == oItem )
{
return TRUE; // Item exists and is equipped in Body slot.
}
}
return FALSE;
}

but only checks the OBJECT_SELF ... I changed it to this but it didn't work either ... (in red, changes)

// c_obj_worn_bodh: 'should' check if the Handmaiden is wearing ItemByTag in Body slot.
// INPUT: string param - tag of armor

int StartingConditional()
{
string sItem = GetScriptStringParameter();
object oItem = GetObjectByTag(sItem);

if ( GetIsObjectValid(oItem) )
{
if ( GetItemInSlot(INVENTORY_SLOT_BODY, GetObjectByTag("Handmaiden")) == oItem )
{
return TRUE; // Item exists and is equipped in Body slot.
}
}
return FALSE;
}

so ... how can I 'see' if she has for example a danceroutfit outside the handmaiden dialog?? :(

thanks on advance people! :)

stoffe
06-28-2008, 07:11 PM
Hi again :D ... now I try to check if the handmaiden is wearing certain robe, but not from her default dialog (handmaiden.dlg) but from an NPC dialog.
so ... how can I 'see' if she has for example a danceroutfit outside the handmaiden dialog?? :(

You can check the tag of what the Handmaiden has in her body slot and see if it matches the tag of the dancer outfit. That makes it somewhat more reliable if there is more than one object with the same tag in the game world. Otherwise it might not find the correct one to check. Like:

int StartingConditional() {
object oHand = GetObjectByTag("Handmaiden");

if (!GetIsObjectValid(oHand))
return FALSE;

return (GetTag(GetItemInSlot(INVENTORY_SLOT_BODY, oHand)) == "DancersOutfit");
}

GeorgNihilus
07-03-2008, 08:29 PM
Excellent! :D the kind of script I needed ... thanks.

very helpful as usual ... :) good modding ...