GetUIFloat

From GECK

A function added by the Fallout Script Extender.

Description

Looks up a UI trait by name and returns its numeric value. The trait name is of the format "MenuName/ElementName/ElementName/.../TraitName" as defined in the XML hierarchy for the desired menu, i.e. "MessageMenu/NoGlow_Branch/MM_Title/x"

Syntax

(float) GetUIFloat traitName:string

Example

GetUIFloat "RepairServicesMenu/NOGLOW_BRANCH/RSM_MainRect/RSM_RepairList/RSM_RepairListTemplateRect:4/string"

Returns the name of the 4th item on the Repair Services menu.

GetUIFloat "BarterMenu/*:0/*:5/*:9/lb_scrollbar/_number_of_items"

Returns the number of items in the Barter menu.

Notes

  • In NVSE v1.0 b9 and later, the traitName argument to Get/SetUIFloat/String() has two new capabilities. A path segment of "*" matches any child tile, and a path segment suffix of ":N" matches the N'th child tile. This is useful when accessing list box items, where the tile names are either identical, or unpredictable, or both. It is also useful when working around the length limitation described below.

Bugs

  • When compiling a script in the GECK, the GECK will hang or crash if the trait name string is more than 54 characters long. The NVSE team suggests this is due to a buffer overflow in Bethesda's script parser, similar to bugs that the team found and patched in Oblivion.

See Also

Personal tools