HudBarSetValueUDF

From GECK
Jump to: navigation, search
This article is incomplete. You can help by filling in any blank descriptions.
Further information might be found in a section of the discussion page. Please remove this message when no longer necessary.



A function added by the SUP NVSE Plugin.

Description

Hooks an UDF function to pass value to Bar's Meter value.

Syntax

[help]
(success:int) HudBarSetValueUDF barName:string myUDF:script iCalculateValueMax:int FunctionCaller:reference 

Or:

(success:int) HBSetValueUDF barName:string myUDF:script iCalculateValueMax:int FunctionCaller:reference

Example

HudBarSetValueUDF "barName" myUDF 0

Bar meter will take value from myUDF's function result.

HudBarSetValueUDF "barName" myUDF 0 PlayerRef.

Bar meter will take value from myUDF's function result. MyUDF will be called by PlayerRef(PlayerRef.call myUDF).


This is an UDF example. In this case value 344 will be passed.

Scriptname myUDF
begin function {}
   SetFunctionValue 344
end 

Notes

  • UDF should take no arguments (empty braces {}).
  • Function result will be turned into percentage using <MaxValue> if "iCalculateValueMax" is set to 1. If not - raw value will be passed.
  • Value will be updated each instance of Bar update("fUpdateTimer" trait).
  • <FunctionCaller> is an optional arguement. If present - function will be called from it. If absent - function will be called without a caller.
  • Be careful when passing paramater of non-persistent references(non-persistent NPC or Objects) because they might not be avaiable after calling.


See Also