||(if condition exp1 [exp2]) -> value of invoked expression
||condition: anything that evaluates to Nil or non-Nil
exp1: an expression that gets invoked if 'condition' evaluates to non-Nil (if it is 'true')
[exp2]: an optional expression that gets invoked if 'condition' evaluates to Nil (i.e. is 'false')
||Whatever the expression that gets invoked returns
||Basic branching function. Allows executing something only if a certain condition is met. A fundamental thing.
(if (eq (sysGetNode) "SE")
(objSendMessage gPlayerShip Nil "We are still in Eridani system")
(objSendMessage gPlayerShip Nil "We are on the journey to the core")
||It's hard to imagine a script of more than several functions which wouldn't contain some sort of branching, either with 'if' or 'switch' functions.