Global
Global functions that are not part of a class or object are listed here. Be sure to check what game modes they are loaded in before use, as not all of them will be loaded in campaign, battle or the frontend.
-
script_error(messagestring, [stack level modifiernumber], [suppress assertboolean]) -
Throws a script error with the supplied message, printing the lua callstack to the
Luaconsole output spool. Useful for debugging.Parameters:
1
Message to print.
2
optional, default value=0
By default this function will print the callstack of the calling function. A modifier may be supplied here to alter which function in the callstack should be at the top of the callstack. A positive integer moves the callstack pointer down the callstack, so a supplied value of
1here would mean the callstack of the function calling the function callingscript_errorwould be printed.If the stack level modifier is set to a negative number then no traceback is printed as part of the script error. This can be useful if the error message itself contains a traceback.
3
optional, default value=false
If set to
truethen no assert is generated with this script error.Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/all_scripted.lua, line 31
-
out(stringoutput) -
outis a table that provides multiple methods for outputting text to the various available debug console spools. It may be called as a function to output a string to the mainLuaconsole spool, but the following table elements within it may also be called to output to different output spools:
- grudges
- ui
- chaos
- traits
- help_pages
- interventions
- invasions
- design
out supplies four additional functions that can be used to show tab characters at the start of lines of output:
Tab levels are managed per output spool. To each of these functions a string argument can be supplied which sets the name of the output spool to apply the modification to. Supply no argument or a blank string to modify the tab level of the main output spool.Function Description out.inc_tabIncrements the number of tab characters shown at the start of the line by one. out.dec_tabDecrements the number of tab characters shown at the start of the line by one. Decrementing below zero has no effect. out.cache_tabCaches the number of tab characters currently set to be shown at the start of the line. out.restore_tabRestores the number of tab characters shown at the start of the line to that previously cached. Parameters:
1
stringoutput
Returns:
nil
Example - Standard output:
out("Hello World")
out.inc_tab()
out("indented")
out.dec_tab()
out("no longer indented")
Hello World
indented
no longer indented
Example - UI tab:
Output to the ui tab, with caching and restoring of tab levelsout.ui("Hello UI tab")
out.cache_tab("ui")
out.inc_tab("ui")
out.inc_tab("ui")
out.inc_tab("ui")
out.ui("very indented")
out.restore_tab("ui")
out.ui("not indented any more")
Hello UI tab
very indented
not indented any more
Loaded in Frontend
defined in ../../warhammer/working_data/script/all_scripted.lua, line 144
-
force_require(stringfilename) -
Forceably unloads and requires a file by name.
Parameters:
1
stringfilename
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/all_scripted.lua, line 422
-
load_script_libraries() -
One-shot function to load the script libraries.
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/all_scripted.lua, line 431
-
is_custom_type(objecttable, valuecustom type) -
Returns true if the supplied value is of the supplied custom type. This is not intended to be directly called by client scripts, who should instead call one of the is_
functions listed elsewhere. Parameters:
1
object
2
valuecustom type
Returns:
is custom typeboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 97
-
get_custom_type(objecttable) -
Returns the custom type value of the supplied value. If it has no custom type then
nilis returned.Parameters:
1
object
Returns:
valuecustom type, ornil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 107
-
set_class_custom_type(class tabletable,custom typestring) -
Sets a supplied class table to the supplied type string by setting its
__custom_typevalue. Once this is set, other object tables that are later set to derive from this class withset_object_classwill report this custom type when passed toget_custom_typeoris_custom_type.Parameters:
1
class table
2
custom type
Returns:
nil
Example:
TYPE_RABBIT = "rabbit"
-- class definition
rabbit = {}
set_class_custom_type(rabbit, TYPE_RABBIT)
-- object definition
thumper = {}
set_object_class(thumper, rabbit)
out("thumper custom type is " .. get_custom_type(thumper)
thumper custom type is rabbit
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 118
-
set_class_tostring(class tabletable,custom typestring) -
Sets the tostring value of a supplied class table to the specified value by setting its
__tostringvalue. Once this is set, other object tables that are later set to derive from this class withset_object_classwill return this value when passed totostring().
The tostring specifier may be supplied as astringor afunction. If supplied as a function, that function will be called when thetostring()function is called with an object derived from the supplied class. The object will be supplied as a single argument to the tostring specifier function, which allows the tostring() value to be assembled at runtime and include elements such as the objects name, co-ordinates or other realtime information. The specifier function should return a string.
The default behaviour is for the generated string to be cached in the object table, at the__cached_tostringfield. Further calls totostring()will then return the cached string rather than regenerating it each time. If this is undesirable - for example if the generated string might change as the object changes state - then thedo_not_cacheflag may be set on this function.
The flag to not append the memory address may be set if the memory address of the table is not wanted on the end of the returned tostring value. The default behaviour is to append the memory address.Parameters:
1
class table
2
custom type
Returns:
nil
Example - Setting a function tostring specifier:
TYPE_CAT = "cat"
-- class definition
cat = {}
set_class_tostring(cat, function(cat_obj) return TYPE_CAT .. "_" .. cat_obj.name end)
-- object definition
cat_freddy = {name = "freddy"}
set_object_class(cat_freddy, cat)
out(tostring(cat_freddy))
cat_freddy: 000001C2B9D4E730
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 150
-
set_class_custom_type_and_tostring(class tabletable,custom type valuestring) -
Sets the custom type and tostring value on the supplied class table to the supplied string value. This function calls
set_class_custom_typeandset_class_tostringto do this.Parameters:
1
class table
2
custom type value
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 226
-
set_object_class(object tabletable,class tabletable, ...additional interfaces) -
Sets the supplied object to index from the supplied class in a manner that emulates object-orientation. This will set the class to be the metatable of the object and will set the
__indexfield of the metatable also to the supplied class. This means that if functions or values are looked up on the object and are not present they are then looked up on the class. It is through this kind of mechanism that object-orientation may be emulated in lua. Because the class is also the metatable, it means the metatable is shared between objects of the same type. Useset_object_class_uniqueif this is not desired.
set_object_classwill also associate the object with any custom type or tostring values that have been previously set up on the class with calls toset_class_custom_typeandset_class_tostring.
Any number of additional classes and objects may be specified, from which the main supplied object will also derive. If a value (such as a function to be called) is looked up on the object and is not provided on the object or the main class table it derives from, it will be looked up in turn on each additional classes or objects supplied. These additional objects/classes may betableoruserdatavalues.Parameters:
1
Object table.
2
Class table.
3
...Additional classes or objects to index.
Returns:
object
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 360
-
set_object_class_unique(object tabletable,class tabletable, ...additional interfaces) -
Sets the supplied object to index from the supplied class in a manner that emulates object-orientation. This will set up a metatable unique to this object and will set the
__indexfield of this metatable to the supplied class. This means that if functions or values are looked up on the object and are not present they are then looked up on the class. It is through this kind of mechanism that object-orientation may be emulated in lua. In contrast to object-to-class relationships set up withset_object_classthe metatable is not shared between objects of the same type, which is less memory-efficient but may be desirable in certain circumstances.
set_object_class_uniquewill also associate the object with any custom type or tostring values that have been previously set up on the class with calls toset_class_custom_typeandset_class_tostring.
Any number of additional classes and objects may be specified, from which the main supplied object will also derive. If a value (such as a function to be called) is looked up on the object and is not provided on the object or the main class table it derives from, it will be looked up in turn on each additional classes or objects supplied. These additional objects/classes may betableoruserdatavalues.Parameters:
1
Object table.
2
Class table.
3
...Additional classes or objects to index.
Returns:
object
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 373
-
set_class_metatable(class tabletable,metatabletable, [allow overwriteboolean]) -
Sets the metatable of the specified class table to the supplied table. This also sets the
__is_class_definitionfield in the metatable whichset_object_classuses internally to know the difference between a class definition (which has no concept of self) and an object definition (which does) in certain circumstances. This function is for use in specific situations where a class definition requires a metatable and objects derive from it.Parameters:
1
Class table.
2
Metatable.
3
optional, default value=false
Allow the overwriting of the metatable if one already exists.
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 386
The functions in this section can be used to check whether variables are a built-in type.
-
is_nil(valuevalue) -
Returns true if the supplied value is nil, false otherwise.
Parameters:
1
valuevalue
Returns:
is nilboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 437
-
is_number(valuevalue) -
Returns true if the supplied value is a number, false otherwise.
Parameters:
1
valuevalue
Returns:
is numberboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 446
-
is_function(valuevalue) -
Returns true if the supplied value is a function, false otherwise.
Parameters:
1
valuevalue
Returns:
is functionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 455
-
is_string(valuevalue) -
Returns true if the supplied value is a string, false otherwise.
Parameters:
1
valuevalue
Returns:
is stringboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 464
-
is_boolean(valuevalue) -
Returns true if the supplied value is a boolean, false otherwise.
Parameters:
1
valuevalue
Returns:
is booleanboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 473
-
is_table(valuevalue) -
Returns true if the supplied value is a table, false otherwise.
Parameters:
1
valuevalue
Returns:
is tableboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 482
-
is_userdata(valuevalue) -
Returns true if the supplied value is userdata, false otherwise.
Parameters:
1
valuevalue
Returns:
is userdataboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 491
The functions in this section can be used to check whether variables are specific arrangements of built-in types.
-
is_integer(valuevalue) -
Returns true if the supplied value is a whole number with no decimal component, or false otherwise.
Parameters:
1
valuevalue
Returns:
value is integerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 512
-
is_positive_number(valuevalue) -
Returns true if the supplied value is a number greater than 0, or false otherwise.
Parameters:
1
valuevalue
Returns:
value is positive numberboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 521
-
is_non_negative_number(valuevalue) -
Returns true if the supplied value is a number greater than or equal to 0, or false otherwise.
Parameters:
1
valuevalue
Returns:
value is non-negative numberboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 530
-
is_empty_table(valuevalue) -
Returns true if the supplied value is an empty table, or false otherwise.
Parameters:
1
valuevalue
Returns:
value is an empty tableboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 539
-
is_non_empty_table(valuevalue) -
Returns true if the supplied value is a table containing one or more values at any keys, or false otherwise. See also
is_non_empty_table_indexedwhich checks if the values are stored at numerical keys.Parameters:
1
valuevalue
Returns:
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 548
-
is_non_empty_table_indexed(valuevalue) -
Returns true if the supplied value is a numerically-indexed table containing one or more values, or false otherwise.
Parameters:
1
valuevalue
Returns:
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 565
-
is_table_of_strings(valuevalue) -
Returns true if the supplied value is a numerically-indexed table containing one or more string values, or false otherwise.
Parameters:
1
valuevalue
Returns:
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 582
-
is_string_or_table_of_strings(valuevalue) -
Returns true if the supplied value is a string, or a numerically-indexed table containing one or more string values. If the supplied value is neither of these types then false is returned.
Parameters:
1
valuevalue
Returns:
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 602
-
is_table_of_strings_allow_empty(valuevalue) -
Returns true if the supplied value is an empty table or a numerically-indexed table containing one or more string values, or false otherwise.
Parameters:
1
valuevalue
Returns:
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 626
-
is_condition(valuevalue) -
Returns true if the supplied value is a function or the boolean value
true. Event conditions in the scripting library commonly adhere to this format, where an event is received and the condition must either be a function that returns a result, or be the boolean value true. If the supplied value is nottrueor a function, then false is returned.Parameters:
1
valuevalue
Returns:
value is a conditionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 645
The functions in this section can be used to check whether variables are of a code type that is not built-in to Lua but common across all our game environments.
-
is_eventcontext(valuevalue) -
Returns true if the supplied value is an event context, false otherwise.
Parameters:
1
valuevalue
Returns:
is event contextboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 669
-
is_uicomponent(valuevalue) -
Returns true if the supplied value is a uicomponent, false otherwise.
Parameters:
1
valuevalue
Returns:
is uicomponentboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 678
-
is_component(valuevalue) -
Returns true if the supplied value is a component memory address, false otherwise.
Parameters:
1
valuevalue
Returns:
is component memory addressboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 687
The functions in this section can be used to check whether variables are of a userdata code type that is provided in the campaign environment. In certain cases the function also works in battle.
-
is_null(valuevalue) -
Returns true if the supplied value is a campaign null script interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is nullboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 709
-
is_model(valuevalue) -
Returns true if the supplied value is a campaign model interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is modelboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 718
-
is_world(valuevalue) -
Returns true if the supplied value is a campaign world interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is worldboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 727
-
is_faction(valuevalue) -
Returns true if the supplied value is a campaign faction interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is factionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 736
-
is_factionlist(valuevalue) -
Returns true if the supplied value is a campaign faction list interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is faction listboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 745
-
is_character(valuevalue) -
Returns true if the supplied value is a campaign character interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is characterboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 754
-
is_family_member(valuevalue) -
Returns true if the supplied value is a campaign family member interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is family memberboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 763
-
is_characterlist(valuevalue) -
Returns true if the supplied value is a campaign character list interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is character listboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 772
-
is_regionmanager(valuevalue) -
Returns true if the supplied value is a campaign region manager interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is region managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 781
-
is_region(valuevalue) -
Returns true if the supplied value is a campaign region interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is regionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 790
-
is_regiondata(valuevalue) -
Returns true if the supplied value is a campaign region data interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is region databoolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 799
-
is_province(valuevalue) -
Returns true if the supplied value is a campaign province interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is provinceboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 808
-
is_factionprovince(valuevalue) -
Returns true if the supplied value is a campaign faction province interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is faction provinceboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 817
-
is_regionlist(valuevalue) -
Returns true if the supplied value is a campaign region list interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is region listboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 826
-
is_garrisonresidence(valuevalue) -
Returns true if the supplied value is a campaign garrison residence interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is garrison residenceboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 835
-
is_settlement(valuevalue) -
Returns true if the supplied value is a campaign settlement interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is settlementboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 844
-
is_slot(valuevalue) -
Returns true if the supplied value is a campaign slot interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is slotboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 853
-
is_slotlist(valuevalue) -
Returns true if the supplied value is a campaign slot list interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is slot listboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 862
-
is_militaryforce(valuevalue) -
Returns true if the supplied value is a campaign military force interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is military forceboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 871
-
is_militaryforcelist(valuevalue) -
Returns true if the supplied value is a campaign military force list interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is military force listboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 880
-
is_unit(valuevalue) -
Returns true if the supplied value is a unit object, false otherwise. This works in both campaign and battle on their respective unit object types.
Parameters:
1
valuevalue
Returns:
is unitboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 889
-
is_unitlist(valuevalue) -
Returns true if the supplied value is a campaign unit list interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is unit listboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 898
-
is_pendingbattle(valuevalue) -
Returns true if the supplied value is a campaign pending battle interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is pending battleboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 907
-
is_campaignmission(valuevalue) -
Returns true if the supplied value is a campaign mission interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is campaign missionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 916
-
is_campaignai(valuevalue) -
Returns true if the supplied value is a campaign ai interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is campaign aiboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 925
-
is_buildinglist(valuevalue) -
Returns true if the supplied value is a building list object, false otherwise.
Parameters:
1
valuevalue
Returns:
is building listboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 934
-
is_building(valuevalue) -
Returns true if the supplied value is a building object in campaign or battle, false otherwise.
Parameters:
1
valuevalue
Returns:
is buildingboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 943
-
is_foreignslotmanager(valuevalue) -
Returns true if the supplied value is a foreign slot manager interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is foreign slot managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 953
-
is_foreignslot(valuevalue) -
Returns true if the supplied value is a foreign slot interface, false otherwise.
Parameters:
1
valuevalue
Returns:
is foreign slotboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 962
The functions in this section can be used to check whether variables are of a userdata code type that is provided in the battle environment. In certain cases functions are shared with campaign, in which case they are listed with the campaign type-checking functions.
-
is_battlesoundeffect(valuevalue) -
Returns true if the supplied value is a battle sound effect, false otherwise.
Parameters:
1
valuevalue
Returns:
is battle sound effectboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 987
-
is_battle(valuevalue) -
Returns true if the supplied value is an empire battle object, false otherwise.
Parameters:
1
valuevalue
Returns:
is battleboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 996
-
is_alliances(valuevalue) -
Returns true if the supplied value is an alliances object, false otherwise.
Parameters:
1
valuevalue
Returns:
is alliancesboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1005
-
is_alliance(valuevalue) -
Returns true if the supplied value is an alliance, false otherwise.
Parameters:
1
valuevalue
Returns:
is allianceboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1014
-
is_armies(valuevalue) -
Returns true if the supplied value is an armies object, false otherwise.
Parameters:
1
valuevalue
Returns:
is armiesboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1023
-
is_army(valuevalue) -
Returns true if the supplied value is an army object, false otherwise.
Parameters:
1
valuevalue
Returns:
is armyboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1032
-
is_units(valuevalue) -
Returns true if the supplied value is a units object, false otherwise.
Parameters:
1
valuevalue
Returns:
is unitsboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1041
-
is_unitcontroller(valuevalue) -
Returns true if the supplied value is a unitcontroller, false otherwise.
Parameters:
1
valuevalue
Returns:
is unitcontrollerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1050
-
is_vector(valuevalue) -
Returns true if the supplied value is a vector object, false otherwise.
Parameters:
1
valuevalue
Returns:
is vectorboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1059
-
is_buildings(valuevalue) -
Returns true if the supplied value is a buildings object, false otherwise.
Parameters:
1
valuevalue
Returns:
is buildingsboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1068
-
is_subtitles(valuevalue) -
Returns true if the supplied value is a battle subtitles object, false otherwise.
Parameters:
1
valuevalue
Returns:
is subtitlesboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1077
The functions in this section can be used to check whether variables are of a script data type that is provided in multiple game environments.
-
is_core(valuevalue) -
Returns true if the supplied value is a
coreobject, false otherwise.Parameters:
1
valuevalue
Returns:
is coreboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1102
-
is_timermanager(valuevalue) -
Returns true if the supplied value is a timer manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is timer managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1111
-
is_scriptmessager(valuevalue) -
Returns true if the supplied value is a script messager, false otherwise.
Parameters:
1
valuevalue
Returns:
is script messagerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1120
-
is_customcontext(valuevalue) -
Returns true if the supplied value is a custom event context, false otherwise.
Parameters:
1
valuevalue
Returns:
is custom contextboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1129
-
is_objectivesmanager(valuevalue) -
Returns true if the supplied value is an
objectives_manager, false otherwise.Parameters:
1
valuevalue
Returns:
is objectives managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1138
-
is_infotextmanager(valuevalue) -
Returns true if the supplied value is an
infotext_manager, false otherwise.Parameters:
1
valuevalue
Returns:
is infotext managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1147
-
is_linkparser(valuevalue) -
Returns true if the supplied value is a link parser, false otherwise.
Parameters:
1
valuevalue
Returns:
is link parserboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1156
-
is_tooltiplistener(valuevalue) -
Returns true if the supplied value is a tooltip listener, false otherwise.
Parameters:
1
valuevalue
Returns:
is tooltip listenerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1165
-
is_contextvisibilitymonitor(valuevalue) -
Returns true if the supplied value is a context visibility monitor, false otherwise.
Parameters:
1
valuevalue
Returns:
is context visibility monitorboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1174
-
is_tooltippatcher(valuevalue) -
Returns true if the supplied value is a tooltip patcher, false otherwise.
Parameters:
1
valuevalue
Returns:
is tooltip patcherboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1183
-
is_helppagemanager(valuevalue) -
Returns true if the supplied value is a help page manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is help page managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1192
-
is_helppage(valuevalue) -
Returns true if the supplied value is a help page, false otherwise.
Parameters:
1
valuevalue
Returns:
is help pageboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1201
-
is_textpointer(valuevalue) -
Returns true if the supplied value is a text pointer, false otherwise.
Parameters:
1
valuevalue
Returns:
is text pointerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1210
-
is_activepointer(valuevalue) -
Returns true if the supplied value is an active pointer, false otherwise.
Parameters:
1
valuevalue
Returns:
is active pointerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1219
-
is_scriptedtour(valuevalue) -
Returns true if the supplied value is a scripted tour, false otherwise.
Parameters:
1
valuevalue
Returns:
is scripted tourboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1228
-
is_navigabletour(valuevalue) -
Returns true if the supplied value is a navigable tour, false otherwise.
Parameters:
1
valuevalue
Returns:
is navigable tourboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1237
-
is_navigabletoursection(valuevalue) -
Returns true if the supplied value is a navigable tour section, false otherwise.
Parameters:
1
valuevalue
Returns:
is navigable tour sectionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1246
-
is_movieoverlay(valuevalue) -
Returns true if the supplied value is a
movie_overlay, false otherwise.Parameters:
1
valuevalue
Returns:
is movie overlayboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1255
-
is_windowedmovieplayer(valuevalue) -
Returns true if the supplied value is a
windowed_movie_player, false otherwise.Parameters:
1
valuevalue
Returns:
is windowed movie playerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1264
-
is_topicleader(valuevalue) -
Returns true if the supplied value is a
topic_leader, false otherwise.Parameters:
1
valuevalue
Returns:
is topic leaderboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1273
The functions in this section can be used to check whether variables are of a script data type that is provided in campaign.
-
is_campaignmanager(valuevalue) -
Returns true if the supplied value is a campaign manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is campaign managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1296
-
is_factionstart(valuevalue) -
Returns true if the supplied value is a faction start object, false otherwise.
Parameters:
1
valuevalue
Returns:
is faction startboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1305
-
is_factionintrodata(value,value) -
Returns true if the supplied value is a faction intro data object, false otherwise.
Parameters:
1
value,value
Returns:
is intro databoolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1314
-
is_campaigncutscene(valuevalue) -
Returns true if the supplied value is a campaign cutscene, false otherwise.
Parameters:
1
valuevalue
Returns:
is campaign cutsceneboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1323
-
is_uioverride(valuevalue) -
Returns true if the supplied value is a ui override, false otherwise.
Parameters:
1
valuevalue
Returns:
is ui overrideboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1332
-
is_campaignuimanager(valuevalue) -
Returns true if the supplied value is a campaign ui manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is campaign ui managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1341
-
is_missionmanager(valuevalue) -
Returns true if the supplied value is a mission manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is mission managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1350
-
is_chaptermission(valuevalue) -
Returns true if the supplied value is a chapter mission, false otherwise.
Parameters:
1
valuevalue
Returns:
is chapter missionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1359
-
is_intervention(valuevalue) -
Returns true if the supplied value is an intervention, false otherwise.
Parameters:
1
valuevalue
Returns:
is interventionboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1368
-
is_interventionmanager(valuevalue) -
Returns true if the supplied value is an intervention manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is intervention managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1377
-
is_invasionmanager(valuevalue) -
Returns true if the supplied value is an invasion manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is invasion managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1386
-
is_randomarmy(valuevalue) -
Returns true if the supplied value is a random army manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is random army managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1395
-
is_narrativeevent(valuevalue) -
Returns true if the supplied value is a
narrative_event, false otherwise.Parameters:
1
valuevalue
Returns:
is narrative eventboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1404
-
is_narrativequery(valuevalue) -
Returns true if the supplied value is a
narrative_query, false otherwise.Parameters:
1
valuevalue
Returns:
is narrative queryboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1413
-
is_narrativetrigger(valuevalue) -
Returns true if the supplied value is a
narrative_trigger, false otherwise.Parameters:
1
valuevalue
Returns:
is narrative triggerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1422
The functions in this section can be used to check whether variables are of a script data type that is provided in battle.
-
is_battlemanager(valuevalue) -
Returns true if the supplied value is a
battle_manager, false otherwise.Parameters:
1
valuevalue
Returns:
is battle managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1509
-
is_cutscene(valuevalue) -
Returns true if the supplied value is a battle cutscene, false otherwise.
Parameters:
1
valuevalue
Returns:
is cutsceneboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1518
-
is_convexarea(valuevalue) -
Returns true if the supplied value is a
convex_area, false otherwise.Parameters:
1
valuevalue
Returns:
is convex areaboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1527
-
is_scriptunit(valuevalue) -
Returns true if the supplied value is a
script_unit, false otherwise.Parameters:
1
valuevalue
Returns:
is scriptunitboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1536
-
is_scriptunits(valuevalue) -
Returns true if the supplied value is a
script_unitsobject, false otherwise.Parameters:
1
valuevalue
Returns:
is scriptunitsboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1545
-
is_patrolmanager(valuevalue) -
Returns true if the supplied value is a patrol manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is patrol managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1554
-
is_waypoint(valuevalue) -
Returns true if the supplied value is a patrol manager waypoint, false otherwise.
Parameters:
1
valuevalue
Returns:
is waypointboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1563
-
is_scriptaiplanner(valuevalue) -
Returns true if the supplied value is a script ai planner, false otherwise.
Parameters:
1
valuevalue
Returns:
is script ai plannerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1572
-
is_generatedbattle(valuevalue) -
Returns true if the supplied value is a generated battle, false otherwise.
Parameters:
1
valuevalue
Returns:
is generated battleboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1581
-
is_generatedarmy(valuevalue) -
Returns true if the supplied value is a generated army, false otherwise.
Parameters:
1
valuevalue
Returns:
is generated armyboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1590
-
is_generatedcutscene(valuevalue) -
Returns true if the supplied value is a generated cutscene, false otherwise.
Parameters:
1
valuevalue
Returns:
is generated cutsceneboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1599
-
is_advicemanager(valuevalue) -
Returns true if the supplied value is an advice manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is advice managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1608
-
is_advicemonitor(valuevalue) -
Returns true if the supplied value is an advice monitor, false otherwise.
Parameters:
1
valuevalue
Returns:
is advice monitorboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1617
-
is_attacklanemanager(valuevalue) -
Returns true if the supplied value is an attack lane manager, false otherwise.
Parameters:
1
valuevalue
Returns:
is attack lane managerboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1626
A handful of sound-related functions in battle require a volume type to be specified when they are called. The values described below represent those volume types. They can be passed into functions such as battle:set_volume and battle:get_volume to specify a volume type.
Variables in this section:
These variables may be accessed via <interface>.<variable_name>:
| VOLUME_TYPE_MUSIC |
number
|
Volume type representing music, that can be used with sound-related functions. Value is 0.
|
| VOLUME_TYPE_SFX |
number
|
Volume type representing sfx, that can be used with sound-related functions. Value is 1.
|
| VOLUME_TYPE_ADVISOR |
number
|
Volume type representing advisor sounds, that can be used with sound-related functions. Value is 2.
|
| VOLUME_TYPE_VO |
number
|
Volume type representing voiceover sounds, that can be used with sound-related functions. Value is 3.
|
| VOLUME_TYPE_INTERFACE |
number
|
Volume type representing user interface sounds, that can be used with sound-related functions. Value is 4.
|
| VOLUME_TYPE_MOVIE |
number
|
Volume type representing movie sounds, that can be used with sound-related functions. Value is 5.
|
| VOLUME_TYPE_VOICE_CHAT |
number
|
Volume type representing voice chat audio, that can be used with sound-related functions. Value is 6.
|
| VOLUME_TYPE_MASTER |
number
|
Volume type representing the master volume level, that can be used with sound-related functions. Value is 7.
|
-
model_pairs(objectparent list object) -
An iterator for use with model objects in campaign and battle. When used in a for loop with a model list object, the iterator function returns the index and next item provided by the list object each loop pass.
In campaign, this iterator supports all model list objects such asregion_list,character_list,military_force_listetc. In battle, this iterator supports model list objects such asbattle_alliances,battle_armiesandbattle_units, as well asscript_unitsscript collection objects.Parameters:
1
objectparent list object
Returns:
objectchild list item
Example - model_pairs usage in campaign:
local region_list = cm:model():world():region_manager():region_list();
for i, region in model_pairs(region_list) do
out(i .. " " .. region:name());
end;
list of all regions
Example - model_pairs usage in battle:
for i, unit in model_pairs(bm:get_player_army():units()) do
bm:out(i .. ": unit with id " .. unit:unique_ui_id() .. " is at position " .. v_to_s(unit:position()));
end;
list of player units
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 41
-
uic_pairs(parent uicomponent objectuicomponent) -
An iterator for use with
uicomponentobjects, which returns each child in succession. When used in a for loop with a uicomponent object, the iterator function returns the index number and the child corresponding to that index each loop pass.Parameters:
1
parent uicomponent object
Returns:
objectchild uicomponent iterator
Example:
local uic_parent = find_uicomponent(core:get_ui_root(), "some_parent")
out("Listing children of some_parent:");
for i, uic_child in uic_pairs(uic_parent) do
out("\tChild " .. i .. " is " .. uic_child:Id());
end;
Listing children of some_parent:
Child 0 is first_child
Child 1 is some_other_child
Child 2 is yet_another_child
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 87
-
r_to_d(numberangle) -
Converts a supplied angle in radians to degrees.
Parameters:
1
numberAngle in radians
Returns:
numberangle in degrees
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 122
-
d_to_r(numberangle) -
Converts a supplied angle in degrees to radians.
Parameters:
1
numberAngle in degrees
Returns:
numberangle in radians
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 135
Functions to help get the filename and path of the calling script.
-
get_file_and_folder_path_as_table([integerstack offset]) -
Returns the file and path of the calling script as a table of strings.
Parameters:
1
integeroptional, default value=0
Supply a positive integer here to return a result for a different file on the callstack e.g. supply '1' to return the file and folder path of the script file calling the the script file calling this function, for example.
Returns:
tabletable of strings
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 160
-
get_folder_name_and_shortform([integerstack offset]) -
Returns the folder name of the calling file and the shortform of its filename as separate return parameters. The shortform of the filename is the portion of the filename before the first "_", if one is found. If no shortform is found the function returns only the folder name.
A shortform used to be prepended on battle script files to allow them to be easily differentiated from one another in text editors e.g. "TF_battle_main.lua" vs "PY_battle_main.lua" rather than two "battle_main.lua"'s.Parameters:
1
integeroptional, default value=0
Supply a positive integer here to return a result for a different file on the callstack e.g. supply '1' to return the folder name/shortform of the script file calling the the script file calling this function, for example.
Returns:
stringname of folder containing calling filestringshortform of calling filename, if any
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 223
-
get_full_file_path([integerstack offset]) -
Gets the full filepath and name of the calling file.
Parameters:
1
integeroptional, default value=0
Supply a positive integer here to return a result for a different file on the callstack e.g. supply '1' to return the file path of the script file calling the the script file calling this function, for example.
Returns:
stringfile path
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 261
-
get_file_name_and_path([integerstack offset]) -
Returns the filename and the filepath of the calling file as separate return parameters.
Parameters:
1
integeroptional, default value=0
Supply a positive integer here to return a result for a different file on the callstack e.g. supply '1' to return the file name and path of the script file calling the the script file calling this function, for example.
Returns:
stringfile namestringfile path
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 277
-
find_child_uicomponent(uicomponentparent ui component, stringname) -
Takes a uicomponent and a string name. Searches the direct children (and no further - not grandchildren etc) of the supplied uicomponent for another uicomponent with the supplied name. If a uicomponent with the matching name is found then it is returned, otherwise
falseis returned.Parameters:
1
uicomponentparent ui component
2
stringname
Returns:
uicomponentchild, or false if not found
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 338
-
find_child_uicomponent_by_index(uicomponentparent ui component, numberindex) -
Takes a uicomponent and an index. Searches the direct children (and no further - not grandchildren etc) of the supplied uicomponent. If a uicomponent with the correct index is found then it is returned, otherwise
falseis returned.Parameters:
1
uicomponentparent ui component
2
numberstarting at 0
Returns:
uicomponentchild, or false if not found
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 354
-
find_uicomponent([parent ui componentuicomponent], ...list of string names) -
Finds and returns a uicomponent based on a set of strings that define its path in the ui hierarchy. This parent uicomponent can be supplied as the first argument - if omitted, the root uicomponent is used. Starting from the parent or root, the function searches through all descendants for a uicomponent with the next supplied uicomponent name in the sequence. If a uicomponent is found, its descendants are then searched for a uicomponent with the next name in the list, and so on until the list is finished or no uicomponent with the supplied name is found. A fragmentary path may be supplied if it still unambiguously specifies the intended uicomponent.
Parameters:
1
optional, default value=nil
parent ui component
2
...list of string names
Returns:
uicomponentchild, or false if not found.
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 406
-
find_uicomponent_from_table(parent ui component
uicomponent,table of string names
table,on failure
[assert]
) -
Takes a start uicomponent and a numerically-indexed table of string uicomponent names. Starting from the supplied start uicomponent, the function searches through all descendants for a uicomponent with the next supplied uicomponent name in the table. If a uicomponent is found, its descendants are then searched for a uicomponent with the next name in the list, and so on until the list is finished or no uicomponent with the supplied name is found. This allows a uicomponent to be searched for by matching its name and part of or all of its path.
Parameters:
1
uicomponentParent uicomponent.
2
tableTable of string names, indexed by number.
3
assertoptional, default value=false
Fire a script error if the search fails.
Returns:
uicomponentchild, or false if not found.
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 436
-
uicomponent_descended_from(uicomponentsubject uic, stringparent name) -
Takes a uicomponent and a string name. Returns true if any parent ancestor component all the way up to the ui root has the supplied name (i.e. the supplied component is descended from it), false otherwise.
Parameters:
1
uicomponentsubject uic
2
stringparent name
Returns:
uic is descended from a component with the supplied name.boolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 474
-
uicomponent_to_str(uicomponentsubject uic) -
Converts a uicomponent to a string showing its path, for output purposes.
Parameters:
1
uicomponentsubject uic
Returns:
stringoutput
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 515
-
output_uicomponent(uicomponentsubject uic, [booleanomit children]) -
Outputs extensive debug information about a supplied uicomponent to the
Lua - UIconsole spool.Parameters:
1
uicomponentSubject uicomponent.
2
booleanoptional, default value=false
Do not show information about the uicomponent's children.
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 554
-
output_uicomponent_on_click() -
Starts a listener which outputs debug information to the
Lua - UIconsole spool about every uicomponent that's clicked on.Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 619
-
print_all_uicomponent_children([subject uicuicomponent], [full outputboolean]) -
Prints the name and path of the supplied uicomponent and all its descendents. Very verbose, and can take a number of seconds to complete.
Parameters:
1
optional, default value=uiroot
subject uic
2
optional, default value=false
full output
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 634
-
pulse_uicomponent(ui component
uicomponent,should pulse
boolean,brightness
[number],progagate
[boolean],state name
[string]
) -
Activates or deactivates a pulsing highlight effect on a particular state of the supplied uicomponent. This is primarily used for scripts which activate when the player moves the mouse cursor over certain words in the help pages, to indicate to the player what UI feature is being talked about on the page.
Parameters:
1
uicomponentSubject ui component.
2
booleanSet to
trueto activate the pulsing effect,falseto deactivate it.3
numberoptional, default value=0
Pulse brightness. Set a higher number for a more pronounced pulsing effect.
4
booleanoptional, default value=false
Propagate the effect through the component's children. Use this with care, as the visual effect can stack and often it's better to activate the effect on specific uicomponents instead of activating this.
5
stringoptional, default value=nil
Optional state name to affect. If no string state name is supplied here then the current state is used.
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 655
-
is_fully_onscreen(uicomponentuicomponent) -
Returns true if the uicomponent is fully on-screen, false otherwise.
Parameters:
1
uicomponent
Returns:
is onscreenboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 699
-
is_partially_onscreen(uicomponentuicomponent) -
Returns true if the uicomponent is partially on-screen, false otherwise.
Parameters:
1
uicomponent
Returns:
is onscreenboolean
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 715
-
set_component_visible(booleanset visible, ...list of string names) -
Sets a uicomponent visible or invisible by its path. The path should be one or more strings which when sequentially searched for from the ui root lead to the target uicomponent (see documentation for
find_uicomponent_from_table, which performs the search).Parameters:
1
booleanset visible
2
...list of string names
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 733
-
set_component_visible_with_parent(set visible
boolean,parent uicomponent
uicomponent,list of string names
...
) -
Sets a uicomponent visible or invisible by its path. The path should be one or more strings which when sequentially searched for from a supplied uicomponent parent lead to the target uicomponent (see documentation for
find_uicomponent_from_table, which performs the search).Parameters:
1
booleanset visible
2
uicomponentparent uicomponent
3
...list of string names
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 754
-
set_component_active(booleanset active, ...list of string names) -
Sets a uicomponent to be active or inactive by its path. The path should be one or more strings which when sequentially searched for from the ui root lead to the target uicomponent (see documentation for
find_uicomponent_from_table, which performs the search).Parameters:
1
booleanset active
2
...list of string names
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 774
-
set_component_active_with_parent(set active
boolean,parent uicomponent
uicomponent,list of string names
...
) -
Sets a uicomponent to be active or inactive by its path. The path should be one or more strings which when sequentially searched for from a supplied uicomponent parent lead to the target uicomponent (see documentation for
find_uicomponent_from_table, which performs the search).Parameters:
1
booleanset active
2
uicomponentparent uicomponent
3
...list of string names
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 795
-
highlight_component(booleanactivate highlight, booleanis square, ...list of string names) -
Highlights or unhighlights a uicomponent by its path. The path should be one or more strings which when sequentially searched for from the ui root lead to the target uicomponent (see documentation for
find_uicomponent_from_table, which performs the search).Parameters:
1
booleanSet
trueto activate the highlight,falseto deactivate.2
booleanSet to
trueif the target uicomponent is square,falseif it's circular.3
...list of string names
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 829
-
highlight_visible_component(booleanactivate highlight, booleanis square, ...list of string names) -
Highlights or unhighlights a uicomponent by its path, but only if it's visible. The path should be one or more strings which when sequentially searched for from the ui root lead to the target uicomponent (see documentation for
find_uicomponent_from_table, which performs the search).Parameters:
1
booleanSet
trueto activate the highlight,falseto deactivate.2
booleanSet to
trueif the target uicomponent is square,falseif it's circular.3
...list of string names
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 839
-
highlight_all_visible_children(uicomponentparent, [numbervisual padding]) -
Draws a box highlight around all visible children of the supplied uicomponent. A padding value in pixels may also be supplied to increase the visual space between the highlight and the components being highlighted.
Parameters:
1
uicomponentparent
2
numberoptional, default value=0
visual padding
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 863
-
unhighlight_all_visible_children() -
Cancels any and all highlights created with
highlight_all_visible_children.Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 890
-
highlight_component_table(numbervisual padding, ...uicomponents) -
Draws a box highlight stretching around the supplied list of components. A padding value in pixels may also be supplied to increase the visual space between the highlight and the components being highlighted.
Parameters:
1
numberVisual padding in pixels.
2
...Variable number of uicomponents to draw highlight over.
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 897
-
unhighlight_component_table() -
Cancels any and all highlights created with
highlight_component_table.Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 987
-
play_component_animation(stringanimation name, ...list of string names) -
Plays a specified component animation on a uicomponent by its path. The path should be one or more strings which when sequentially searched for from the ui root lead to the target uicomponent (see documentation for
find_uicomponent_from_table, which performs the search).Parameters:
1
stringanimation name
2
...list of string names
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 994
-
uicomponent_has_parent_filter(uicomponentuicomponent,filterfunction) -
Returns
trueif the supplied uicomponent has a parent or ancestor that matches the supplied filter, orfalseotherwise. The filter should be a function that accepts a uicomponent as a single argument and returnstrueorfalsedepending on whether the uicomponent passes the filter. The first matching ancestor is also returned.Parameters:
1
uicomponent
2
filter
Returns:
uic parent passes filterbooleanfirst matching ancestoruicomponent
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 1008
-
get_advisor_progress_button() -
Returns the advisor progress/close button uicomponent.
Returns:
uicomponent
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 1050
-
show_advisor_progress_button([booleanshow button]) -
Shows or hides the advisor progress/close button.
Parameters:
1
booleanoptional, default value=true
show button
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 1074
-
highlight_advisor_progress_button([booleanshow button]) -
Activates or deactivates a highlight on the advisor progress/close button.
Parameters:
1
booleanoptional, default value=true
show button
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_common.lua, line 1104
-
get_messager() -
Gets or creates a
script_messagerobject.Returns:
script_messager
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_script_messager.lua, line 10
-
ModLog(output textstring) -
Writes output to the
lua_mod_log.txttext file, and also to the game console.Parameters:
1
output text
Returns:
nil
Loaded in Frontend
defined in ../../warhammer/working_data/script/_lib/lib_mod_loader.lua, line 34
Variables in this section:
These variables may be accessed via <interface>.<variable_name>:
| VOLUME_TYPE_MUSIC |
number
|
Volume type representing music, that can be used with sound-related functions. Value is 0.
|
| VOLUME_TYPE_SFX |
number
|
Volume type representing sfx, that can be used with sound-related functions. Value is 1.
|
| VOLUME_TYPE_ADVISOR |
number
|
Volume type representing advisor sounds, that can be used with sound-related functions. Value is 2.
|
| VOLUME_TYPE_VO |
number
|
Volume type representing voiceover sounds, that can be used with sound-related functions. Value is 3.
|
| VOLUME_TYPE_INTERFACE |
number
|
Volume type representing user interface sounds, that can be used with sound-related functions. Value is 4.
|
| VOLUME_TYPE_MOVIE |
number
|
Volume type representing movie sounds, that can be used with sound-related functions. Value is 5.
|
| VOLUME_TYPE_VOICE_CHAT |
number
|
Volume type representing voice chat audio, that can be used with sound-related functions. Value is 6.
|
| VOLUME_TYPE_MASTER |
number
|
Volume type representing the master volume level, that can be used with sound-related functions. Value is 7.
|
Functions in this section:
-
UIComponent(addresscomponent address) -
Casts a component memory address, returned by several functions such as
uicomponent:Find, into a validuicomponentscript object so that functions in theuicomponentscript interface may be called on it.
This function is provided by the UI code.Parameters:
1
addresscomponent address
Returns:
uicomponent
Loaded in Frontend
defined in ../../common/UiComponentLib/Source/LuaComponentInterface.cpp, line 449