Difference between revisions of "SetFunctionValue"
Jump to navigation
Jump to search
imported>Odessa (created) |
imported>Odessa (clarified, fixed typo) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
|origin = NVSE | |origin = NVSE | ||
|summary = Added by NVSE V4. Used only within the 'Function' block type of a [[User Defined Function]], sets the return value to | |summary = Added by NVSE V4. Used only within the 'Function' block type of a [[User Defined Function]], sets the return value to that specified. A UDF may return only a single value, but it may be of any type, including an array. | ||
|name = | |||
|returnType = | If the function is called multiple times in the same function, the most recent is used by the call; this function is not a substitute for the keyword 'return', script execution will continue to the end of the block as normal. | ||
|name = SetFunctionValue | |||
|returnType = None | |||
|arguments = | |arguments = | ||
{{FunctionArgument | {{FunctionArgument | ||
|Name = | |Name = UDFReturnValue | ||
|Type = | |Type = multi}} | ||
}} | }} | ||
==Example== | ==Example== | ||
Line 25: | Line 25: | ||
SetFunctionValue 1 | SetFunctionValue 1 | ||
elseif PlayerREF.GetAV Strength > 5 | elseif eval (PlayerREF.GetAV Strength > 5) | ||
SetFunctionValue 1 | SetFunctionValue 1 | ||
Revision as of 00:28, 28 May 2014
< [[::Category:Functions|Category:Functions]]
A function added by the New Vegas Script Extender.
Description
Added by NVSE V4. Used only within the 'Function' block type of a User Defined Function, sets the return value to that specified. A UDF may return only a single value, but it may be of any type, including an array.
If the function is called multiple times in the same function, the most recent is used by the call; this function is not a substitute for the keyword 'return', script execution will continue to the end of the block as normal.
Syntax
(None) SetFunctionValue UDFReturnValue:multi
Example
Begin Function { } SetFunctionValue SunnyREF ; * this function simply returns Sunny Smiles End
Begin Function { } if GameHour > 12 SetFunctionValue 1 elseif eval (PlayerREF.GetAV Strength > 5) SetFunctionValue 1 else SetFunctionValue 0 endif ; * return true if it is after midday or player has more than 5 strength End