I made a custom conditional script (which I've tested & seen that it functions properly) the other day. Before my question, I'll post my original script.
int StartingConditional()
{
int iAppearance = GetScriptParameter(1);
if ( GetAppearanceType(OBJECT_SELF) == iAppearance ) return TRUE;
return FALSE;
}
For a certain dialog in a TSL mod I'm doing, I want it to return true if OBJECT_SELF's appearance is P1, P2 or P3. Can anyone show me how I would do that? I would very much appreciate it.
Hi, you're on the right track. :)
Here's an explicit way of phrasing the code:
int StartingConditional()
{
int iAppearance1 = GetScriptParameter(1);
int iAppearance2 = GetScriptParameter(2);
int iAppearance3 = GetScriptParameter(3);
if ( GetAppearanceType(OBJECT_SELF) == iAppearance1 ) return TRUE;
if ( GetAppearanceType(OBJECT_SELF) == iAppearance2 ) return TRUE;
if ( GetAppearanceType(OBJECT_SELF) == iAppearance3 ) return TRUE;
return FALSE;
}
Or if you want to scrunch it down:
int StartingConditional()
{
int iAppearanceSelf = GetAppearanceType(OBJECT_SELF);
return (iAppearanceSelf == GetScriptParameter(1) ) ||
(iAppearanceSelf == GetScriptParameter(2) ) ||
(iAppearanceSelf == GetScriptParameter(3) );
}