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(stringmessage) -
Throws a script error with the supplied message, printing the lua callstack to the
Luaconsole output spool. Useful for debugging.Parameters:
1
stringmessage
Returns:
nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/all_scripted.lua, line 33
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/all_scripted.lua, line 118
-
force_require(stringfilename) -
Forceably unloads and requires a file by name.
Parameters:
1
stringfilename
Returns:
nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/all_scripted.lua, line 396
-
load_script_libraries() -
One-shot function to load the script libraries.
Returns:
nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/all_scripted.lua, line 405
A suite of functions related to vectors. In battle scripting terminology, vectors are 2D/3D positions in the game world.
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:
| 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.
|
These variables are also listed in the global variables list for this class or module.
-
r_to_d(numberangle) -
Converts a supplied angle in radians to degrees.
Parameters:
1
numberAngle in radians
Returns:
numberangle in degrees
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 35
-
d_to_r(numberangle) -
Converts a supplied angle in degrees to radians.
Parameters:
1
numberAngle in degrees
Returns:
numberangle in radians
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 48
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 73
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 136
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 174
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 190
-
is_nil(objectobject) -
Returns true if the supplied object is nil, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 264
-
is_number(objectobject) -
Returns true if the supplied object is a number, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis number
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 277
-
is_function(objectobject) -
Returns true if the supplied object is a function, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis function
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 290
-
is_string(objectobject) -
Returns true if the supplied object is a string, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis string
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 303
-
is_boolean(objectobject) -
Returns true if the supplied object is a boolean, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis boolean
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 316
-
is_table(objectobject) -
Returns true if the supplied object is a table, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis table
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 329
-
is_eventcontext(objectobject) -
Returns true if the supplied object is an event context, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis event context
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 342
-
is_battlesoundeffect(objectobject) -
Returns true if the supplied object is a battle sound effect, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis battle sound effect
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 355
-
is_battle(objectobject) -
Returns true if the supplied object is an empire battle object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis battle
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 368
-
is_alliances(objectobject) -
Returns true if the supplied object is an alliances object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis alliances
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 381
-
is_alliance(objectobject) -
Returns true if the supplied object is an alliance, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis alliance
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 394
-
is_armies(objectobject) -
Returns true if the supplied object is an armies object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis armies
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 407
-
is_army(objectobject) -
Returns true if the supplied object is an army object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis army
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 420
-
is_units(objectobject) -
Returns true if the supplied object is a units object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis units
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 433
-
is_unit(objectobject) -
Returns true if the supplied object is a unit object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis unit
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 445
-
is_unitcontroller(objectobject) -
Returns true if the supplied object is a unitcontroller, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis unitcontroller
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 458
-
is_core(objectobject) -
Returns true if the supplied object is a
coreobject, false otherwise.Parameters:
1
objectobject
Returns:
booleanis core
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 471
-
is_battlemanager(objectobject) -
Returns true if the supplied object is a
battle_manager, false otherwise.Parameters:
1
objectobject
Returns:
booleanis battle manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 484
-
is_campaignmanager(objectobject) -
Returns true if the supplied object is a campaign manager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis campaign manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 497
-
is_factionstart(objectobject) -
Returns true if the supplied object is a faction start object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis faction start
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 510
-
is_campaigncutscene(objectobject) -
Returns true if the supplied object is a campaign cutscene, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis campaign cutscene
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 523
-
is_cutscene(objectobject) -
Returns true if the supplied object is a battle cutscene, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis cutscene
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 536
-
is_vector(objectobject) -
Returns true if the supplied object is a vector object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis vector
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 549
-
is_building(objectobject) -
Returns true if the supplied object is a building object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis building
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 563
-
is_buildings(objectobject) -
Returns true if the supplied object is a buildings object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis buildings
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 577
-
is_buildinglist(objectobject) -
Returns true if the supplied object is a building list object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis building list
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 591
-
is_convexarea(objectobject) -
Returns true if the supplied object is a
convex_area, false otherwise.Parameters:
1
objectobject
Returns:
booleanis convex area
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 604
-
is_scriptunit(objectobject) -
Returns true if the supplied object is a
script_unit, false otherwise.Parameters:
1
objectobject
Returns:
booleanis scriptunit
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 617
-
is_scriptunits(objectobject) -
Returns true if the supplied object is a
script_unitsobject, false otherwise.Parameters:
1
objectobject
Returns:
booleanis scriptunits
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 630
-
is_subtitles(objectobject) -
Returns true if the supplied object is a battle subtitles object, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis subtitles
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 643
-
is_patrolmanager(objectobject) -
Returns true if the supplied object is a patrol manager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis patrol manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 656
-
is_waypoint(objectobject) -
Returns true if the supplied object is a patrol manager waypoint, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis waypoint
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 669
-
is_eventhandler(objectobject) -
Returns true if the supplied object is an event handler, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis event handler
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 682
-
is_scriptaiplanner(objectobject) -
Returns true if the supplied object is a script ai planner, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis script ai planner
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 695
-
is_timermanager(objectobject) -
Returns true if the supplied object is a timer manager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis timer manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 708
-
is_uioverride(objectobject) -
Returns true if the supplied object is a ui override, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis ui override
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 721
-
is_uicomponent(objectobject) -
Returns true if the supplied object is a uicomponent, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis uicomponent
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 734
-
is_component(objectobject) -
Returns true if the supplied object is a component, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis component
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 747
-
is_scriptmessager(objectobject) -
Returns true if the supplied object is a script messager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis script messager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 760
-
is_generatedbattle(objectobject) -
Returns true if the supplied object is a generated battle, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis generated battle
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 773
-
is_generatedarmy(objectobject) -
Returns true if the supplied object is a generated army, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis generated army
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 786
-
is_generatedcutscene(objectobject) -
Returns true if the supplied object is a generated cutscene, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis generated cutscene
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 799
-
is_null(objectobject) -
Returns true if the supplied object is a campaign null script interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis null
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 812
-
is_model(objectobject) -
Returns true if the supplied object is a campaign model interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis model
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 825
-
is_world(objectobject) -
Returns true if the supplied object is a campaign world interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis world
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 838
-
is_faction(objectobject) -
Returns true if the supplied object is a campaign faction interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis faction
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 851
-
is_factionlist(objectobject) -
Returns true if the supplied object is a campaign faction list interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis faction list
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 864
-
is_character(objectobject) -
Returns true if the supplied object is a campaign character interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis character
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 877
-
is_characterlist(objectobject) -
Returns true if the supplied object is a campaign character list interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis character list
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 890
-
is_regionmanager(objectobject) -
Returns true if the supplied object is a campaign region manager interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis region manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 903
-
is_region(objectobject) -
Returns true if the supplied object is a campaign region interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis region
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 916
-
is_regionlist(objectobject) -
Returns true if the supplied object is a campaign region list interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis region list
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 929
-
is_garrisonresidence(objectobject) -
Returns true if the supplied object is a campaign garrison residence interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis garrison residence
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 942
-
is_settlement(objectobject) -
Returns true if the supplied object is a campaign settlement interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis settlement
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 955
-
is_slot(objectobject) -
Returns true if the supplied object is a campaign slot interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis slot
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 968
-
is_slotlist(objectobject) -
Returns true if the supplied object is a campaign slot list interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis slot list
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 981
-
is_militaryforce(objectobject) -
Returns true if the supplied object is a campaign military force interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis military force
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 994
-
is_militaryforcelist(objectobject) -
Returns true if the supplied object is a campaign military force list interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis military force list
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1007
-
is_unitlist(objectobject) -
Returns true if the supplied object is a campaign unit list interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis unit list
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1020
-
is_pendingbattle(objectobject) -
Returns true if the supplied object is a campaign pending battle interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis pending battle
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1033
-
is_campaignmission(objectobject) -
Returns true if the supplied object is a campaign mission interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis campaign mission
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1046
-
is_campaignai(objectobject) -
Returns true if the supplied object is a campaign ai interface, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis campaign ai
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1059
-
is_campaignuimanager(objectobject) -
Returns true if the supplied object is a campaign ui manager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis campaign ui manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1072
-
is_objectivesmanager(objectobject) -
Returns true if the supplied object is an
objectives_manager, false otherwise.Parameters:
1
objectobject
Returns:
booleanis objectives manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1085
-
is_infotextmanager(objectobject) -
Returns true if the supplied object is an
infotext_manager, false otherwise.Parameters:
1
objectobject
Returns:
booleanis infotext manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1098
-
is_missionmanager(objectobject) -
Returns true if the supplied object is a mission manager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis text pointer
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1111
-
is_intervention(objectobject) -
Returns true if the supplied object is an intervention, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis intervention
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1124
-
is_interventionmanager(objectobject) -
Returns true if the supplied object is an intervention manager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis intervention manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1137
-
is_linkparser(objectobject) -
Returns true if the supplied object is a link parser, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis link parser
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1150
-
is_advicemanager(objectobject) -
Returns true if the supplied object is an advice manager, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis advice manager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1163
-
is_advicemonitor(objectobject) -
Returns true if the supplied object is an advice monitor, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis advice monitor
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1176
-
is_textpointer(objectobject) -
Returns true if the supplied object is a text pointer, false otherwise.
Parameters:
1
objectobject
Returns:
booleanis text pointer
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common_ui.lua, line 29
-
table_contains(tablesubject table, objectobject) -
Returns true if the supplied indexed table contains the supplied object.
Parameters:
1
tablesubject table
2
objectobject
Returns:
booleantable contains object
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1201
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1228
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1267
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1297
-
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:
booleanuic is descended from a component with the supplied name.
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1335
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1367
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1391
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1446
-
print_all_uicomponent_children(uicomponentsubject uic) -
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
uicomponentSubject uicomponent.
Returns:
nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1461
-
pulse_uicomponent(ui component
uicomponent,should pulse
[boolean],brightness
[number],progagate
[boolean],state name
[string]
) -
Activates or deactivates a pulsing highlight effect on 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
Subject ui component.
2
optional, default value=true
Set to
trueto activate the pulsing effect,falseto deactivate it.3
optional, default value=0
Pulse brightness. Set a higher number for a more pronounced pulsing effect.
4
optional, 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
optional, default value=nil
Optional state name to affect. If a string name is supplied, the pulsing effect is only applied to the specified state instead of to all states on the component.
Returns:
nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1473
-
is_fully_onscreen(uicomponentuicomponent) -
Returns true if the uicomponent is fully on-screen, false otherwise.
Parameters:
1
uicomponent
Returns:
is onscreenboolean
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1522
-
is_partially_onscreen(uicomponentuicomponent) -
Returns true if the uicomponent is partially on-screen, false otherwise.
Parameters:
1
uicomponent
Returns:
is onscreenboolean
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1538
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1556
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1577
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1597
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1618
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1652
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1662
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1686
-
unhighlight_all_visible_children() -
Cancels any and all highlights created with
highlight_all_visible_children.Returns:
nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1713
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1720
-
unhighlight_component_table() -
Cancels any and all highlights created with
highlight_component_table.Returns:
nil
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1810
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1817
-
get_advisor_progress_button() -
Returns the advisor progress/close button uicomponent.
Returns:
uicomponent
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1850
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1874
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_common.lua, line 1893
-
get_messager() -
Gets or creates a
script_messagerobject.Returns:
script_messager
Loaded in Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_script_messager.lua, line 10
-
get_tm() -
Gets or creates a
timer_manager.Returns:
timermanager
Loaded in Battle
Loaded in Frontend
defined in ../working_data/script/_lib/lib_timer_manager.lua, line 120
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../working_data/script/_lib/lib_mod_loader.lua, line 34
-
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 Battle
Loaded in Campaign
Loaded in Frontend
defined in ../../common/UiComponentLib/Source/LuaComponentInterface.cpp, line 493
All variables provided by global
| 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.
|