Validate

The validation table contains a suite of functions that can provide input validation for other scripts. A validation function, when provided with a value, checks that value and returns true if it passes the check. If the value does not pass the check then the validation function throws a script_error containing a descriptive error message and return false.

The diference between calling a validation function and calling one of the global Lua Type Checking functions is that the validation function will automatically throw a script error if the validation fails.

Loaded in Campaign Loaded in Campaign
Loaded in Battle Loaded in Battle
Loaded in Frontend Loaded in Frontend
Back to top

Lua Type Checking

The functions in this section can be used to check whether variables are a built-in type.

validate.is_nil(value value)

Throws a script_error and returns false if the supplied value is not nil. If the supplied value is nil then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is nil

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1866

validate.is_number(value value)

Throws a script_error and returns false if the supplied value is not a number. If the supplied value is a number then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a number

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1873

validate.is_function(value value)

Throws a script_error and returns false if the supplied value is not a function. If the supplied value is a function then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a function

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1880

validate.is_string(value value)

Throws a script_error and returns false if the supplied value is not a string. If the supplied value is a string then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a string

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1887

validate.is_boolean(value value)

Throws a script_error and returns false if the supplied value is not a boolean. If the supplied value is a boolean then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a boolean

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1894

validate.is_boolean_or_nil(value value)

Throws a script_error and returns false if the supplied value is not a boolean or nil. If the supplied value is a boolean or nil then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a boolean

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1901

validate.is_table(value value)

Throws a script_error and returns false if the supplied value is not a table. If the supplied value is a table then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a table

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1915

validate.is_userdata(value value)

Throws a script_error and returns false if the supplied value is not userdata. If the supplied value is userdata then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is userdata

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1922

Back to top

Complex Lua Type Checking

The functions in this section can be used to check whether variables are specific arrangements of built-in types.

validate.is_integer(value value)

Throws a script_error and returns false if the supplied value is not an integer value. If the supplied value is an integer then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an integer

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1944

validate.is_positive_number(value value)

Throws a script_error and returns false if the supplied value is not a number greater than zero. If the supplied value is a positive number then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a positive number

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1951

validate.is_non_negative_number(value value)

Throws a script_error and returns false if the supplied value is not a number greater than or equal to zero. If the supplied value is a non-negative number then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a non-negative number

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1958

validate.is_non_empty_table(value value)

Throws a script_error and returns false if the supplied value is not a non-empty table. If the supplied value is considered to be a non-empty indexed table then true is returned. See also validate.is_non_empty_table_indexed which should be used for numerically-indexed tables in place of this function.

Parameters:

1

value

value

Returns:

  1. boolean value is a non-empty table

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1965

validate.is_non_empty_table_indexed(value value)

Throws a script_error and returns false if the supplied value is not a non-empty indexed table. An indexed table contains values stored in elements with keys which are ascending integer numbers, starting at 1. Values stored at keys that are not ascending integers are not queried by this test, so a table that contains only values stored in elements with string keys will not count as a "non empty table indexed". If the supplied value is considered to be a non-empty indexed table then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a non-empty indexed table

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1980

validate.is_table_of_strings(value value)

Throws a script_error and returns false if the supplied value is not a numerically-indexed table of strings. If the supplied value is a table of strings then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a table of strings

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 1994

validate.is_string_or_table_of_strings(value value)

Throws a script_error and returns false if the supplied value is not a string, or a numerically-indexed table of strings. If the supplied value is either of these value types then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a string/table of strings

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2008

validate.is_table_of_strings_allow_empty(value value)

Throws a script_error and returns false if the supplied value is not an empty table or a numerically-indexed table of strings. If the supplied value is either of these value types then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a string/table of strings

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2022

validate.is_condition(value value)

Throws a script_error and returns false if the supplied value is not 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 a condition then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a function or true

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2036

Back to top

Common Type Checking

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.

validate.is_eventcontext(value value)

Throws a script_error and returns false if the supplied value is not an event context. If the supplied value is an event context then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an event context

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2053

validate.is_uicomponent(value value)

Throws a script_error and returns false if the supplied value is not a uicomponent. If the supplied value is a uicomponent then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an event context

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2060

validate.is_component(value value)

Throws a script_error and returns false if the supplied value is not a component memory address. If the supplied value is a component memory address then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a component memory address

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2067

Back to top

Campaign Code Type Checking

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.

validate.is_null(value value)

Throws a script_error and returns false if the supplied value is not a campaign null script interface. If the supplied value is a null script interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a null script interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2089

validate.is_model(value value)

Throws a script_error and returns false if the supplied value is not a campaign model interface. If the supplied value is a model interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a model interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2096

validate.is_world(value value)

Throws a script_error and returns false if the supplied value is not a campaign world interface. If the supplied value is a world interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a world interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2103

validate.is_faction(value value)

