Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Conditional script question

Page: 1 of 1
 Ferc Kast
10-28-2008, 8:01 PM
#1
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.
 tk102
10-28-2008, 11:52 PM
#2
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) );
}
Page: 1 of 1