... I just don't understand the meaning of the return TRUE; return FALSE: thing. Could somebody please pound this into my thick head ?
Ed
int StartingConditional()
Above is a declaration for a function named StartingCondition that will return an integer value. The integer value that the label (StartingConditional) will be equal to, AT any given time, will be the value returned by the code that it runs.
Lets look at the rest of the code in this manner.
{
object oPC = GetPCSpeaker();
above an object labeled oPC is being defined. To it is being assigned the object that is being returned by the code block that is labeled GetPCSpeaker.
object oBars = GetItemPossessedBy(oPC,"RoyalGoldBars");
An object named oBars is being defined and given a value of the object being returned by the GetItemPossessedBy code block.
object oCups = GetItemPossessedBy(oPC,"PugilistTrophies");
An object named oCups is defined to be equal to the value returned by the GetItemPossessedBy function.
if(GetIsObjectValid(oBars))
return TRUE;
if the integer returned by the GetIsObjectValid function is true. Return TRUE as the value of StartingConditional. This will also stop the rest of the script from running.
if(GetIsObjectValid(oCups))
return TRUE;
Again we are doing the same thing as above. if the integer returned by the GetIsObjectValid is true. TRUE is returned as the value for StartingConditional and code execution is returned to the calling code.
return FALSE;
none of the code above this statment has returned given a value to StartingConditional therefore a value of FALSE will be given to it.
}
I hope that helps. FALSE is a compiler constant defined as 0
TRUE is a compiler constant defined as 1