C4 Engine Terathon Software C4 Engine API Documentation

• Controller System

API Links
Developer Links

Method::SetOutputValue

Defined in:  C4Methods.h
Sets the output value for a method.
Prototype

void SetOutputValue(const ScriptState *state, bool v);

void SetOutputValue(const ScriptState *state, long v);

void SetOutputValue(const ScriptState *state, float v);

void SetOutputValue(const ScriptState *state, const char *v);

void SetOutputValue(const ScriptState *state, const ColorRGBA& v);

void SetOutputValue(const ScriptState *state, const Vector3D& v);

Parameters
state A pointer to the current script state.
v The output value for the method.
Description
The SetOutputValue function sets the output value for a method. This function should be called from within the overridden Method::Execute function for script methods that need to specify an output value. The output value is stored in the method's output variable (after a possible type conversion) if the output variable has been specified and exists in the script. Otherwise, the output value is simply discarded. In any case, the method's boolean result is automatically set by converting the output value to a boolean value.

The state parameter should be set to the same value passed into the state parameter of the Method::Execute function.
See Also

Method::SetMethodResult

Method::Execute