Throws a script_error and returns false if the supplied value is not a campaign faction interface. If the supplied value is a faction interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a faction interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2110

validate.is_factionlist(value value)

Throws a script_error and returns false if the supplied value is not a campaign faction list interface. If the supplied value is a faction list interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a faction list interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2117

validate.is_character(value value)

Throws a script_error and returns false if the supplied value is not a campaign character interface. If the supplied value is a character interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a character interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2124

validate.is_familymember(value value)

Throws a script_error and returns false if the supplied value is not a campaign family member interface. If the supplied value is a family member interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a family member interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2131

validate.is_characterlist(value value)

Throws a script_error and returns false if the supplied value is not a campaign character list interface. If the supplied value is a character list interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a character list interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2138

validate.is_regionmanager(value value)

Throws a script_error and returns false if the supplied value is not a campaign region manager interface. If the supplied value is a region manager interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a region manager interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2145

validate.is_region(value value)

Throws a script_error and returns false if the supplied value is not a campaign region interface. If the supplied value is a region interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a region interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2152

validate.is_regiondata(value value)

Throws a script_error and returns false if the supplied value is not a campaign region data interface. If the supplied value is a region data interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a region data interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2159

validate.is_province(value value)

Throws a script_error and returns false if the supplied value is not a campaign province interface. If the supplied value is a province interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a province interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2166

validate.is_factionprovince(value value)

Throws a script_error and returns false if the supplied value is not a campaign faction province interface. If the supplied value is a faction province interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a faction province interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2173

validate.is_regionlist(value value)

Throws a script_error and returns false if the supplied value is not a campaign region list interface. If the supplied value is a region list interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a region list interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2180

validate.is_garrisonresidence(value value)

Throws a script_error and returns false if the supplied value is not a campaign garrison residence interface. If the supplied value is a garrison residence interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a garrison residence interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2187

validate.is_settlement(value value)

Throws a script_error and returns false if the supplied value is not a campaign settlement interface. If the supplied value is a settlement interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a settlement interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2194

validate.is_slot(value value)

Throws a script_error and returns false if the supplied value is not a campaign slot interface. If the supplied value is a slot interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a slot interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2201

validate.is_slotlist(value value)

Throws a script_error and returns false if the supplied value is not a campaign slot list interface. If the supplied value is a slot list interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a slot list interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2208

validate.is_militaryforce(value value)

Throws a script_error and returns false if the supplied value is not a campaign military force interface. If the supplied value is a military force interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a military force interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2215

validate.is_militaryforcelist(value value)

Throws a script_error and returns false if the supplied value is not a campaign military force list interface. If the supplied value is a military force list interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a military force list interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2222

validate.is_unit(value value)

Throws a script_error and returns false if the supplied value is not a unit interface. If the supplied value is a unit interface then true is returned. This works in both campaign and battle on their respective unit object types.

Parameters:

1

value

value

Returns:

  1. boolean value is a unit interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2229

validate.is_unitlist(value value)

Throws a script_error and returns false if the supplied value is not a campaign unit list interface. If the supplied value is a unit list interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a unit list interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2236

validate.is_pendingbattle(value value)

Throws a script_error and returns false if the supplied value is not a campaign pending battle interface. If the supplied value is a pending battle interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a pending battle interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2243

validate.is_campaignmission(value value)

Throws a script_error and returns false if the supplied value is not a campaign mission interface. If the supplied value is a mission interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a mission interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2250

validate.is_campaignai(value value)

Throws a script_error and returns false if the supplied value is not a campaign ai interface. If the supplied value is a campaign ai interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign ai interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2257

validate.is_buildinglist(value value)

Throws a script_error and returns false if the supplied value is not a campaign building list interface. If the supplied value is a building list interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a building list interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2264

validate.is_building(value value)

Throws a script_error and returns false if the supplied value is not a building interface. If the supplied value is a building interface then true is returned. This works in both campaign and battle on their respective object types.

Parameters:

1

value

value

Returns:

  1. boolean value is a building interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2271

validate.is_foreignslotmanager(value value)

Throws a script_error and returns false if the supplied value is not a foreign slot manager interface. If the supplied value is a foreign slot manager interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a foreign slot manager interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2278

validate.is_foreignslot(value value)

Throws a script_error and returns false if the supplied value is not a foreign slot interface. If the supplied value is a foreign slot interface then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a foreign slot interface

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2285

Back to top

Battle Code Type Checking

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.

validate.is_battlesoundeffect(value value)

Throws a script_error and returns false if the supplied value is not a battle sound effect. If the supplied value is a battle sound effect then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle sound effect

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2306

validate.is_battle(value value)

Throws a script_error and returns false if the supplied value is not a battle object. If the supplied value is a battle object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2313

validate.is_alliances(value value)

