PDA

View Full Version : Outfitting script help ...


GeorgNihilus
03-06-2009, 06:54 PM
Hi folks :) I'm trying to check if a female exile is in her danceroutfit or her undies :xp: ... with something like this:

//:: c_pclightdre
/*
checks if a female exile is in her undies or her danceroutfit
*/
//:: Created By:

int StartingConditional() {
string sWearingThis;
string sShirtTag = GetScriptStringParameter();
object oWearingThis = GetItemInSlot(INVENTORY_SLOT_BODY, GetFirstPC());
int ix=-1;

if (GetIsObjectValid(oWearingThis)) {
sWearingThis=GetTag(oWearingThis);
ix=FindSubString(sWearingThis, "g_dancerou");
}

if (!GetIsObjectValid(oWearingThis) && GetGlobalBoolean("000_PLAYER_GENDER") == FALSE) { // underwear & female
return (sShirtTag=="");
}
return (0 || ix>-1); // or danceroutfit & female
}

it compiles clean and works properly for the underwear, but it does not detect the danceroutfit, at all, ignoring it (maybe problem is in that last return command, in red? in the turquoise if?).

Any ideas or just another script for this?? :yelhelp:

Star Admiral
03-06-2009, 08:10 PM
Try this one:

int StartingConditional() {
string sShirtTag = GetScriptStringParameter();
object oWearingThis = GetItemInSlot( INVENTORY_SLOT_BODY, GetFirstPC() );
if( GetIsObjectValid( oWearingThis ) ) {
if( GetTag( oWearingThis ) == sShirtTag )
return TRUE;
}
return FALSE;
}

It returns true if the item the PC is wearing matches the tag that is passed in from the string parameter.

- Star Admiral

Ferc Kast
03-06-2009, 08:51 PM
I just made an alternative solution for your script from a conditional I made the other day.

int StartingConditional() {
int Item = GetScriptParameter(1);
string sShirtTag;
object oWearingThis = GetItemInSlot( INVENTORY_SLOT_BODY, GetFirstPC() );

if (GetIsObjectValid(oWearingThis) && GetGlobalBoolean("000_PLAYER_GENDER") == FALSE) {
switch(Item){
case 0:
// if wearing nothing
sShirtTag = "";
break;
case 1:
// if wearing the Dancer's Outfit
sShirtTag = "DancersOutfit";
break;
case 2:
// if wearing something else
sShirtTag = GetScriptStringParameter();
break;
}
}
if( GetTag( oWearingThis ) == sShirtTag ) return TRUE;
return FALSE;
}

If you set P1's value to 0, it'll check to see if nothing is being worn by the PC. If you set P1's value to 1, it'll check to see the PC is wearing the Dancer Outfit. (You had the wrong tag for the Dancer Outfit in your script, which may be the only thing that was wrong with your script.)

GeorgNihilus
03-07-2009, 01:55 PM
Thanks guys! :D both scripts work ... although the second is working for both undies and danceroutfit which is what I prefer. And yes Ferc, tag was wrong, I typed in the file name ... clumsy me ... :xp: but even fixing that my script doesn't work.

Thanks again ... good modding! :thmbup1: