Compatible With ScriptsCompatible With ExpressionsCompatible With The Command Line

 

double oldif (int condition, double returnIfTrue, doublereturnIfFalse )

 

Return Value: If condition equals 0 then returnIfFalse is returned, otherwise returnIfTrue is returned.

 

Arguments:

condition

expression to evaluate
returnIfTrue value to return if condition does not equal 0
returnIfFalse value to return if condition does equal 0
 

This function used to be called 'if' in project:messiah. However 'if' was needed for scripting so now 'oldif' is used instead. Legacy files loaded into messiah:animate or messiah:studio will automatically have all 'if's replaced with 'oldif's. 

 

oldif has a problem that the old 'if' had, this problem was intentionally preserved to maintain backwards compatibility. If a function is used for the two return values, BOTH will be called regardless the value of condition. In most cases this is undesired behavior, use 'cond' instead and only the appropriate function will be called.

 

Example:

Exp_1
|_oldif( NOW < 25, MoveTo(Null, Null_1, 1), MoveTo(Null, Null_2, 1)  )

The writer of the above expression probably intended the Null would be constrained to Null_1 until frame 26 when it would then be constrained to Null_2. However since both MoveTo's will be called regardless the value of condition, this expression will not have the desired results. If 'cond' was used instead of 'oldif' the expression would behave properly.

Converted from CHM to HTML with chm2web Pro 2.82 (unicode)