Throws a script_error and returns false if the supplied value is not an alliances collection object. If the supplied value is an alliances object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an alliances object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2320

validate.is_alliance(value value)

Throws a script_error and returns false if the supplied value is not an alliance object. If the supplied value is an alliance object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an alliance object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2327

validate.is_armies(value value)

Throws a script_error and returns false if the supplied value is not an armies collection object. If the supplied value is an armies object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an armies object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2334

validate.is_army(value value)

Throws a script_error and returns false if the supplied value is not an army object. If the supplied value is an army object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an army object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2341

validate.is_units(value value)

Throws a script_error and returns false if the supplied value is not a units collection object. If the supplied value is a units object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a units object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2348

validate.is_unitcontroller(value value)

Throws a script_error and returns false if the supplied value is not a unitcontroller object. If the supplied value is a unitcontroller object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a unitcontroller object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2355

validate.is_vector(value value)

Throws a script_error and returns false if the supplied value is not a battle vector object. If the supplied value is a vector object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle vector object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2362

validate.is_buildings(value value)

Throws a script_error and returns false if the supplied value is not a buildings collection object. If the supplied value is a buildings collection object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a buildings collection object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2369

validate.is_subtitles(value value)

Throws a script_error and returns false if the supplied value is not a subtitles object. If the supplied value is a subtitles object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a subtitles object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2376

Back to top

Common Script Type Checking

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.

validate.is_core(value value)

Throws a script_error and returns false if the supplied value is not a core script object. If the supplied value is a core object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a core object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2400

validate.is_timermanager(value value)

Throws a script_error and returns false if the supplied value is not a timer manager script object. If the supplied value is a timer manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a timer manager object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2407

validate.is_scriptmessager(value value)

Throws a script_error and returns false if the supplied value is not a script messager object. If the supplied value is a script messager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a script messager object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2414

validate.is_customcontext(value value)

Throws a script_error and returns false if the supplied value is not a custom event context object. If the supplied value is a custom context then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a script messager object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2421

validate.is_objectivesmanager(value value)

Throws a script_error and returns false if the supplied value is not an objectives manager script object. If the supplied value is an objectives manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an objectives manager object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2428

validate.is_infotextmanager(value value)

Throws a script_error and returns false if the supplied value is not an infotext manager script object. If the supplied value is an infotext manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an infotext manager object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2435

validate.is_linkparser(value value)

Throws a script_error and returns false if the supplied value is not a link parser script object. If the supplied value is a link parser then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a link parser object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2442

validate.is_tooltiplistener(value value)

Throws a script_error and returns false if the supplied value is not a tooltip listener script object. If the supplied value is a tooltip listener then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a tooltip listener object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2449

validate.is_tooltippatcher(value value)

Throws a script_error and returns false if the supplied value is not a tooltip patcher script object. If the supplied value is a tooltip patcher then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a tooltip patcher object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2456

validate.is_helppagemanager(value value)

Throws a script_error and returns false if the supplied value is not a help page manager script object. If the supplied value is a help page manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a help page manager object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2463

validate.is_helppage(value value)

Throws a script_error and returns false if the supplied value is not a help page script object. If the supplied value is a help page then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a help page object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2470

validate.is_textpointer(value value)

Throws a script_error and returns false if the supplied value is not a text pointer script object. If the supplied value is a text pointer then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a help page object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2477

validate.is_activepointer(value value)

Throws a script_error and returns false if the supplied value is not an active pointer script object. If the supplied value is an active pointer then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an active pointer object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2484

validate.is_scriptedtour(value value)

Throws a script_error and returns false if the supplied value is not a scripted tour object. If the supplied value is a scripted tour then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a scripted tour object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2491

validate.is_navigabletour(value value)

Throws a script_error and returns false if the supplied value is not a navigable tour object. If the supplied value is a navigable tour then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a navigable tour object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2498

validate.is_navigabletoursection(value value)

Throws a script_error and returns false if the supplied value is not a navigable tour section object. If the supplied value is a navigable tour section then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a navigable tour section object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2505

validate.is_movieoverlay(value value)

Throws a script_error and returns false if the supplied value is not a movie overlay script object. If the supplied value is a movie overlay then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a movie overlay object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2512

validate.is_windowedmovieplayer(value value)

Throws a script_error and returns false if the supplied value is not a windowed movie player script object. If the supplied value is a windowed movie player then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a windowed movie player object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2519

validate.is_topicleader(value value)

Throws a script_error and returns false if the supplied value is not a topic leader script object. If the supplied value is a topic leader then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a topic leader object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2526

Back to top

Campaign Script Type Checking

The functions in this section can be used to check whether variables are of a script data type that is provided in campaign.

validate.is_campaignmanager(value value)

Throws a script_error and returns false if the supplied value is not a campaign manager script object. If the supplied value is a campaign manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2550

validate.is_campaigncutscene(value value)

Throws a script_error and returns false if the supplied value is not a campaign cutscene script object. If the supplied value is a campaign cutscene then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign cutscene script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2557

validate.is_uioverride(value value)

Throws a script_error and returns false if the supplied value is not a ui override script object. If the supplied value is a ui override then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a ui override script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2564

validate.is_campaignuimanager(value value)

Throws a script_error and returns false if the supplied value is not a campaign ui manager script object. If the supplied value is a campaign ui manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign ui manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2571

validate.is_missionmanager(value value)

Throws a script_error and returns false if the supplied value is not a campaign mission manager script object. If the supplied value is a campaign mission manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign mission manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2578

validate.is_chaptermission(value value)

Throws a script_error and returns false if the supplied value is not a campaign chapter mission script object. If the supplied value is a chapter mission then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign chapter mission script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2585

validate.is_intervention(value value)

Throws a script_error and returns false if the supplied value is not a campaign intervention script object. If the supplied value is an intervention then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign intervention script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2592

validate.is_interventionmanager(value value)

Throws a script_error and returns false if the supplied value is not a campaign intervention manager script object. If the supplied value is an intervention manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign intervention manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2599

validate.is_invasionmanager(value value)

Throws a script_error and returns false if the supplied value is not a campaign invasion manager script object. If the supplied value is an invasion manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign intervention manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2606

validate.is_randomarmy(value value)

Throws a script_error and returns false if the supplied value is not a campaign random army manager script object. If the supplied value is a random army manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign random army manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2613

validate.is_narrativeevent(value value)

Throws a script_error and returns false if the supplied value is not a campaign narrative event script object. If the supplied value is a narrative event then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign narrative event script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2620

validate.is_narrativequery(value value)

Throws a script_error and returns false if the supplied value is not a campaign narrative query script object. If the supplied value is a narrative query then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign narrative query script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2627

validate.is_narrativetrigger(value value)

Throws a script_error and returns false if the supplied value is not a campaign narrative trigger script object. If the supplied value is a narrative trigger then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a campaign narrative trigger script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2634

Back to top

Battle Script Type Checking

The functions in this section can be used to check whether variables are of a script data type that is provided in battle.

validate.is_battlemanager(value value)

Throws a script_error and returns false if the supplied value is not a battle manager script object. If the supplied value is a battle manager then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2659

validate.is_cutscene(value value)

Throws a script_error and returns false if the supplied value is not a battle cutscene script object. If the supplied value is a battle cutscene then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle cutscene script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2666

validate.is_convexarea(value value)

Throws a script_error and returns false if the supplied value is not a battle convex area script object. If the supplied value is a battle convex area then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle convex area script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2673

validate.is_scriptunit(value value)

Throws a script_error and returns false if the supplied value is not a battle scriptunit object. If the supplied value is a scriptunit object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle scriptunit object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2680

validate.is_scriptunits(value value)

Throws a script_error and returns false if the supplied value is not a battle scriptunits collection object. If the supplied value is a scriptunits collection object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle scriptunits collection object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2687

validate.is_patrolmanager(value value)

Throws a script_error and returns false if the supplied value is not a battle patrol manager object. If the supplied value is a patrol manager collection object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle scriptunits collection object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2694

validate.is_waypoint(value value)

Throws a script_error and returns false if the supplied value is not a battle waypoint script object. If the supplied value is a waypoint object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle scriptunits collection object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2701

validate.is_scriptaiplanner(value value)

Throws a script_error and returns false if the supplied value is not a battle script ai planner object. If the supplied value is a script ai planner then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a battle script ai planner object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2708

validate.is_generatedbattle(value value)

Throws a script_error and returns false if the supplied value is not a generated battle script object. If the supplied value is a generated battle object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a generated battle object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2715

validate.is_generatedarmy(value value)

Throws a script_error and returns false if the supplied value is not a generated army script object. If the supplied value is a generated army object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a generated army object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2722

validate.is_generatedcutscene(value value)

Throws a script_error and returns false if the supplied value is not a generated cutscene script object. If the supplied value is a generated cutscene object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is a generated cutscene object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2729

validate.is_advicemanager(value value)

Throws a script_error and returns false if the supplied value is not an advice manager script object. If the supplied value is an advice manager object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an advice manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2736

validate.is_advicemonitor(value value)

Throws a script_error and returns false if the supplied value is not an advice monitor script object. If the supplied value is an advice monitor object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an advice monitor script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2743

validate.is_attacklanemanager(value value)

Throws a script_error and returns false if the supplied value is not an attack lane manager script object. If the supplied value is an attack lane manager object then true is returned.

Parameters:

1

value

value

Returns:

  1. boolean value is an attack lane manager script object

defined in ../../warhammer/working_data/script/_lib/lib_types.lua, line 2750

Last updated 7/9/2024 11:45:05 AM