Search:      Command spec. 🔗
Grp grpDesc opCode opName operand Note
Z01Operation Modifiers.0x80000000neg...Used in combination with conditional operations to invert their results.
Z01Operation Modifiers.0x40000000this_or_next...Used in combination with conditional operations to group them into OR blocks.
Z02Flow Control.1call_script<script_id>, [<script_param>...]Calls specified script with or without parameters. Maximum number of parameters you can pass with the operation is 16.
Z02Flow Control.4try_beginOpens a conditional block.
Z02Flow Control.5else_tryIf conditional operations in the conditional block before fail, this block of code will be executed, given that there are no conditional operations in this block or that they don't fail. Works also within try_for_agents and try_for_range.
Z02Flow Control.5else_try_beginDeprecated form of (else_try).
Z02Flow Control.3try_endConcludes a conditional block or a cycle.
Z02Flow Control.3end_tryDeprecated form of (try_end),
Z02Flow Control.6try_for_range<destination>, <lower_bound>, <upper_bound>Iterates from the <lower bound> to <<upper bound> -1>. <destination> is the variable iterated in the loop, which always increments to the next value at the end of the loop. Break the loop by lowering the upper bound.
Z02Flow Control.7try_for_range_backwards<destination>, <lower_bound>, <upper_bound>Iterates from <<upper bound> - 1> to the <lower bound>. <destination> is the variable iterated in the loop, which always decrements to the next value at the end of the loop. Break the loop by increasing the lower bound.
Z02Flow Control.11try_for_parties<destination>Runs a cycle, iterating all parties on the map.
Z02Flow Control.12try_for_agents<destination>, [<position_no>], [<radius_fixed_point>]Runs a cycle, iterating all active agents on the scene. Iteration works for active agents alive and dead, with optional parameters it only checks for those within the radius around the position. Don't use check agent_is_active. It will always return true.Avoid using pos0. This will pass zero to the second argument and radius and position will be skipped. Like position was ommited.
Z02Flow Control.16try_for_prop_instances<destination>, [<object_id>], [<object_type>]), Version 1.161+. Runs a cycle, iterating all valid scene prop instances on the scene. If <object_id> = <scene_prop_id> and <object_type> is not given, it loops through all instances. For object types see list of "somt_" in module_constants.py
Z02Flow Control.17try_for_players<destination>, [skip_server]Version 1.165+. Iterates through all active players in a multiplayer game. Set optional parameter to 1 to skip server player entry.
Z03Mathematical Operations.32gt<value1>, <value2>Checks that value1 > value2
Z03Mathematical Operations.30ge<value1>, <value2>Checks that value1 >= value2
Z03Mathematical Operations.31eq<value1>, <value2>Checks that value1 == value2
Z03Mathematical Operations.neg|eqneq<value1>, <value2>Checks that value1 != value2
Z03Mathematical Operations.neg|gtle<value1>, <value2>Checks that value1 <= value2
Z03Mathematical Operations.neg|gelt<value1>, <value2>Checks that value1 < value2
Z03Mathematical Operations.33is_between<value>, <lower_bound>, <upper_bound>Checks that lower_bound <= value < upper_boundMathematical and assignment operations
Z03Mathematical Operations.2133assign<destination>, <value>Directly assigns a value to a variable or register.
Z03Mathematical Operations.2120store_add<destination>, <value>, <value>Assigns <destination> := <value> + <value>
Z03Mathematical Operations.2121store_sub<destination>, <value>, <value>Assigns <destination> := <value> - <value>
Z03Mathematical Operations.2122store_mul<destination>, <value>, <value>Assigns <destination> := <value> * <value>
Z03Mathematical Operations.2123store_div<destination>, <value>, <value>Assigns <destination> := <value> / <value>Fractional part will be truncated. Negative values will be rounded up.
Z03Mathematical Operations.2119store_mod<destination>, <value>, <value>Assigns <destination> := <value> MOD <value>
Z03Mathematical Operations.2105val_add<destination>, <value>Assigns <destination> := <destination> + <value>
Z03Mathematical Operations.2106val_sub<destination>, <value>Assigns <destination> := <destination> - <value>
Z03Mathematical Operations.2107val_mul<destination>, <value>Assigns <destination> := <destination> * <value>
Z03Mathematical Operations.2108val_div<destination>, <value>Assigns <destination> := <destination> / <value>Fractional part will be truncated. Negative values will be rounded up.
Z03Mathematical Operations.2109val_mod<destination>, <value>Assigns <destination> := <destination> MOD <value>
Z03Mathematical Operations.2110val_min<destination>, <value>Assigns <destination> := MIN (<destination>, <value>)
Z03Mathematical Operations.2111val_max<destination>, <value>Assigns <destination> := MAX (<destination>, <value>)
Z03Mathematical Operations.2112val_clamp<destination>, <lower_bound>, <upper_bound>Enforces <destination> value to be within <lower_bound>..<upper_bound>-1 range. Whatever value the first argument may have had before, it won't be lower than the second argument (the minimum value) and it will be strictly less than the third argument (the maximum value).This is 100% equivalent to calling (val_min, <value>, (<upper_bound> - 1)), then (val_max, <value>, <lower_bound>).Instead of maintaining careful "data range integrity" throughout a series of operations, reasoning out by what means it could escape its expected bounds and covering those individually, you can insert this operation and ensure that it will produce an answer within the range you are looking for.
Z03Mathematical Operations.2113val_abs<destination>Assigns <destination> := ABS (<destination>)
Z03Mathematical Operations.2116store_or<destination>, <value>, <value>Binary OR
Z03Mathematical Operations.2117store_and<destination>, <value>, <value>Binary AND
Z03Mathematical Operations.2114val_or<destination>, <value>Binary OR, overwriting first operand.
Z03Mathematical Operations.2115val_and<destination>, <value>Binary AND, overwriting first operand.
Z03Mathematical Operations.2100val_lshift<destination>, <value>Bitwise shift left (dest = dest * 2 ^ value)
Z03Mathematical Operations.2101val_rshift<destination>, <value>Bitwise shift right (dest = dest / 2 ^ value)
Z03Mathematical Operations.2125store_sqrt<destination_fixed_point>, <value_fixed_point>Assigns dest := SQRT (value)
Z03Mathematical Operations.2126store_pow<destination_fixed_point>, <value_fixed_point>, <power_fixed_pointAssigns dest := value ^ power
Z03Mathematical Operations.2127store_sin<destination_fixed_point>, <value_fixed_point>Assigns dest := SIN (value)
Z03Mathematical Operations.2128store_cos<destination_fixed_point>, <value_fixed_point>Assigns dest := COS (value)
Z03Mathematical Operations.2129store_tan<destination_fixed_point>, <value_fixed_point>Assigns dest := TAN (value)
Z03Mathematical Operations.2140store_asin<destination_fixed_point>, <value_fixed_point>Assigns dest := ARCSIN (value)
Z03Mathematical Operations.2141store_acos<destination_fixed_point>, <value_fixed_point>Assigns dest := ARCCOS (value)
Z03Mathematical Operations.2142store_atan<destination_fixed_point>, <value_fixed_point>Assigns dest := ARCTAN (value)
Z03Mathematical Operations.2143store_atan2<destination_fixed_point>, <y_fixed_point>, <x_fixed_point>Returns the angle between the x axis and a point with coordinates (X,Y) in degrees. Note the angle is calculated counter-clockwise, i.e. (1,1) will return 45, not -45.Random number generation
Z03Mathematical Operations.2135store_random<destination>, <upper_range>Stores a random value in the range of 0..<upper_range>-1. Deprecated, use (store_random_in_range) instead.
Z03Mathematical Operations.2136store_random_in_range<destination>, <range_low>, <range_high>Stores a random value in the range of <range_low>..<range_high>-1.
Z03Mathematical Operations.2134shuffle_range<reg_no>, <reg_no>Randomly shuffles a range of registers, reordering the values contained in them. Commonly used for list randomization.Fixed point values handling
Z03Mathematical Operations.2124set_fixed_point_multiplier<value>Affects all operations dealing with fixed point numbers. Default value is 1.
Z03Mathematical Operations.2130convert_to_fixed_point<destination_fixed_point>Converts integer value to fixed point (multiplies by the fixed point multiplier).
Z03Mathematical Operations.2131convert_from_fixed_point<destination>Converts fixed point value to integer (divides by the fixed point multiplier).
Z04Script/Trigger Parameters and Results.21store_script_param_1<destination>Retrieve the value of the first script parameter. If the script was called without this parameter being specified, this operation assigns a zero.
Z04Script/Trigger Parameters and Results.22store_script_param_2<destination>Retrieve the value of the second script parameter. If the script was called without this parameter being specified, this operation assigns a zero.
Z04Script/Trigger Parameters and Results.23store_script_param<destination>, <script_param_index>Retrieve the value of arbitrary script parameter (generally used when script accepts more than two). Parameters are enumerated starting from 1. Maximum are 15 parameters (16 operands maximum - 1 operand with script name). If the script was called without this parameter being specified, this operation assigns a zero.
Z04Script/Trigger Parameters and Results.60set_result_string<string>Sets the return value of a game_* script, when a string value is expected by game engine.
Z04Script/Trigger Parameters and Results.2071store_trigger_param_1<destination>Retrieve the value of the first trigger parameter. Will retrieve trigger's parameters even when called from inside a script, for as long as that script is running within trigger context.
Z04Script/Trigger Parameters and Results.2072store_trigger_param_2<destination>Retrieve the value of the second trigger parameter. Will retrieve trigger's parameters even when called from inside a script, for as long as that script is running within trigger context.
Z04Script/Trigger Parameters and Results.2073store_trigger_param_3<destination>Retrieve the value of the third trigger parameter. Will retrieve trigger's parameters even when called from inside a script, for as long as that script is running within trigger context.
Z04Script/Trigger Parameters and Results.2070store_trigger_param<destination>, <trigger_param_no>Version 1.153+. Retrieve the value of arbitrary trigger parameter. Parameters are enumerated starting from 1. Will retrieve trigger's parameters even when called from inside a script, for as long as that script is running within trigger context.
Z04Script/Trigger Parameters and Results.702get_trigger_object_position<position>Retrieve the position of an object which caused the trigger to fire (when appropriate).
Z04Script/Trigger Parameters and Results.2075set_trigger_result<value>Sets the return value of a trigger or game_* script, when an integer value is expected by game engine.
Z05Keyboard and Mouse Input.70key_is_down<key_code>Checks if the specified key is clicked in the current frame, ignoring if it was clicked in the previous frame. Is true in every frame that the key is down. See header_triggers.py for key code reference.
Z05Keyboard and Mouse Input.71key_clicked<key_code>Checks if the specified key is clicked in the current frame and wasn't clicked in the previous frame. Is only true in the one frame where the engine first recognizes that the key is pressed. See header_triggers.py for key code reference. Will work reliably only on mission template triggers that happen on every frame (i.e. check interval 0) as well as on simple_triggers or old form triggers that are check interval 0 too.
Z05Keyboard and Mouse Input.72game_key_is_down<game_key_code>Checks if the specified key is clicked in the current frame, ignoring if it was clicked in the previous frame. Is true in every frame that the key is down. See header_triggers.py for game key code reference.
Z05Keyboard and Mouse Input.73game_key_clicked<game_key_code>Checks if the specified key is clicked in the current frame and wasn't clicked in the previous frame. Is only true in the one frame where the engine first recognizes that the key is pressed. See header_triggers.py for game key code reference. Will work reliably only on mission template triggers that happen on every frame (i.e. check interval 0) as well as on simple_triggers or old form triggers that are check interval 0 too.Generic operations
Z05Keyboard and Mouse Input.77omit_key_once<key_code>Forces the game to ignore default bound action for the specified key on next press. Some keys can't be omited. Keys that can be omited:gk_everyone_hear, gk_infantry_hear, gk_archers_hear, gk_cavalry_hear, gk_group0_hear = gk_infantry_hear, gk_group1_hear = gk_archers_hear, gk_group2_hear = gk_cavalry_heargk_group3_hear, gk_group4_hear, gk_group5_hear, gk_group6_hear, gk_group7_hear, gk_group8_hear, gk_reverse_order_group, gk_everyone_around_heargk_action (mount, dismount fail, picking weapon from the ground works), gk_kick, gk_toggle_weapon_mode, gk_sheath_weapon, gk_cam_toggle, gk_crouch (need to set can_crouch = 1 in module.ini)key_mouse_scroll_up, key_mouse_scroll_down, key_space, key_pad or key_xbox (from 0xF0 to 0xFF - possible works for all),You can bypass F1-F8 menu with the operation (close_order_menu),
Z05Keyboard and Mouse Input.78clear_omitted_keysClears all omitted keys.
Z05Keyboard and Mouse Input.75mouse_get_position<position>Stores mouse x and y coordinates in the specified position.
Z06World Map.2273is_currently_nightChecks that it's currently night in the game.
Z06World Map.37map_freeChecks that the player is currently on the global map and no game screens are open.Weather-handling operations
Z06World Map.90get_global_cloud_amount<destination>Returns current cloudiness (a value between 0..100).
Z06World Map.91set_global_cloud_amount<value>Sets current cloudiness (value is clamped to 0..100).
Z06World Map.92get_global_haze_amount<destination>Returns current fogginess (value between 0..100).
Z06World Map.93set_global_haze_amount<value>Sets current fogginess (value is clamped to 0..100).Time-related operations
Z06World Map.2270store_current_hours<destination>Stores number of hours that have passed since beginning of the game. Commonly used to track time when accuracy up to hours is required.
Z06World Map.2271store_time_of_day<destination>Stores current day hour (value in 0..24 range).
Z06World Map.2272store_current_day<destination>Stores number of days that have passed since beginning of the game. Commonly used to track time when high accuracy is not required.
Z06World Map.1030rest_for_hours<rest_time_in_hours>, [time_speed_multiplier], [remain_attackable]Forces the player party to rest for specified number of hours. Time can be accelerated and player can be made immune or subject to attacks.
Z06World Map.1031rest_for_hours_interactive<rest_time_in_hours>, [time_speed_multiplier], [remain_attackable]Forces the player party to rest for specified number of hours. Player can break the rest at any moment. Time can be accelerated and player can be made immune or subject to attacks.
Z07Game Settings.250is_trial_versionChecks if the game is in trial mode (has not been purchased). Player cannot get higher than level 6 in this mode.
Z07Game Settings.255is_edit_mode_enabledVersion 1.153+. Checks if Edit Mode is currently enabled in the game. Useful for making additions to the default UI.
Z07Game Settings.53is_cheat_mode_enabledChecks if Cheat Mode is currently enabled in-game via tick at "Enable Cheats" in the launcher.Generic operations
Z07Game Settings.55get_operation_set_version<destination>Version 1.165+. 4research. Apparently returns the current version of Module System operations set, allowing transparent support for multiple Warband engine versions.
Z07Game Settings.47set_player_troop<troop_id>Changes the troop player controls. Generally used in quick-battle scenarios to give player a predefined character.
Z07Game Settings.960show_object_details_overlay<value>Turns various popup tooltips on (value = 1) and off (value = 0). This includes agent names and dropped item names during missions, item stats in inventory on mouse over, etc.
Z07Game Settings.985auto_saveVersion 1.161+. Saves the game to the current save slot.
Z07Game Settings.988allow_ironman<value>), 1 = allow, 0 = disallow. Used on new games to disable realistic mode.Access to game options
Z07Game Settings.260options_get_damage_to_player<destination>0 = 1/4, 1 = 1/2, 2 = 1/1
Z07Game Settings.261options_set_damage_to_player<value>0 = 1/4, 1 = 1/2, 2 = 1/1
Z07Game Settings.262options_get_damage_to_friends<destination>0 = 1/2, 1 = 3/4, 2 = 1/1
Z07Game Settings.263options_set_damage_to_friends<value>0 = 1/2, 1 = 3/4, 2 = 1/1
Z07Game Settings.264options_get_combat_ai<destination>0 = good, 1 = average, 2 = poor
Z07Game Settings.265options_set_combat_ai<value>0 = good, 1 = average, 2 = poor
Z07Game Settings.424game_get_reduce_campaign_ai<destination>Deprecated operation. Use options_get_campaign_ai instead
Z07Game Settings.266options_get_campaign_ai<destination>0 = good, 1 = average, 2 = poor
Z07Game Settings.267options_set_campaign_ai<value>0 = good, 1 = average, 2 = poor
Z07Game Settings.268options_get_combat_speed<destination>0 = slowest, 1 = slower, 2 = normal, 3 = faster, 4 = fastest
Z07Game Settings.269options_set_combat_speed<value>0 = slowest, 1 = slower, 2 = normal, 3 = faster, 4 = fastest
Z07Game Settings.270options_get_battle_size<destination>Version 1.161+. Retrieves current battle size slider value (in the range of 0..1000). Note that this is the slider value, not the battle size itself.
Z07Game Settings.271options_set_battle_size<value>Version 1.161+. Sets battle size slider to provided value (in the range of 0..1000). Note that this is the slider value, not the battle size itself.To change the real battlesize the entry string at the begining of the mission templates needs to get changed. Multiplier start from 1.25 to 5.25 according to options slider.(1, mtef_team_0|mtef_defenders, 0, aif_start_alarmed, 40, []),Battle reinforcements are half of the start:(store_normalized_team_count, ":num_defenders", 0),(lt, ":num_defenders", 20), # if less than 20/40=50%(add_reinforcements_to_entry, 4, 20), # add new wave 20/40=50%To let options show the rigth battle size values change the entries in module.ini accordingly:battle_size_min = 100 # (40+40)*1.25battle_size_max = 420 # (40+40)*5.25The battle advantage for player is limited by the game engine. The player can only dominate with 2:1 ratio at max.
Z07Game Settings.990get_average_game_difficulty<destination>Returns calculated game difficulty rating (as displayed on the Options page). Commonly used for score calculation when ending the game.Achievements and kill stats
Z07Game Settings.370get_achievement_stat<destination>, <achievement_id>, <stat_index>Retrieves the numeric value associated with an achievement. Used to keep track of player's results before finally unlocking it.
Z07Game Settings.371set_achievement_stat<achievement_id>, <stat_index>, <value>Sets the new value associated with an achievement. Used to keep track of player's results before finally unlocking it.
Z07Game Settings.372unlock_achievement<achievement_id>Unlocks player's achievement. Apparently doesn't have any game effects.
Z07Game Settings.1701get_player_agent_kill_count<destination>, [get_wounded]Retrieves the total number of enemies killed by the player. Call with non-zero <get_wounded> parameter to retrieve the total number of knocked down enemies. Returns lifetime kill counts.
Z07Game Settings.1705get_player_agent_own_troop_kill_count<destination>, [get_wounded]Retrieves the total number of allies killed by the player. Call with non-zero <get_wounded> parameter to retrieve the total number of knocked down allies.
Z08Factions.502faction_set_slot<faction_id>, <slot_no>, <value>
Z08Factions.522faction_get_slot<destination>, <faction_id>, <slot_no>
Z08Factions.542faction_slot_eq<faction_id>, <slot_no>, <value>
Z08Factions.562faction_slot_ge<faction_id>, <slot_no>, <value>
Z08Factions.neg|faction_slot_gefaction_slot_lt<faction_id>, <slot_no>, <value>Generic operations
Z08Factions.1270set_relation<faction_id_1>, <faction_id_2>, <value>Sets relation between two factions. Relation is in -100..100 range.
Z08Factions.2190store_relation<destination>, <faction_id_1>, <faction_id_2>Retrieves relation between two factions. Relation is in -100..100 range.
Z08Factions.1275faction_set_name<faction_id>, <string>Sets the name of the faction. See also (str_store_faction_name) in String Operations.
Z08Factions.1276faction_set_color<faction_id>, <color_code>Sets the faction color. All parties and centers belonging to this faction will be displayed with this color on global map.
Z08Factions.1277faction_get_color<destination>, <faction_id>Gets the faction color value.
Z09Parties and Party Templates.101hero_can_join[party_id]Checks if party can accept one hero troop. Player's party is default value.
Z09Parties and Party Templates.102hero_can_join_as_prisoner[party_id]Checks if party can accept one hero prisoner troop. Player's party is default value.
Z09Parties and Party Templates.103party_can_joinDuring encounter dialog, checks if encountered party can join player's party.
Z09Parties and Party Templates.104party_can_join_as_prisonerDuring encounter dialog, checks if encountered party can join player's party as prisoners.
Z09Parties and Party Templates.105troops_can_join<value>Checks if player party has enough space for provided number of troops.
Z09Parties and Party Templates.106troops_can_join_as_prisoner<value>Checks if player party has enough space for provided number of prisoners..
Z09Parties and Party Templates.107party_can_join_party<joiner_party_id>, <host_party_id>, [flip_prisoners]Checks if first party can join second party (enough space for both troops and prisoners). If flip_prisoners flag is 1, then members and prisoners in the joining party are flipped.
Z09Parties and Party Templates.110main_party_has_troop<troop_id>Checks if player party has specified troop.
Z09Parties and Party Templates.130party_is_in_town<party_id>, <town_party_id>Checks that the party has successfully reached its destination (after being set to ai_bhvr_travel_to_party) and that its destination is actually the referenced town_party_id.
Z09Parties and Party Templates.131party_is_in_any_town<party_id>Checks that the party has successfully reached its destination (after being set to ai_bhvr_travel_to_party).
Z09Parties and Party Templates.132party_is_active<party_id>Checks that <party_id> is valid and not disabled.
Z09Parties and Party Templates.neg|party_is_activeparty_is_dead<party_id>Slot operations for parties and party templates
Z09Parties and Party Templates.504party_template_set_slot<party_template_id>, <slot_no>, <value>
Z09Parties and Party Templates.524party_template_get_slot<destination>, <party_template_id>, <slot_no>
Z09Parties and Party Templates.544party_template_slot_eq<party_template_id>, <slot_no>, <value>
Z09Parties and Party Templates.564party_template_slot_ge<party_template_id>, <slot_no>, <value>
Z09Parties and Party Templates.neg|party_template_slot_geparty_template_slot_lt<party_template_id>, <slot_no>, <value>
Z09Parties and Party Templates.501party_set_slot<party_id>, <slot_no>, <value>
Z09Parties and Party Templates.521party_get_slot<destination>, <party_id>, <slot_no>
Z09Parties and Party Templates.541party_slot_eq<party_id>, <slot_no>, <value>
Z09Parties and Party Templates.561party_slot_ge<party_id>, <slot_no>, <value>
Z09Parties and Party Templates.neg|party_slot_geparty_slot_lt<party_id>, <slot_no>, <value>Generic operations
Z09Parties and Party Templates.1080set_party_creation_random_limits<min_value>, <max_value>Affects party sizes spawned from templates. May be used to spawn larger parties when player is high level. Values should be in 0..100 range.
Z09Parties and Party Templates.1103set_spawn_radius<value>Sets radius for party spawning with subsequent <spawn_around_party> operations.
Z09Parties and Party Templates.1100spawn_around_party<party_id>, <party_template_id>Creates a new party from a party template and puts its <party_id> into reg0.
Z09Parties and Party Templates.1230disable_party<party_id>Party disappears from the map. Note that (try_for_parties) will still iterate over disabled parties, so you need to make additional checks with (party_is_active). Its slots, members and prisoners will persist, all it does is basically activating pf_disabled mid-game.
Z09Parties and Party Templates.1231enable_party<party_id>Reactivates a previously disabled party.
Z09Parties and Party Templates.1232remove_party<party_id>Destroys a party completely. Should ONLY be used with dynamically spawned parties, as removing parties pre-defined in module_parties.py file will corrupt the savegame. Non-spawned parties may be disabled...
Z09Parties and Party Templates.1608party_get_current_terrain<destination>, <party_id>Returns a value from header_terrain_types.py
Z09Parties and Party Templates.1623party_relocate_near_party<relocated_party_id>, <target_party_id>, <spawn_radius>Teleports party into vicinity of another party.
Z09Parties and Party Templates.1625party_get_position<dest_position>, <party_id>Stores current position of the party on world map.
Z09Parties and Party Templates.1626party_set_position<party_id>, <position>Teleports party to a specified position on the world map.
Z09Parties and Party Templates.1021set_camera_follow_party<party_id>Self-explanatory. Can be used on world map only. Commonly used to make camera follow a party which has captured player as prisoner.
Z09Parties and Party Templates.1660party_attach_to_party<party_id>, <party_id_to_attach_to>Attach a party to another one (like lord's army staying in a town/castle).
Z09Parties and Party Templates.1661party_detach<party_id>Remove a party from attachments and place it on the world map.
Z09Parties and Party Templates.1662party_collect_attachments_to_party<source_party_id>, <collected_party_id>Mostly used in various battle and AI calculations. Will create an aggregate party from all parties attached to the source party.
Z09Parties and Party Templates.1665party_get_cur_town<destination>, <party_id>When a party has reached its destination (using ai_bhvr_travel_to_party), this operation will retrieve the party_id of the destination party.
Z09Parties and Party Templates.1694party_get_attached_to<destination>, <party_id>Retrieves the party that the referenced party is attached to, if any.
Z09Parties and Party Templates.1695party_get_num_attached_parties<destination>, <party_id>Retrieves total number of parties attached to referenced party.
Z09Parties and Party Templates.1696party_get_attached_party_with_rank<destination>, <party_id>, <attached_party_index>Extract party_id of a specified party among attached.
Z09Parties and Party Templates.1669party_set_name<party_id>, <string>Sets party name (will be displayed as label and/or in the party details popup).
Z09Parties and Party Templates.1605party_set_extra_text<party_id>, <string>Allows to put extra text in party details popup. Used in Native to set status for villages or towns (being raided, razed, under siege...).
Z09Parties and Party Templates.1681party_get_icon<destination>, <party_id>Retrieve map icon used for the party.
Z09Parties and Party Templates.1676party_set_icon<party_id>, <map_icon_id>Sets what map icon will be used for the party. Will not work outside the 256 range.
Z09Parties and Party Templates.1677party_set_banner_icon<party_id>, <map_icon_id>Sets what map icon will be used as the party banner. Use 0 to remove banner from a party. Allows for 256+ ranges.
Z09Parties and Party Templates.1682party_set_extra_icon<party_id>, <map_icon_id>, <vertical_offset_fixed_point>, <up_down_frequency_fixed_point>, <rotate_frequency_fixed_point>, <fade_in_out_frequency_fixed_point>Frequencies are in number of revolutions per second.Adds or removes an extra map icon to a party, possibly with some animations. Use (party_set_extra_icon, <party_id>, 0, 0, 0, 0, 0), - (0 as map_icon_id) - to remove extra icon. Allows for 256+ ranges and some animation features too, recommended for people seeking 256+ ranges.
Z09Parties and Party Templates.1678party_add_particle_system<party_id>, <particle_system_id>Appends some special visual effects to the party on the map. Used in Native to add fire and smoke over villages.
Z09Parties and Party Templates.1679party_clear_particle_systems<party_id>Removes all special visual effects from the party on the map.
Z09Parties and Party Templates.980context_menu_add_item<string_id>, <value>Must be called inside script_game_context_menu_get_buttons. Adds context menu option for a party and its respective identifier (will be passed to script_game_event_context_menu_button_clicked).
Z09Parties and Party Templates.1609party_get_template_id<destination>, <party_id>Retrieves what party template was used to create the party (if any). Commonly used to identify encountered party type.
Z09Parties and Party Templates.1620party_set_faction<party_id>, <faction_id>Sets party faction allegiance. Party color is changed appropriately.
Z09Parties and Party Templates.2204store_faction_of_party<destination>, <party_id>Retrieves current faction allegiance of the party.
Z09Parties and Party Templates.2254store_random_party_in_range<destination>, <lower_bound>, <upper_bound>Retrieves one random party from the range. Generally used only for predefined parties (towns, villages etc).
Z09Parties and Party Templates.2255store01_random_parties_in_range<lower_bound>, <upper_bound>
Z09Parties and Party Templates.store01_random_parties_in_rangestore_random_parties_in_range<lower_bound>, <upper_bound>Stores two random, different parties in a range to reg0 and reg1. Generally used only for predefined parties (towns, villages etc).
Z09Parties and Party Templates.2281store_distance_to_party_from_party<destination>, <party_id>, <party_id>Retrieves distance between two parties on the global map. Extremely unprecise as it does not use a fixed point multiplier at all and 1 distance unit is quite a noticeable distance on the map. Instead of making decisions based on the output of this operation, first use it to measure distances between various parties on the map and print the results with display_message in order to get a feeling for this function.
Z09Parties and Party Templates.2310store_num_parties_of_template<destination>, <party_template_id>Stores number of active parties which were created using specified party template.
Z09Parties and Party Templates.2311store_random_party_of_template<destination>, <party_template_id>Retrieves one random party which was created using specified party template. Fails if no party exists with provided template. (expensive)
Z09Parties and Party Templates.2300store_num_parties_created<destination>, <party_template_id>Stores the total number of created parties of specified type. Not used in Native.
Z09Parties and Party Templates.2301store_num_parties_destroyed<destination>, <party_template_id>Stores the total number of destroyed parties of specified type.
Z09Parties and Party Templates.2302store_num_parties_destroyed_by_player<destination>, <party_template_id>Stores the total number of parties of specified type which have been destroyed by player.
Z09Parties and Party Templates.1671party_get_morale<destination>, <party_id>Returns a value in the range of 0..100. Party morale does not affect party behavior on the map, but will be taken in account if the party is engaged in battle (except auto-calc).
Z09Parties and Party Templates.1672party_set_morale<party_id>, <value>Value should be in the range of 0..100. Party morale does not affect party behavior on the map, but will be taken in account if the party is engaged in battle (except auto-calc).Party members manipulation
Z09Parties and Party Templates.1201party_joinDuring encounter, joins encountered party to player's party.
Z09Parties and Party Templates.1202party_join_as_prisonerDuring encounter, joins encountered party to player's party as prisoners.
Z09Parties and Party Templates.1203troop_join<troop_id>Specified hero joins player's party.
Z09Parties and Party Templates.1204troop_join_as_prisoner<troop_id>Specified hero joins player's party as prisoner.
Z09Parties and Party Templates.1233add_companion_party<troop_id_hero>Creates a new empty party with specified hero as party leader and the only member. Party is spawned at the position of player's party.
Z09Parties and Party Templates.1610party_add_members<party_id>, <troop_id>, <number>Adds troop(s) to the party. Returns total number of added troops in reg0.
Z09Parties and Party Templates.1611party_add_prisoners<party_id>, <troop_id>, <number>Adds troop(s) to the party and makes it Prisoner. Returns total number of added prisoners in reg0.
Z09Parties and Party Templates.1612party_add_leader<party_id>, <troop_id>, [number]Adds troop(s) to the party and makes it party leader.
Z09Parties and Party Templates.1613party_force_add_members<party_id>, <troop_id>, <number>Adds troops to party ignoring party size limits. Mostly used to add hero troops. Only works if the party does not yet have any troops of the specified type.
Z09Parties and Party Templates.1614party_force_add_prisoners<party_id>, <troop_id>, <number>Adds prisoners to party ignoring party size limits. Mostly used to add hero prisoners. Doesn't add if troop already exist in the party.
Z09Parties and Party Templates.1675party_add_template<party_id>, <party_template_id>, [reverse_prisoner_status]Reinforces the party using the specified party template. Optional flag switches troop/prisoner status for reinforcements.
Z09Parties and Party Templates.1698distribute_party_among_party_group<party_to_be_distributed>, <group_root_party>Distributes troops from first party among all parties attached to the second party. Commonly used to divide prisoners and resqued troops among NPC parties.
Z09Parties and Party Templates.1210remove_member_from_party<troop_id>, [party_id]Removes hero member from party. Player party is default value. Will display a message about companion leaving the party. Should not be used with regular troops (it will successfully remove one of them, but will produce some meaningless spam).
Z09Parties and Party Templates.1211remove_regular_prisoners<party_id>Removes all non-hero prisoners from the party.
Z09Parties and Party Templates.1215remove_troops_from_companions<troop_id>, <value>Removes troops from player's party, duplicating functionality of (party_remove_members) but providing less flexibility.
Z09Parties and Party Templates.1216remove_troops_from_prisoners<troop_id>, <value>Removes prisoners from player's party.
Z09Parties and Party Templates.1615party_remove_members<party_id>, <troop_id>, <number>Removes specified number of troops from a party. Stores number of actually removed troops in reg0.
Z09Parties and Party Templates.1616party_remove_prisoners<party_id>, <troop_id>, <number>Removes specified number of prisoners from a party. Stores number of actually removed prisoners in reg0.
Z09Parties and Party Templates.1617party_clear<party_id>Removes all members and prisoners from the party.
Z09Parties and Party Templates.1070add_gold_to_party<value>, <party_id>Marks the party as carrying the specified amount of gold, which can be pillaged by player if he destroys it. Operation must not be used to give gold to player's party.Calculating party and stack sizes
Z09Parties and Party Templates.1601party_get_num_companions<destination>, <party_id>Returns total number of party members, including leader.
Z09Parties and Party Templates.1602party_get_num_prisoners<destination>, <party_id>Returns total number of party prisoners.
Z09Parties and Party Templates.1630party_count_members_of_type<destination>, <party_id>, <troop_id>Returns total number of party members of specific type.
Z09Parties and Party Templates.1631party_count_companions_of_type<destination>, <party_id>, <troop_id>Duplicates (party_count_members_of_type).
Z09Parties and Party Templates.1632party_count_prisoners_of_type<destination>, <party_id>, <troop_id>Returns total number of prisoners of specific type.
Z09Parties and Party Templates.1633party_get_free_companions_capacity<destination>, <party_id>Calculates how many members can be added to the party.
Z09Parties and Party Templates.1634party_get_free_prisoners_capacity<destination>, <party_id>Calculates how many prisoners can be added to the party.
Z09Parties and Party Templates.1650party_get_num_companion_stacks<destination>, <party_id>Returns total number of troop stacks in the party (including player and heroes).
Z09Parties and Party Templates.1651party_get_num_prisoner_stacks<destination>, <party_id>Returns total number of prisoner stacks in the party (including any heroes).
Z09Parties and Party Templates.1652party_stack_get_troop_id<destination>, <party_id>, <stack_no>Extracts troop type of the specified troop stack.
Z09Parties and Party Templates.1653party_stack_get_size<destination>, <party_id>, <stack_no>Extracts number of troops in the specified troop stack.
Z09Parties and Party Templates.1654party_stack_get_num_wounded<destination>, <party_id>, <stack_no>Extracts number of wounded troops in the specified troop stack.
Z09Parties and Party Templates.1655party_stack_get_troop_dna<destination>, <party_id>, <stack_no>Extracts DNA from the specified troop stack. Used to properly generate appereance in conversations.
Z09Parties and Party Templates.1656party_prisoner_stack_get_troop_id<destination>, <party_id>, <stack_no>Extracts troop type of the specified prisoner stack.
Z09Parties and Party Templates.1657party_prisoner_stack_get_size<destination>, <party_id>, <stack_no>Extracts number of troops in the specified prisoner stack.
Z09Parties and Party Templates.1658party_prisoner_stack_get_troop_dna<destination>, <party_id>, <stack_no>Extracts DNA from the specified prisoner stack. Used to properly generate appereance in conversations.
Z09Parties and Party Templates.2154store_num_free_stacks<destination>, <party_id>Deprecated, as Warband no longer has limits on number of stacks in the party. Always returns 10.
Z09Parties and Party Templates.2155store_num_free_prisoner_stacks<destination>, <party_id>Deprecated, as Warband no longer has limits on number of stacks in the party. Always returns 10.
Z09Parties and Party Templates.2156store_party_size<destination>,[party_id]Stores total party size (all members and prisoners).
Z09Parties and Party Templates.2157store_party_size_wo_prisoners<destination>, [party_id]Stores total number of members in the party (without prisoners), duplicating (party_get_num_companions).
Z09Parties and Party Templates.2158store_troop_kind_count<destination>, <troop_type_id>Counts number of troops of specified type in player's party. Deprecated, use party_count_members_of_type instead.
Z09Parties and Party Templates.2159store_num_regular_prisoners<destination>, <party_id>Deprecated and does not work. Do not use.
Z09Parties and Party Templates.2160store_troop_count_companions<destination>, <troop_id>, [party_id]Apparently deprecated, duplicates (party_get_num_companions). Not used in Native.
Z09Parties and Party Templates.2161store_troop_count_prisoners<destination>, <troop_id>, [party_id]Apparently deprecated, duplicates (party_get_num_prisoners). Not used in Native.
Z09Parties and Party Templates.2180store_main_party_wounded<destination>Stores number of wounded troops and NPCs in the main player party into <destination>.Party experience and skills
Z09Parties and Party Templates.1670party_add_xp_to_stack<party_id>, <stack_no>, <xp_amount>Awards specified number of xp points to a single troop stack in the party.
Z09Parties and Party Templates.1673party_upgrade_with_xp<party_id>, <xp_amount>, <upgrade_path>), #upgrade_path can be:Awards specified number of xp points to entire party (split between all stacks) and upgrades all eligible troops. Upgrade direction: (0 = random, 1 = first, 2 = second).
Z09Parties and Party Templates.1674party_add_xp<party_id>, <xp_amount>Awards specified number of xp points to entire party (split between all stacks).
Z09Parties and Party Templates.1685party_get_skill_level<destination>, <party_id>, <skill_no>Retrieves skill level for the specified party (usually max among the heroes). Makes a callback to (script_game_get_skill_modifier_for_troop).Combat related operations
Z09Parties and Party Templates.1225heal_party<party_id>Heals all wounded party members.
Z09Parties and Party Templates.1618party_wound_members<party_id>, <troop_id>, <number>Wounds a specified number of troops in the party.
Z09Parties and Party Templates.1619party_remove_members_wounded_first<party_id>, <troop_id>, <number>Removes a certain number of troops from the party, starting with wounded. Stores total number removed in reg0.
Z09Parties and Party Templates.1663party_quick_attach_to_current_battle<party_id>, <side>Adds any party into current encounter at specified side (0 = ally, 1 = enemy, 2 = enemy if (neq, "$g_enemy_party", "$g_encountered_party"),).
Z09Parties and Party Templates.1666party_leave_cur_battle<party_id>Forces the party to leave its current battle (if it's engaged).
Z09Parties and Party Templates.1667party_set_next_battle_simulation_time<party_id>, <next_simulation_time_in_hours>Defines the period of time (in hours) after which the battle must be simulated for the specified party for the next time. When a value <= 0 is passed, the combat simulation round is performed immediately.
Z09Parties and Party Templates.1680party_get_battle_opponent<destination>, <party_id>When a party is engaged in battle with another party, returns its opponent party. Otherwise returns -1.
Z09Parties and Party Templates.1697inflict_casualties_to_party_group<parent_party_id>, <damage_amount>, <party_id_to_add_causalties_to>Delivers auto-calculated damage to the party (and all other parties attached to it). Killed troops are moved to another party to keep track of.
Z09Parties and Party Templates.108party_end_battle<party_no>Version 1.153+. UNTESTED. Supposedly ends the battle in which the party is currently participating.Party AI
Z09Parties and Party Templates.1604party_set_marshall<party_id>, <value>
Z09Parties and Party Templates.party_set_marshallparty_set_marshal<party_id>, <value>Sets party as a marshall party or turns it back to normal party. Value is either 1 or 0. This affects party behavior, but exact effects are not known. Alternative operation name spelling added to enable compatibility with Viking Conquest DLC module system.
Z09Parties and Party Templates.1603party_set_flags<party_id>, <flag>, <clear_or_set>Sets (1) or clears (0) party flags in runtime. See header_parties.py for flags reference.
Z09Parties and Party Templates.1606party_set_aggressiveness<party_id>, <number>Sets aggressiveness value for the party (range 0..15).
Z09Parties and Party Templates.1607party_set_courage<party_id>, <number>Sets courage value for the party (range 4..15).
Z09Parties and Party Templates.1638party_get_ai_initiative<destination>, <party_id>Gets party current AI initiative value (range 0..100).
Z09Parties and Party Templates.1639party_set_ai_initiative<party_id>, <value>Sets AI initiative value for the party (range 0..100).
Z09Parties and Party Templates.1640party_set_ai_behavior<party_id>, <ai_bhvr>Sets AI behavior for the party. See header_parties.py for reference.
Z09Parties and Party Templates.1641party_set_ai_object<party_id>, <object_party_id>Sets another party as the object for current AI behavior (follow that party).
Z09Parties and Party Templates.1642party_set_ai_target_position<party_id>, <position>Sets a specific world map position as the object for current AI behavior (travel to that point).
Z09Parties and Party Templates.1643party_set_ai_patrol_radius<party_id>, <radius_in_km>Sets a radius for AI patrolling behavior.
Z09Parties and Party Templates.1644party_ignore_player<party_id>, <duration_in_hours>Makes AI party ignore player for the specified time.
Z09Parties and Party Templates.1645party_set_bandit_attraction<party_id>, <attaraction>Sets party attractiveness to parties with bandit behavior (range 0..100).
Z09Parties and Party Templates.1646party_get_helpfulness<destination>, <party_id>Gets party current AI helpfulness value (range 0..100).
Z09Parties and Party Templates.1647party_set_helpfulness<party_id>, <number>Sets AI helpfulness value for the party (range 0..10000, default 100).Official: tendency to help friendly parties under attack.
Z09Parties and Party Templates.2290get_party_ai_behavior<destination>, <party_id>Retrieves current AI behavior pattern for the party.
Z09Parties and Party Templates.2291get_party_ai_object<destination>, <party_id>Retrieves what party is currently used as object for AI behavior.
Z09Parties and Party Templates.2292party_get_ai_target_position<position>, <party_id>Retrieves what position is currently used as object for AI behavior.
Z09Parties and Party Templates.2293get_party_ai_current_behavior<destination>, <party_id>Retrieves current AI behavior pattern when it was overridden by current situation (fleeing from enemy when en route to destination).
Z09Parties and Party Templates.2294get_party_ai_current_object<destination>, <party_id>Retrieves what party has caused temporary behavior switch.
Z09Parties and Party Templates.1648party_set_ignore_with_player_party<party_id>, <value>Version 1.161+. Effects uncertain. 4research
Z09Parties and Party Templates.1649party_get_ignore_with_player_party<party_id>Version 1.161+. Effects uncertain. Documented official syntax is suspicious and probably incorrect. 4research
Z10Troops.151troop_has_item_equipped<troop_id>, <item_id>Checks that the troop has this item equipped (worn or wielded).
Z10Troops.152troop_is_mounted<troop_id>Checks the troop for tf_mounted flag (see header_troops.py). Does NOT check that the troop has a horse.
Z10Troops.153troop_is_guarantee_ranged<troop_id>Checks the troop for tf_guarantee_ranged flag (see header_troops.py). Does not check that troop actually has some ranged weapon.
Z10Troops.154troop_is_guarantee_horse<troop_id>Checks the troop for tf_guarantee_horse flag (see header_troops.py). Does not check that troop actually has some horse.
Z10Troops.1507troop_is_hero<troop_id>Checks the troop for tf_hero flag (see header_troops.py). Hero troops are actual characters and do not stack in party window.
Z10Troops.1508troop_is_wounded<troop_id>Checks that the troop is wounded. Only works for hero troops.
Z10Troops.150player_has_item<item_id>Checks that player has the specified item.Slot operations for troops
Z10Troops.500troop_set_slot<troop_id>, <slot_no>, <value>
Z10Troops.520troop_get_slot<destination>, <troop_id>, <slot_no>
Z10Troops.540troop_slot_eq<troop_id>, <slot_no>, <value>
Z10Troops.560troop_slot_ge<troop_id>, <slot_no>, <value>
Z10Troops.neg|troop_slot_getroop_slot_lt<troop_id>, <slot_no>, <value>Troop attributes and skills
Z10Troops.1505troop_set_type<troop_id>, <skin>Changes the troop skin. There are two skins in Native: male and female, so in effect this operation sets troop gender. However mods may declare other skins.
Z10Troops.1506troop_get_type<destination>, <troop_id>Returns troop current skin (i.e. gender).
Z10Troops.1517troop_set_class<troop_id>, <value>Sets troop class (infantry, archers, cavalry or any of custom classes). Accepts values in range 0..8. See grc_* constants in header_mission_templates.py.
Z10Troops.1516troop_get_class<destination>, <troop_id>Retrieves troop class. Returns values in range 0..8.
Z10Troops.1837class_set_name<sub_class>, <string_id>Sets a new name for troop class (aka "Infantry", "Cavalry", "Custom Group 3"...). While manually you can rename class only up to 28 characters via in-game button, the operation is able to assign any string or quick string and even supports multi-line with ^ symbol. However, the game seems to be able to display only up to 291 characters from the feed message, and long class names aren't readable or viable but are definitely possible. Keep in mind that 10 characters are required for ", hear me!" to show up so the actual max length for class name is 281.
Z10Troops.1062add_xp_to_troop<value>, [troop_id]Adds some xp points to troop. Only makes sense for player and hero troops. Default troop_id is player. Amount of xp can be negative.
Z10Troops.1064add_xp_as_reward<value>Adds the specified amount of xp points to player. Typically used as a quest reward operation.
Z10Troops.1515troop_get_xp<destination>, <troop_id>Retrieves total amount of xp specified troop has.
Z10Troops.2172store_attribute_level<destination>, <troop_id>, <attribute_id>Stores current value of troop attribute. See ca_* constants in header_troops.py for reference.
Z10Troops.1520troop_raise_attribute<troop_id>, <attribute_id>, <value>Increases troop attribute by the specified amount. See ca_* constants in header_troops.py for reference. Use negative values to reduce attributes. When used on non-hero troop, will affect all instances of that troop.
Z10Troops.2170store_skill_level<destination>, <skill_id>, [troop_id]Stores current value of troop skill. See header_skills.py for reference.
Z10Troops.1521troop_raise_skill<troop_id>, <skill_id>, <value>Increases troop skill by the specified value. Value can be negative. See header_skills.py for reference. When used on non-hero troop, will affect all instances of that troop.
Z10Troops.2176store_proficiency_level<destination>, <troop_id>, <attribute_id>Stores current value of troop weapon proficiency. See wpt_* constants in header_troops.py for reference.
Z10Troops.1522troop_raise_proficiency<troop_id>, <proficiency_no>, <value>Increases troop weapon proficiency by the specified value. Increase is subject to limits defined by Weapon Master skill. When used on non-hero troop, will affect all instances of that troop. Will accept and handle negative values.
Z10Troops.1523troop_raise_proficiency_linear<troop_id>, <proficiency_no>, <value>Same as (troop_raise_proficiency), but does not take Weapon Master skill into account (i.e. can increase proficiencies indefinitely). Will accept and handle negative values as well.
Z10Troops.1525troop_add_proficiency_points<troop_id>, <value>Adds some proficiency points to a hero troop which can later be distributed by player.
Z10Troops.2175store_troop_health<destination>, <troop_id>, [absolute]), # set absolute to 1 to get actual health; otherwise this will return percentage health in range (0-100)Retrieves current troop health. Use absolute = 1 to retrieve actual number of hp points left, use absolute = 0 to retrieve a value in 0..100 range (percentage).
Z10Troops.1560troop_set_health<troop_id>, <relative health (0-100)>Sets troop health. Accepts value in range 0..100 (percentage).
Z10Troops.1561troop_get_upgrade_troop<destination>, <troop_id>, <upgrade_path>Retrieves possible directions for non-hero troop upgrade. Use 0 to retrieve first upgrade path, and 1 to return second. Result of -1 means there's no such upgrade path for this troop.
Z10Troops.2171store_character_level<destination>, [troop_id]Retrieves character level of the troop. Default troop is the player.
Z10Troops.991get_level_boundary<destination>, <level_no>Returns the amount of experience points required to reach the specified level (will return 0 for 1st level). Maximum possible level in the game is 63.
Z10Troops.1063add_gold_as_xp<value>, [troop_id]), # Default troop is playerAdds a certain amount of experience points, depending on the amount of gold specified. Conversion rate is unclear and apparently somewhat randomized (three runs with 1000 gold produced values 1091, 804 and 799).Troop equipment handling
Z10Troops.1509troop_set_auto_equip<troop_id>, <value>Sets (value = 1) or disables (value = 0) auto-equipping the troop with any items added to its inventory or purchased. Similar to tf_is_merchant flag.
Z10Troops.1510troop_ensure_inventory_space<troop_id>, <value>Removes items from troop inventory until troop has specified number of free inventory slots. Will free inventory slots starting from the end (items at the bottom of inventory will be removed first if there's not enough free space).
Z10Troops.1511troop_sort_inventory<troop_id>Sorts items in troop inventory by their price (expensive first).
Z10Troops.1530troop_add_item<troop_id>, <item_id>, [modifier]Adds an item to the troop, optionally with a modifier (see imod_* constants in header_item_modifiers.py).
Z10Troops.1531troop_remove_item<troop_id>, <item_id>Removes an item from the troop equipment or inventory. Operation will remove first matching item it finds.
Z10Troops.1532troop_clear_inventory<troop_id>Clears entire troop inventory. Does not affect equipped items.
Z10Troops.1533troop_equip_items<troop_id>Makes the troop reconsider its equipment. If troop has better stuff in its inventory, it will equip it. Note this operation sucks with weapons and may force the troop to equip himself with 4 two-handed swords.
Z10Troops.1534troop_inventory_slot_set_item_amount<troop_id>, <inventory_slot_no>, <value>Sets the stack size for a specified equipment or inventory slot. Only makes sense for items like ammo or food (which show stuff like "23/50" in inventory). Equipment slots are in range 0..9, see ek_* constants in header_items.py for reference.
Z10Troops.1537troop_inventory_slot_get_item_amount<destination>, <troop_id>, <inventory_slot_no>Retrieves the stack size for a specified equipment or inventory slot (if some Bread is 23/50, this operation will return 23).
Z10Troops.1538troop_inventory_slot_get_item_max_amount<destination>, <troop_id>, <inventory_slot_no>Retrieves the maximum possible stack size for a specified equipment or inventory slot (if some Bread is 23/50, this operation will return 50).
Z10Troops.1535troop_add_items<troop_id>, <item_id>, <number>Adds multiple items of specified type to the troop.
Z10Troops.1536troop_remove_items<troop_id>, <item_id>, <number>Removes multiple items of specified type from the troop. Total price of actually removed items will be stored in reg0. Regardless of item modifiers. Will not fail if <troop_id> does not have the required items.
Z10Troops.1539troop_loot_troop<target_troop>, <source_troop_id>, <probability>), Adds to target_troop's inventory some items from source_troop's equipment and inventory with some probability. If an item is added to the target troop, it is given a random modifier from the item's imod list. Does not actually remove items from source_troop. Commonly used in Native to generate random loot after the battle.
Z10Troops.1540troop_get_inventory_capacity<destination>, <troop_id>Returns the total inventory capacity (number of inventory slots) for the specified troop. Note that this number will include equipment slots as well. Substract num_equipment_kinds (see header_items.py) to get the number of actual *inventory* slots.
Z10Troops.1541troop_get_inventory_slot<destination>, <troop_id>, <inventory_slot_no>Retrieves the item_id of a specified equipment or inventory slot. Returns -1 when there's nothing there.
Z10Troops.1542troop_get_inventory_slot_modifier<destination>, <troop_id>, <inventory_slot_no>Retrieves the modifier value (see imod_* constants in header_items.py) for an item in the specified equipment or inventory slot. Returns 0 when there's nothing there, or if item does not have any modifiers.
Z10Troops.1543troop_set_inventory_slot<troop_id>, <inventory_slot_no>, <item_id>Puts the specified item into troop's equipment or inventory slot. Be careful with setting equipment slots this way.
Z10Troops.1544troop_set_inventory_slot_modifier<troop_id>, <inventory_slot_no>, <imod_value>Sets the modifier for the item in the troop's equipment or inventory slot. See imod_* constants in header_items.py for reference.
Z10Troops.2165store_item_kind_count<destination>, <item_id>, [troop_id]Calculates total number of items of specified type that the troop has. Default troop is player.
Z10Troops.2167store_free_inventory_capacity<destination>, [troop_id]Calculates total number of free inventory slots that the troop has. Default troop is player.Merchandise handling
Z10Troops.1170reset_price_ratesResets customized price rates for merchants.
Z10Troops.1171set_price_rate_for_item<item_id>, <value_percentage>Sets individual price rate for a single item type. Normal price rate is 100. Deprecated, as Warband uses (game_get_item_[buy/sell]_price_factor) scripts instead.
Z10Troops.1172set_price_rate_for_item_type<item_type_id>, <value_percentage>Sets individual price rate for entire item class (see header_items.py for itp_type_* constants). Normal price rate is 100. Deprecated, as Warband uses (game_get_item_[buy/sell]_price_factor) scripts instead.
Z10Troops.1490set_merchandise_modifier_quality<value>Affects the probability of items with quality modifiers appearing in merchandise. Value is percentage, standard value is 100. 100 gives completely random items, <100 gives more items with bad imods, and >100 gives more items with good imods.
Z10Troops.1491set_merchandise_max_value<value>Not used in Native. Apparently prevents items with price higher than listed from being generated as merchandise.
Z10Troops.1492reset_item_probabilities<value>Sets all items probability of being generated as merchandise to the provided value. Use zero with subsequent calls to (set_item_probability_in_merchandise) to only allow generation of certain items.
Z10Troops.1493set_item_probability_in_merchandise<item_id>, <value>Sets item probability of being generated as merchandise to the provided value.
Z10Troops.1512troop_add_merchandise<troop_id>, <item_type_id>, <value>Adds a specified number of random items of certain type (see itp_type_* constants in header_items.py) to troop inventory. Only adds items with itp_merchandise flags.
Z10Troops.1513troop_add_merchandise_with_faction<troop_id>, <faction_id>, <item_type_id>, <value>faction_id is given to check if troop is eligible to produce that item.Same as (troop_add_merchandise), but with additional filter: only adds items which belong to specified faction, or without any factions at all.Miscellaneous troop information
Z10Troops.1501troop_set_name<troop_id>, <string_no>Renames the troop, setting a new singular name for it.
Z10Troops.1502troop_set_plural_name<troop_id>, <string_no>Renames the troop, setting a new plural name for it.
Z10Troops.1528troop_add_gold<troop_id>, <value>Adds gold to troop. Generally used with player or hero troops.
Z10Troops.1529troop_remove_gold<troop_id>, <value>Removes gold from troop. Generally used with player or hero troops.
Z10Troops.2149store_troop_gold<destination>, <troop_id>Retrieves total number of gold that the troop has.
Z10Troops.1550troop_set_faction<troop_id>, <faction_id>Sets a new faction for the troop (mostly used to switch lords allegiances in Native).
Z10Troops.2173store_troop_faction<destination>, <troop_id>Retrieves current troop faction allegiance.
Z10Troops.2173store_faction_of_troop<destination>, <troop_id>Alternative spelling of the above operation.
Z10Troops.1555troop_set_age<troop_id>, <age_slider_pos>Defines a new age for the troop (will be used by the game engine to generate appropriately aged face). Age is in range 0.100. {slot_troop_age} and {slot_troop_age_appearance} will not be set.
Z10Troops.2231store_troop_value<destination>, <troop_id>Stores some value which is apparently related to troop's overall fighting value. Swadian infantry line troops from Native produced values 24, 47, 80, 133, 188. Calling on player produced 0.Troop face code handling
Z10Troops.1503troop_set_face_key_from_current_profile<troop_id>Forces the troop to adopt the face from player's currently selected multiplayer profile.
Z10Troops.2747str_store_player_face_keys<string_no>, <player_id>Version 1.161+. Stores player's face keys into string register.
Z10Troops.2748player_set_face_keys<player_id>, <string_no>Version 1.161+. Sets player's face keys from string.
Z10Troops.2749str_store_agent_face_keys<string_no>, <agent_id>Stores agent's face keys into string register. Regular agents have random generated face from within the range of the two face codes at their troop entry.
Z10Troops.2750str_store_troop_face_keys<string_no>, <troop_no>, [<alt>]Version 1.161+. Stores specified troop's face keys into string register. Use optional <alt> parameter to determine what facekey set to retrieve: 0 for first and 1 for second.
Z10Troops.2751troop_set_face_keys<troop_no>, <string_no>, [<alt>]Version 1.161+. Sets troop face keys from string. Use optional <alt> parameter to determine what face keys to update: 0 for first and 1 for second.
Z10Troops.2752face_keys_get_hair<destination>, <string_no>Version 1.161+. Unpacks selected hair mesh from string containing troop/player face keys to <destination>.
Z10Troops.2753face_keys_set_hair<string_no>, <value>Version 1.161+. Updates face keys string with a new hair value. Hair meshes associated with skin (as defined in module_skins) are numbered from 1. Use 0 for no hair.
Z10Troops.2754face_keys_get_beard<destination>, <string_no>Version 1.161+. Unpacks selected beard mesh from string containing troop/player face keys to <destination>.
Z10Troops.2755face_keys_set_beard<string_no>, <value>Version 1.161+. Updates face keys string with a new beard value. Beard meshes associated with skin (as defined in module_skins) are numbered from 1. Use 0 for no beard.
Z10Troops.2756face_keys_get_face_texture<destination>, <string_no>Version 1.161+. Unpacks selected face texture from string containing troop/player face keys to <destination>.
Z10Troops.2757face_keys_set_face_texture<string_no>, <value>Version 1.161+. Updates face keys string with a new face texture value. Face textures associated with skin (as defined in module_skins) are numbered from 0.
Z10Troops.2758face_keys_get_hair_texture<destination>, <string_no>Version 1.161+. Unpacks selected hair texture from string containing troop/player face keys to <destination>. Apparently hair textures have no effect. 4 research.
Z10Troops.2759face_keys_set_hair_texture<string_no>, <value>Version 1.161+. Updates face keys string with a new hair texture value. Doesn't seem to have an effect. 4research.
Z10Troops.2760face_keys_get_hair_color<destination>, <string_no>Version 1.161+. Unpacks hair color slider value from face keys string. Values are in the range of 0..63. Mapping to specific colors depends on the hair color range defined for currently selected skin / face_texture combination.
Z10Troops.2761face_keys_set_hair_color<string_no>, <value>Version 1.161+. Updates face keys string with a new hair color slider value. Value should be in the 0..63 range.
Z10Troops.2762face_keys_get_age<destination>, <string_no>Version 1.161+. Unpacks age slider value from face keys string. Values are in the range of 0..63.
Z10Troops.2763face_keys_set_age<string_no>, <value>Version 1.161+. Updates face keys string with a new age slider value. Value should be in the 0..63 range.
Z10Troops.2764face_keys_get_skin_color<destination>, <string_no>Version 1.161+. Apparently doesn't work. Should retrieve skin color value from face keys string into <destination>.
Z10Troops.2765face_keys_set_skin_color<string_no>, <value>Version 1.161+. Apparently doesn't work. Should update face keys string with a new skin color value.
Z10Troops.2766face_keys_get_morph_key<destination>, <string_no>, <key_no>Version 1.161+. Unpacks morph key value from face keys string. See morph key indices in module_skins.py file. Note that only 8 out of 27 morph keys are actually accessible (from 'chin_size' to 'cheeks'). Morph key values are in the 0..7 range.
Z10Troops.2767face_keys_set_morph_key<string_no>, <key_no>, <value>Version 1.161+. Updates face keys string with a new morph key value. See morph key indices in module_skins.py file. Note that only 8 out of 27 morph keys are actually accessible (from 'chin_size' to 'cheeks'). Morph key values should be in the 0..7 range.
Z11Quests.200check_quest_active<quest_id>Checks that the quest has been started but not yet cancelled or completed. Will not fail for concluded, failed or succeeded quests for as long as they have not yet been completed.
Z11Quests.201check_quest_finished<quest_id>Checks that the quest has been completed (result does not matter) and not taken again yet.
Z11Quests.202check_quest_succeeded<quest_id>Checks that the quest has succeeded and not taken again yet (check will be successful even after the quest is completed).
Z11Quests.203check_quest_failed<quest_id>Checks that the quest has failed and not taken again yet (check will be successful even after the quest is completed).
Z11Quests.204check_quest_concluded<quest_id>Checks that the quest was concluded with any result and not taken again yet.Slot operations for quests
Z11Quests.506quest_set_slot<quest_id>, <slot_no>, <value>
Z11Quests.526quest_get_slot<destination>, <quest_id>, <slot_no>
Z11Quests.546quest_slot_eq<quest_id>, <slot_no>, <value>
Z11Quests.566quest_slot_ge<quest_id>, <slot_no>, <value>
Z11Quests.neg|quest_slot_gequest_slot_lt<quest_id>, <slot_no>, <value>Quest management
Z11Quests.1280start_quest<quest_id>, <giver_troop_id>Starts the quest and marks giver_troop as the troop who gave it.
Z11Quests.1286conclude_quest<quest_id>Sets quest status as concluded but keeps it in the list. Frequently used to indicate "uncertain" quest status, when it's neither fully successful nor a total failure.
Z11Quests.1282succeed_quest<quest_id>), #also concludes the questSets quest status as successful but keeps it in the list (player must visit quest giver to complete it before he can get another quest of the same type).
Z11Quests.1283fail_quest<quest_id>), #also concludes the questSets quest status as failed but keeps it in the list (player must visit quest giver to complete it before he can get another quest of the same type).
Z11Quests.1281complete_quest<quest_id>Successfully completes specified quest, removing it from the list of active quests.
Z11Quests.1284cancel_quest<quest_id>Cancels specified quest without completing it, removing it from the list of active quests.
Z11Quests.1290setup_quest_text<quest_id>Operation will refresh default quest description (as defined in module_quests.py). This is important when quest description contains references to variables and registers which need to be initialized with their current values.
Z11Quests.2240store_partner_quest<destination>During conversation, if there's a quest given by conversation partner, the operation will return its id.
Z11Quests.1291setup_quest_giver<quest_id>, <string_id>Apparently deprecated, as quest giver troop is now defined as a parameter of (start_quest).
Z11Quests.2250store_random_quest_in_range<destination>, <lower_bound>, <upper_bound>Apparently deprecated as the logic for picking a new quest has been moved to module_scripts.
Z11Quests.1285set_quest_progression<quest_id>, <value>Deprecated and useless, operation has no game effects and it's impossible to retrieve quest progression status anyway.
Z11Quests.2251store_random_troop_to_raise<destination>, <lower_bound>, <upper_bound>Apparently deprecated.
Z11Quests.2252store_random_troop_to_capture<destination>, <lower_bound>, <upper_bound>Apparently deprecated.
Z11Quests.2261store_quest_number<destination>, <quest_id>Apparently deprecated.
Z11Quests.2262store_quest_item<destination>, <item_id>Apparently deprecated. Native now uses quest slots to keep track of this information.
Z11Quests.2263store_quest_troop<destination>, <troop_id>Apparently deprecated. Native now uses quest slots to keep track of this information.
Z12Items.2723item_has_property<item_kind_no>, <property>Version 1.161+. Check that the item has specified property flag set. See the list of itp_* flags in header_items.py.
Z12Items.2724item_has_capability<item_kind_no>, <capability>Version 1.161+. Checks that the item has specified capability flag set. See the list of itcf_* flags in header_items.py
Z12Items.2725item_has_modifier<item_kind_no>, <item_modifier_no>Version 1.161+. Checks that the specified modifiers is valid for the item. See the list of imod_* values in header_item_modifiers.py.
Z12Items.2726item_has_faction<item_kind_no>, <faction_no>Version 1.161+. Checks that the item is available for specified faction. Note that an item with no factions set is available to all factions.Item slot operations
Z12Items.507item_set_slot<item_id>, <slot_no>, <value>
Z12Items.527item_get_slot<destination>, <item_id>, <slot_no>
Z12Items.547item_slot_eq<item_id>, <slot_no>, <value>
Z12Items.567item_slot_ge<item_id>, <slot_no>, <value>
Z12Items.neg|item_slot_geitem_slot_lt<item_id>, <slot_no>, <value>Generic item operations
Z12Items.1570item_get_type<destination>, <item_id>Returns item class (see header_items.py for itp_type_* constants).
Z12Items.2230store_item_value<destination>, <item_id>Stores item nominal price as listed in module_items.py. Does not take item modifier or quantity (for food items) into account.
Z12Items.2257store_random_horse<destination>Deprecated since early M&B days.
Z12Items.2258store_random_equipment<destination>Deprecated since early M&B days.
Z12Items.2259store_random_armor<destination>Deprecated since early M&B days.
Z12Items.1964cur_item_add_mesh<mesh_name_string>, [<lod_begin>], [<lod_end>], [<vertex-color>]Version 1.161+. Only call inside ti_on_init_item trigger. Adds another mesh to item, allowing the creation of combined items. Note that in Native the operation (or more precisely the trigger it works in) is for helmets and armor only, it will not trigger for horses, gloves and boots (it works for all items in inventory but it doesn't get called in missions). Parameter <mesh_name_string> should contain mesh name itself, NOT a mesh reference. LOD values are optional at single-mesh items and mandatory at multi-mesh items. If <lod_end> is used, it will not be loaded.
Z12Items.1978cur_item_set_material<string_no>, <sub_mesh_no>, [<lod_begin>], [<lod_end>]Version 1.161+. Only call inside ti_on_init_item trigger. Replaces material that will be used to render the item mesh. Works only for main meta-mesh, so not for scabbards, etc., and does not work for horses, gloves and boots. Use 0 for <sub_mesh_no> to replace material for base mesh. LOD values are optional. If <lod_end> is used, it will not be loaded.
Z12Items.2700item_get_weight<destination_fixed_point>, <item_kind_no>Version 1.161+. Retrieves item weight as a fixed point value.
Z12Items.2701item_get_value<destination>, <item_kind_no>Version 1.161+. Retrieves item base price. Essentially a duplicate of (store_item_value).
Z12Items.2702item_get_difficulty<destination>, <item_kind_no>Version 1.161+. Retrieves item difficulty value.
Z12Items.2703item_get_head_armor<destination>, <item_kind_no>Version 1.161+. Retrieves item head armor value.
Z12Items.2704item_get_body_armor<destination>, <item_kind_no>Version 1.161+. Retrieves item body armor value.
Z12Items.2705item_get_leg_armor<destination>, <item_kind_no>Version 1.161+. Retrieves item leg armor value.
Z12Items.2706item_get_hit_points<destination>, <item_kind_no>Version 1.161+. Retrieves item hit points amount.
Z12Items.2707item_get_weapon_length<destination>, <item_kind_no>Version 1.161+. Retrieves item length (for weapons) or shield half-width (for shields). To get actual shield width, multiply this value by 2. Essentially, it is a distance from shield's "center" point to its left, right and top edges (and bottom edge as well if shield height is not defined).
Z12Items.2708item_get_speed_rating<destination>, <item_kind_no>Version 1.161+. Retrieves item speed rating.
Z12Items.2709item_get_missile_speed<destination>, <item_kind_no>Version 1.161+. Retrieves item missile speed rating.
Z12Items.2710item_get_max_ammo<destination>, <item_kind_no>Version 1.161+. Retrieves item max ammo amount. Ignores large bag modifier.
Z12Items.2711item_get_accuracy<destination>, <item_kind_no>Version 1.161+. Retrieves item accuracy value. Note that this operation will return 0 for an item with undefined accuracy, even though the item accuracy will actually default to 100.
Z12Items.2712item_get_shield_height<destination_fixed_point>, <item_kind_no>Version 1.161+. Retrieves distance from shield "center" to its bottom edge as a fixed point number. Use (set_fixed_point_multiplier, 100), to retrieve the correct value with this operation. To get actual shield height, use shield_height + weapon_length if this operation returns a non-zero value, otherwise use 2 * weapon_length.
Z12Items.2713item_get_horse_scale<destination_fixed_point>, <item_kind_no>Version 1.161+. Retrieves horse scale value as fixed point number.
Z12Items.2714item_get_horse_speed<destination>, <item_kind_no>Version 1.161+. Retrieves horse speed value.
Z12Items.2715item_get_horse_maneuver<destination>, <item_kind_no>Version 1.161+. Retrieves horse maneuverability value.
Z12Items.2716item_get_food_quality<destination>, <item_kind_no>Version 1.161+. Retrieves food quality coefficient (as of Warband 1.165, this coefficient is actually set for many food items, but never used in the code as there was no way to retrieve this coeff before 1.161 patch).
Z12Items.2717item_get_abundance<destination>, <item_kind_no>Version 1.161+. Retrieve item abundance value. Note that this operation will return 0 for an item with undefined abundance, even though the item abundance will actually default to 100.
Z12Items.2718item_get_thrust_damage<destination>, <item_kind_no>Version 1.161+. Retrieves thrust base damage value for item.
Z12Items.2719item_get_thrust_damage_type<destination>, <item_kind_no>Version 1.161+. Retrieves thrust damage type for item (see definitions for "cut", "pierce" and "blunt" in header_items.py).
Z12Items.2720item_get_swing_damage<destination>, <item_kind_no>Version 1.161+. Retrieves swing base damage value for item.
Z12Items.2721item_get_swing_damage_type<destination>, <item_kind_no>Version 1.161+. Retrieves swing damage type for item (see definitions for "cut", "pierce" and "blunt" in header_items.py).
Z12Items.2722item_get_horse_charge_damage<destination>, <item_kind_no>Version 1.161+. Retrieves horse charge base damage.
Z13Sounds and Music Tracks.599play_sound_at_position<sound_id>, <position>, [options]Plays a sound in specified scene position. See sf_* flags in header_sounds.py for reference on possible options.
Z13Sounds and Music Tracks.600play_sound<sound_id>, [options]Plays a sound. If the operation is called from agent, scene_prop or item trigger, then the sound will be positional and 3D. See sf_* flags in header_sounds.py for reference on possible options.
Z13Sounds and Music Tracks.601play_track<track_id>, [options]Plays specified music track. Possible options: 0 = finish current then play this, 1 = fade out current and start this, 2 = stop current abruptly and start this
Z13Sounds and Music Tracks.602play_cue_track<track_id>Plays specified music track OVER any currently played music track (so you can get two music tracks playing simultaneously). Hardly useful.
Z13Sounds and Music Tracks.603music_set_situation<situation_type>Sets current situation(s) in the game (see mtf_* flags in header_music.py for reference) so the game engine can pick matching tracks from module_music.py. Use 0 to stop any currently playing music (it will resume when situation is later set to something).
Z13Sounds and Music Tracks.604music_set_culture<culture_type>Sets current culture(s) in the game (see mtf_* flags in header_music.py for reference) so the game engine can pick matching tracks from module_music.py. Use 0 to stop any currently playing music (it will resume when cultures are later set to something).
Z13Sounds and Music Tracks.609stop_all_sounds[options]Stops all playing sounds. Version 1.153 options: 0 = stop only looping sounds, 1 = stop all sounds. Version 1.143 options: 0 = let current track finish, 1 = fade it out, 2 = stop it abruptly.
Z13Sounds and Music Tracks.615store_last_sound_channel<destination>Version 1.153+. UNTESTED. Stores the sound channel used for the last sound operation.Can fail. Returns -1 as value. For agent_play_sound; play_sound - if called from item, scene_prop trigger. (up4research)
Z13Sounds and Music Tracks.616stop_sound_channel<sound_channel_no>Version 1.153+. Used to fix bug with looping sounds in Viking Conquest.There are 256 sound channels. The closest agent has 0 channel. The farthest agents will rewrite last 10 channels.
Z14Positions.701init_position<position>Sets position coordinates to [0,0,0], without any rotation and default scale.A not initialized position has the values (-1000,-1000,0, 0,0,0); fpm=1 (x,y,z, x-rot,y-rot,z-rot).
Z14Positions.700copy_position<position_target>, <position_source>Makes a duplicate of position_source.
Z14Positions.719position_copy_origin<position_target>, <position_source>Copies coordinates from source position to target position, without changing rotation or scale.
Z14Positions.718position_copy_rotation<position_target>, <position_source>Copies rotation from source position to target position, without changing coordinates or scale.
Z14Positions.716position_transform_position_to_parent<position_dest>, <position_anchor>, <position_relative_to_anchor>Converts position from local coordinate space to parent coordinate space. In other words, if you have some position on the scene (anchor) and a position describing some place *relative* to anchor (for example [10,20,0] means "20 meters forward and 10 meters to the right"), after calling this operation you will get that position coordinates on the scene in <position_dest>. Rotation and scale is also taken care of, so you can use relative angles.
Z14Positions.717position_transform_position_to_local<position_dest>, <position_anchor>, <position_source>The opposite to (position_transform_position_to_parent), this operation allows you to get source's *relative* position to your anchor. Suppose you want to run some decision making for your bot agent depending on player's position. In order to know where player is located relative to your bot you call (position_transform_position_to_local, <position_dest>, <bot_position>, <player_position>). Then we check position_dest's Y coordinate - if it's negative, then the player is behind our bot's back.Position (X,Y,Z) coordinates
Z14Positions.726position_get_x<destination_fixed_point>, <position>Return position X coordinate (to the east, or to the right). Base unit is meters. Use (set_fixed_point_multiplier) to set another measurement unit (100 will get you centimeters, 1000 will get you millimeters, etc).
Z14Positions.727position_get_y<destination_fixed_point>, <position>Return position Y coordinate (to the north, or forward). Base unit is meters. Use (set_fixed_point_multiplier) to set another measurement unit (100 will get you centimeters, 1000 will get you millimeters, etc).
Z14Positions.728position_get_z<destination_fixed_point>, <position>Return position Z coordinate (to the top). Base unit is meters. Use (set_fixed_point_multiplier) to set another measurement unit (100 will get you centimeters, 1000 will get you millimeters, etc).
Z14Positions.729position_set_x<position>, <value_fixed_point>Set position X coordinate.
Z14Positions.730position_set_y<position>, <value_fixed_point>Set position Y coordinate.
Z14Positions.731position_set_z<position>, <value_fixed_point>Set position Z coordinate.
Z14Positions.720position_move_x<position>, <movement>, [value]Moves position along X axis. Movement distance is in cms. Optional parameter determines whether the position is moved along the local (value=0) or global (value=1) X axis (i.e. whether the position will be moved to its right/left, or to the global east/west).
Z14Positions.721position_move_y<position>, <movement>,[value]Moves position along Y axis. Movement distance is in cms. Optional parameter determines whether the position is moved along the local (value=0) or global (value=1) Y axis (i.e. whether the position will be moved forward/backwards, or to the global north/south).
Z14Positions.722position_move_z<position>, <movement>,[value]Moves position along Z axis. Movement distance is in cms. Optional parameter determines whether the position is moved along the local (value=0) or global (value=1) Z axis (i.e. whether the position will be moved to its above/below, or to the global above/below - these directions will be different if the position is tilted).
Z14Positions.791position_set_z_to_ground_level<position>This will bring the position Z coordinate so it rests on the ground level (i.e. an agent could stand on that position). This takes scene props with their collision meshes into account. Only works during a mission, so you can't measure global map height using this.
Z14Positions.792position_get_distance_to_terrain<destination_fixed_point>, <position>This will measure the distance (in a fixed point value) between position and terrain below, ignoring all scene props and their collision meshes. Retrieves a negative value if underground. Operation only works on the scenes and cannot be used on the global map.
Z14Positions.793position_get_distance_to_ground_level<destination_fixed_point>, <position>This will measure the distance (in a fixed point value) between position and the ground level, taking scene props and their collision meshes into account. Retrieves a negative value if underground. Operation only works on the scenes and cannot be used on the global map.Position rotation
Z14Positions.742position_get_rotation_around_x<destination>, <position>Returns angle (in degrees) that the position is rotated around X axis (tilt forward/backwards).
Z14Positions.743position_get_rotation_around_y<destination>, <position>Returns angle (in degrees) that the position is rotated around Y axis (tilt right/left).
Z14Positions.740position_get_rotation_around_z<destination>, <position>Returns angle (in degrees) that the position is rotated around Z axis (turning right/left).
Z14Positions.723position_rotate_x<position>, <angle>Rotates position around its X axis (tilt forward/backwards).
Z14Positions.724position_rotate_y<position>, <angle>Rotates position around Y axis (tilt right/left).
Z14Positions.725position_rotate_z<position>, <angle>, [use_global_z_axis]Rotates position around Z axis (rotate right/left). Pass 1 for use_global_z_axis to rotate the position around global axis instead.
Z14Positions.738position_rotate_x_floating<position>, <angle_fixed_point>Same as (position_rotate_x), but takes fixed point value as parameter, allowing for more precise rotation.
Z14Positions.739position_rotate_y_floating<position>, <angle_fixed_point>Same as (position_rotate_y), but takes fixed point value as parameter, allowing for more precise rotation.
Z14Positions.734position_rotate_z_floating<position_no>, <angle_fixed_point>, [use_global_z_axis]Version 1.161+. Same as (position_rotate_z), but takes fixed point value as parameter, allowing for more precise rotation.Pass 1 for use_global_z_axis to rotate the position around global axis instead.Position scale
Z14Positions.735position_get_scale_x<destination_fixed_point>, <position>Retrieves position scaling along X axis.
Z14Positions.736position_get_scale_y<destination_fixed_point>, <position>Retrieves position scaling along Y axis.
Z14Positions.737position_get_scale_z<destination_fixed_point>, <position>Retrieves position scaling along Z axis.
Z14Positions.744position_set_scale_x<position>, <value_fixed_point>Sets position scaling along X axis.
Z14Positions.745position_set_scale_y<position>, <value_fixed_point>Sets position scaling along Y axis.
Z14Positions.746position_set_scale_z<position>, <value_fixed_point>Sets position scaling along Z axis.Measurement of distances and angles
Z14Positions.705get_angle_between_positions<destination_fixed_point>, <position_no_1>, <position_no_2>Calculates angle between positions, using positions as vectors. Only rotation around Z axis is used. In other words, the function returns the difference between Z rotations of both positions.
Z14Positions.707position_has_line_of_sight_to_position<position_no_1>, <position_no_2>Checks that you can see one position from another. This obviously implies that both positions must be in global space. Note this is computationally expensive, so try to keep number of these to a minimum.
Z14Positions.710get_distance_between_positions<destination>, <position_no_1>, <position_no_2>Returns distance between positions in centimeters.
Z14Positions.711get_distance_between_positions_in_meters<destination>, <position_no_1>, <position_no_2>Returns distance between positions in meters.
Z14Positions.712get_sq_distance_between_positions<destination>, <position_no_1>, <position_no_2>Returns squared distance between two positions in centimeters.
Z14Positions.713get_sq_distance_between_positions_in_meters<destination>, <position_no_1>, <position_no_2>Returns squared distance between two positions in meters.
Z14Positions.714position_is_behind_position<position_base>, <position_to_check>Checks if the second position is behind the first.
Z14Positions.715get_sq_distance_between_position_heights<destination>, <position_no_1>, <position_no_2>Returns squared distance between position *heights* in centimeters.
Z14Positions.741position_normalize_origin<destination_fixed_point>, <position>What this operation seems to do is calculate the distance between the zero point [0,0,0] and the point with position's coordinates. Can be used to quickly calculate distance to relative positions.
Z14Positions.750position_get_screen_projection<position_screen>, <position_world>Calculates the screen coordinates of the position and stores it as position_screen's X and Y coordinates. Works in missions. Not shure if it works on global map.<position> coordinates transform so distance becomes 1 meter. Then x,y coordinates can be multiplied, for example, by 10 and new position will be 10 meters in that direction.Global map positions
Z14Positions.1627map_get_random_position_around_position<dest_position_no>, <source_position_no>, <radius>Returns a random position on the global map in the vicinity of the source_position.
Z14Positions.1628map_get_land_position_around_position<dest_position_no>, <source_position_no>, <radius>Returns a random position on the global map in the vicinity of the source_position. Will always return a land position (i.e. some place you can walk to).
Z14Positions.1629map_get_water_position_around_position<dest_position_no>, <source_position_no>, <radius>Returns a random position on the global map in the vicinity of the source_position. Will always return a water position (i.e. sea, lake or river).
Z15Game Notes.1095troop_set_note_available<troop_id>, <value>Enables (value = 1) or disables (value = 0) troop's page in the Notes / Characters section.
Z15Game Notes.1108add_troop_note_tableau_mesh<troop_id>, <tableau_material_id>Adds graphical elements to the troop's information page (usually banner and portrait).
Z15Game Notes.1114add_troop_note_from_dialog<troop_id>, <note_slot_no>, <expires_with_time>Adds current dialog text to troop notes. Each troop has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_troop_note_from_dialog,<troop_id>,<note_slot_no>, <value>), #There are maximum of 8 slots. value = 1 -> shows when the note is added
Z15Game Notes.1117add_troop_note_from_sreg<troop_id>, <note_slot_no>, <string_id>, <expires_with_time>Adds any text stored in string register to troop notes. Each troop has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_troop_note_from_sreg,<troop_id>,<note_slot_no>,<string_id>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1096faction_set_note_available<faction_id>, <value>), #1 = available, 0 = not availableEnables (value = 1) or disables (value = 0) faction's page in the Notes / Characters section.
Z15Game Notes.1109add_faction_note_tableau_mesh<faction_id>, <tableau_material_id>Adds graphical elements to the faction's information page (usually graphical collage).
Z15Game Notes.1115add_faction_note_from_dialog<faction_id>, <note_slot_no>, <expires_with_time>Adds current dialog text to faction notes. Each faction has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_faction_note_from_dialog,<faction_id>,<note_slot_no>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1118add_faction_note_from_sreg<faction_id>, <note_slot_no>, <string_id>, <expires_with_time>Adds any text stored in string register to faction notes. Each faction has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_faction_note_from_sreg,<faction_id>,<note_slot_no>,<string_id>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1097party_set_note_available<party_id>, <value>), #1 = available, 0 = not availableEnables (value = 1) or disables (value = 0) party's page in the Notes / Characters section.
Z15Game Notes.1110add_party_note_tableau_mesh<party_id>, <tableau_material_id>Adds graphical elements to the party's information page (usually map icon).
Z15Game Notes.1116add_party_note_from_dialog<party_id>, <note_slot_no>, <expires_with_time>Adds current dialog text to party notes. Each party has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_party_note_from_dialog,<party_id>,<note_slot_no>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1119add_party_note_from_sreg<party_id>, <note_slot_no>, <string_id>, <expires_with_time>Adds any text stored in string register to party notes. Each party has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_party_note_from_sreg,<party_id>,<note_slot_no>,<string_id>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1098quest_set_note_available<quest_id>, <value>), #1 = available, 0 = not availableEnables (value = 1) or disables (value = 0) quest's page in the Notes / Characters section.
Z15Game Notes.1111add_quest_note_tableau_mesh<quest_id>, <tableau_material_id>Adds graphical elements to the quest's information page (not used in Native).
Z15Game Notes.1112add_quest_note_from_dialog<quest_id>, <note_slot_no>, <expires_with_time>Adds current dialog text to quest notes. Each quest has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_quest_note_from_dialog,<quest_id>,<note_slot_no>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1113add_quest_note_from_sreg<quest_id>, <note_slot_no>, <string_id>, <expires_with_time>Adds any text stored in string register to quest notes. Each quest has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_quest_note_from_sreg,<quest_id>,<note_slot_no>,<string_id>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1090add_info_page_note_tableau_mesh<info_page_id>, <tableau_material_id>Adds graphical elements to the info page (not used in Native).
Z15Game Notes.1091add_info_page_note_from_dialog<info_page_id>, <note_slot_no>, <expires_with_time>Adds current dialog text to info page notes. Each info page has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_info_page_note_from_dialog,<info_page_id>,<note_slot_no>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z15Game Notes.1092add_info_page_note_from_sreg<info_page_id>, <note_slot_no>, <string_id>, <expires_with_time>Adds any text stored in string register to info page notes. Each info page has 16 note slots. Last parameter is used to mark the note as time-dependent, if its value is 1, then the note will be marked ("Report is current") and will be updated appropriately as the game progresses ("Report is X days old").Official: (add_info_page_note_from_sreg,<info_page_id>,<note_slot_no>,<string_id>, <value>), #There are maximum of 8 slots value = 1 -> shows when the note is added
Z16Tableaus and Heraldics.1981cur_item_set_tableau_material<tableau_material_id>, <instance_code>Can only be used inside ti_on_init_item trigger in module_items.py. Assigns tableau to the item instance. Value of <instance_code> will be passed to tableau code. Commonly used for heraldic armors and shields.
Z16Tableaus and Heraldics.1982cur_scene_prop_set_tableau_material<tableau_material_id>, <instance_code>Can only be used inside ti_on_init_scene_prop trigger in module_scene_props.py. Assigns tableau to the scene prop instance. Value of <instance_code> will be passed to tableau code. Commonly used for static banners.
Z16Tableaus and Heraldics.1983cur_map_icon_set_tableau_material<tableau_material_id>, <instance_code>Can only be used inside ti_on_init_map_icon trigger in module_map_icons.py. Assigns tableau to the icon prop instance. Value of <instance_code> will be passed to tableau code. Commonly used for player/lord party banners.
Z16Tableaus and Heraldics.1986cur_agent_set_banner_tableau_material<tableau_material_id>Can only be used inside ti_on_agent_spawn trigger in module_mission_templates. Assigns heraldry.Operations used in module_tableau_materials.py module
Z16Tableaus and Heraldics.1980cur_tableau_add_tableau_mesh<tableau_material_id>, <value>, <position_register_no>Used in module_tableau_materials.py to add one tableau to another. Value parameter is passed to tableau_material as is.
Z16Tableaus and Heraldics.1984cur_tableau_render_as_alpha_mask(cur_tableau_render_as_alpha_mask)Tells the engine to treat the tableau as an alpha (transparency) mask.
Z16Tableaus and Heraldics.1985cur_tableau_set_background_color<value>Defines solid background color for the current tableau.
Z16Tableaus and Heraldics.1987cur_tableau_set_ambient_light<red_fixed_point>, <green_fixed_point>, <blue_fixed_point>Not documented. Used for tableaus rendered from 3D objects to provide uniform tinted lighting.
Z16Tableaus and Heraldics.1988cur_tableau_set_camera_position<position>Not documented. Used for tableaus rendered from 3D objects to position camera as necessary (usually with a perspective camera).
Z16Tableaus and Heraldics.1989cur_tableau_set_camera_parameters<is_perspective>, <camera_width_times_1000>, <camera_height_times_1000>, <camera_near_times_1000>, <camera_far_times_1000>Not documented. Used to define camera parameters for tableau rendering. Perspective camera is generally used to render 3D objects for tableaus, while non-perspective camera is used to modify tableau texture meshes.
Z16Tableaus and Heraldics.1990cur_tableau_add_point_light<position>, <red_fixed_point>, <green_fixed_point>, <blue_fixed_point>Not documented. Typically used for tableaus rendered from 3D objects to add a point light source.
Z16Tableaus and Heraldics.1991cur_tableau_add_sun_light<position>, <red_fixed_point>, <green_fixed_point>, <blue_fixed_point>Not documented. Typically used for tableaus rendered from 3D objects to add a directional light source. Note that position coordinates do not matter, only rotation (i.e. light rays direction) does.
Z16Tableaus and Heraldics.1992cur_tableau_add_mesh<mesh_id>, <position>, <value_fixed_point>, <value_fixed_point>Adds a static mesh to the tableau with specified offset, scale and alpha. First value fixed point is the scale factor, second value fixed point is alpha. use 0 for default values.
Z16Tableaus and Heraldics.1993cur_tableau_add_mesh_with_vertex_color<mesh_id>, <position>, <value_fixed_point>, <value_fixed_point>, <value>Adds a static mesh to the tableau with specified offset, scale, alpha and vertex color. First value fixed point is the scale factor, second value fixed point is alpha. Value is vertex color.
Z16Tableaus and Heraldics.2000cur_tableau_add_mesh_with_scale_and_vertex_color<mesh_id>, <position>, <scale_position>, <value_fixed_point>, <value>Similar to (cur_tableau_add_mesh_with_vertex_color), but allows non-uniform scaling. Scale factors are stored as (x,y,z) position properties with fixed point values.
Z16Tableaus and Heraldics.1994cur_tableau_add_map_icon<map_icon_id>, <position>, <value_fixed_point>Adds a rendered image of a map icon to current tableau. Last parameter is the scale factor for the model.
Z16Tableaus and Heraldics.1995cur_tableau_add_troop<troop_id>, <position>, <animation_id>, <instance_no>Adds a rendered image of the troop in a specified animation to current tableau. If instance_no is 0 or less, then the face is not generated randomly (important for heroes).
Z16Tableaus and Heraldics.1996cur_tableau_add_horse<item_id>, <position>, <animation_id>Adds a rendered image of a horse in a specified animation to current tableau.
Z16Tableaus and Heraldics.1997cur_tableau_set_override_flags<value>When creating a troop image for current tableau, this operation allows to override troop's inventory partially or completely. See af_* flags in header_mission_templates.py for reference.
Z16Tableaus and Heraldics.1998cur_tableau_clear_override_itemsRemoves and previously defined equipment overrides for the troop, allowing to start from scratch.
Z16Tableaus and Heraldics.1999cur_tableau_add_override_item<item_kind_id>When creating a troop image for current tableau, the operation will add a new item to troop's equipment.
Z17String Operations.2318str_is_empty<string_register>Checks that referenced string register is empty.Other string operations
Z17String Operations.2319str_clear<string_register>Clears the contents of the referenced string register.
Z17String Operations.2320str_store_string<string_register>, <string_id>Stores a string value in the referenced string register. Only string constants and quick strings can be stored this way.
Z17String Operations.2321str_store_string_reg<string_register>, <string_no>Copies the contents of one string register from another.
Z17String Operations.2322str_store_troop_name<string_register>, <troop_id>Stores singular troop name in referenced string register.
Z17String Operations.2323str_store_troop_name_plural<string_register>, <troop_id>Stores plural troop name in referenced string register.
Z17String Operations.2324str_store_troop_name_by_count<string_register>, <troop_id>, <number>Stores singular or plural troop name with number of troops ("29 Archers", "1 Bandit").
Z17String Operations.2325str_store_item_name<string_register>, <item_id>Stores singular item name in referenced string register.
Z17String Operations.2326str_store_item_name_plural<string_register>, <item_id>Stores plural item name in referenced string register. Plural names need first to be activated (altering process_items.py and setting up plural names at module_items).
Z17String Operations.2327str_store_item_name_by_count<string_register>, <item_id>Stores singular or plural item name with number of items ("11 Swords", "1 Bottle of Wine"). Counting does always work, plural names need first to be activated (altering process_items.py and setting up plural names at module_items).
Z17String Operations.2330str_store_party_name<string_register>, <party_id>Stores party name in referenced string register.
Z17String Operations.2332str_store_agent_name<string_register>, <agent_id>Stores agent name in referenced string register.
Z17String Operations.2335str_store_faction_name<string_register>, <faction_id>Stores faction name in referenced string register.
Z17String Operations.2336str_store_quest_name<string_register>, <quest_id>Stores quest name (as defined in module_quests.py) in referenced string register.
Z17String Operations.2337str_store_info_page_name<string_register>, <info_page_id>Stores info page title (as defined in module_info_pages.py) in referenced string register.
Z17String Operations.2340str_store_date<string_register>, <number_of_hours_to_add_to_the_current_date>Stores formatted date string, using the number of hours since start of the game (can be retrieved by a call to store_current_hours).
Z17String Operations.2341str_store_troop_name_link<string_register>, <troop_id>Stores troop name as an internal game link. Resulting string can be used in game notes, will be highlighted, and clicking on it will redirect the player to the details page of the referenced troop.
Z17String Operations.2342str_store_party_name_link<string_register>, <party_id>Stores party name as an internal game link. Resulting string can be used in game notes, will be highlighted, and clicking on it will redirect the player to the details page of the referenced party.
Z17String Operations.2343str_store_faction_name_link<string_register>, <faction_id>Stores faction name as an internal game link. Resulting string can be used in game notes, will be highlighted, and clicking on it will redirect the player to the details page of the referenced faction.
Z17String Operations.2344str_store_quest_name_link<string_register>, <quest_id>Stores quest name as an internal game link. Resulting string can be used in game notes, will be highlighted, and clicking on it will redirect the player to the details page of the referenced quest.
Z17String Operations.2345str_store_info_page_name_link<string_register>, <info_page_id>Stores info page title as an internal game link. Resulting string can be used in game notes, will be highlighted, and clicking on it will redirect the player to the details page of the referenced info page.
Z17String Operations.2346str_store_class_name<string_register>, <class_id>Stores name of the selected troop class (Infantry, Archers, Cavalry or any of the custom class names) in referenced string register.
Z17String Operations.65game_key_get_mapped_key_name<string_register>, <game_key>Version 1.161+. Stores human-readable key name that's currently assigned to the provided game key. May store "unknown" and "No key assigned" strings (the latter is defined in languages/en/ui.csv, the former seems to be hardcoded).Network/multiplayer-related string operations
Z17String Operations.2350str_store_player_username<string_register>, <player_id>Stores player's multiplayer username in referenced string register. Can be used in multiplayer mode only.
Z17String Operations.2351str_store_server_password<string_register>Stores server's password in referenced string register.
Z17String Operations.2352str_store_server_name<string_register>Stores server's name (as displayed to clients in server's list window) in referenced string register.
Z17String Operations.2353str_store_welcome_message<string_register>Stores server's welcome message in referenced string register.
Z17String Operations.2355str_encode_url<string_register>This operation will "sanitize" a string to be used as part of network URL, replacing any non-standard characters with their '%'-codes.
Z18Output And Messages.1104display_debug_message<string_id>, [hex_colour_code]Displays a string message, but only in debug mode, using provided color (hex-coded 0xRRGGBB). The message is additionally written to rgl_log.txt file in both release and debug modes when edit mode is enabled.
Z18Output And Messages.1105display_log_message<string_id>, [hex_colour_code]Display a string message using provided color (hex-coded 0xRRGGBB). The message will also be written to game log (accessible through Notes / Game Log), and will persist between sessions (i.e. it will be stored as part of the savegame).
Z18Output And Messages.1106display_message<string_id>,[hex_colour_code]Display a string message using provided color (hex-coded 0xRRGGBB).When edit mode is enabled it also writes to rgl_log.
Z18Output And Messages.1107set_show_messages<value>Suppresses (value = 0) or enables (value = 1) game messages, including those generated by the game engine.
Z18Output And Messages.1120tutorial_box<string_id>, <string_id>This operation is deprecated but is still used in Native.
Z18Output And Messages.1120dialog_box<text_string_id>, [title_string_id]Displays a popup window with the text message and an optional caption.
Z18Output And Messages.1121question_box<string_id>, [<yes_string_id>], [<no_string_id>]Displays a popup window with the text of the question and two buttons (Yes and No by default, but can be overridden). When the player selects one of possible responses, a ti_question_answered trigger will be executed. Works inside a mission template and in the map window, presentations cannot be used at the same time.
Z18Output And Messages.1122tutorial_message<string_id>, [color], [auto_close_time]Displays a popup window with tutorial text stored in referenced string or string register. Use -1 to close any currently open tutorial box. Optional parameters allow you to define text color and time period after which the tutorial box will close automatically. Works also at the world map.
Z18Output And Messages.1123tutorial_message_set_position<position_x>, <position_y>), Defines screen position for the tutorial box. Assumes screen size is 1000*750.
Z18Output And Messages.1124tutorial_message_set_size<size_x>, <size_y>), Defines the font size of the tutorial box. Assumes screen size is 1000*750. The size of the tutorial box is always the same, depending how much text it has (one can see it with background on 1, it has always full width).
Z18Output And Messages.1125tutorial_message_set_center_justify<value>Sets tutorial box to be center justified (value = 1), or use positioning dictated by tutorial_message_set_position (value = 0).
Z18Output And Messages.1126tutorial_message_set_background<value>Defines whether the tutorial box will have a background or not (1 or 0). Default is off.
Z19Game Control: Screens, Menus, Dialogs and Encounters.36entering_town<town_id>Apparently deprecated.
Z19Game Control: Screens, Menus, Dialogs and Encounters.39encountered_party_is_attackerChecks that the party encountered on the world map was following player (i.e. either player was trying to run away or at the very least this is a head-on clash).
Z19Game Control: Screens, Menus, Dialogs and Encounters.42conversation_screen_is_activeChecks that the player is currently in dialogue with some agent. Can only be used in triggers of module_mission_templates.py file.
Z19Game Control: Screens, Menus, Dialogs and Encounters.44in_meta_missionWorks only in conversations. Indicates whether dialogue is taking place in meta mission or in current scene.Game hardcoded windows and related operations
Z19Game Control: Screens, Menus, Dialogs and Encounters.2040change_screen_returnCloses any current screen and returns the player to world map. In missions nothing happens.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2041change_screen_loot<troop_id>Opens the Looting interface, using the provided troop as loot storage. Player has full access to troop inventory.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2042change_screen_trade[troop_id]Opens the Trade screen, using the provided troop as the trading partner. When called from module_dialogs, troop_id is optional and defaults to current dialogue partner.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2043change_screen_exchange_members[exchange_leader], [party_id]Opens the Exchange Members With Party interface, using the specified party_id. If called during an encounter, party_id is optional and defaults to the encountered party. Second parameter determines whether the party leader [0, 1] is exchangeable (useful when managing the castle garrison).
Z19Game Control: Screens, Menus, Dialogs and Encounters.2044change_screen_trade_prisonersOpens the Sell Prisoners interface. Script "script_game_get_prisoner_price" will be used to determine prisoner price.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2045change_screen_buy_mercenariesOpens the Buy Mercenaries interface, where player can hire troops from the party specified with (set_mercenary_source_party) operation. Only works from the dialog.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2046change_screen_view_characterOpens the character screen of another troop. Can only be used in dialogs.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2047change_screen_trainingOpens the character screen for the troop that player is currently talking to. Only works in dialogs. Deprecated, use (change_screen_view_character) instead.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2048change_screen_missionStarts the mission, using previously defined scene and mission template.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2049change_screen_map_conversation<troop_id>Starts the mission, same as (change_screen_mission). However once the mission starts, player will get into dialog with the specified troop, and once the dialog ends, the mission will automatically end.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2050change_screen_exchange_with_party<party_id>Effectively duplicates (change_screen_exchange_members), but party_id parameter is obligatory and the operation doesn't have an option to prevent party leader from being exchanged.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2051change_screen_equip_other[troop_id]Opens the Equip Companion interface. When calling from a dialog, it is not necessary to specify troop_id.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2052change_screen_mapChanges the screen to global map, closing any currently running game menu, dialog or mission.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2053change_screen_notes<note_type>, <object_id>Opens the Notes screen, in the selected category (note_type: 1=troops, 2=factions, 3=parties, 4=quests, 5=info_pages) and for the specified object in that category.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2055change_screen_quitQuits the game to the main menu. Most probably needs to be called from module_game_menus.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2056change_screen_give_members[party_id]Opens the Give Troops to Another Party interface. Party_id parameter is optional during an encounter and will use encountered party as default value.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2057change_screen_controlsOpens the standard Configure Controls screen, pausing the game.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2058change_screen_optionsOpens the standard Game Options screen, pausing the game.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1320set_mercenary_source_party<party_id>Defines the party from which the player will buy mercenaries with (change_screen_buy_mercenaries).
Z19Game Control: Screens, Menus, Dialogs and Encounters.1025start_map_conversation<troop_id>Old syntax: (start_map_conversation, <troop_id>, [troop_dna]),Starts a conversation with the selected troop. Can be called directly from global map or game menus. Troop DNA parameter allows you to randomize non-hero troop appearances.Game menus
Z19Game Control: Screens, Menus, Dialogs and Encounters.2031set_background_mesh<mesh_id>Sets the specified mesh as the background for the current menu. Not working for presentations, not tested yet for dialogs.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2032set_game_menu_tableau_mesh<tableau_material_id>, <value>, <position_register_no>Adds a tableau to the current game menu screen. Position (X,Y) coordinates define mesh position, Z coordinate defines scaling. Parameter <value> will be passed as tableau_material script parameter.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2060jump_to_menu<menu_id>Opens the specified game menu. Note this only happens after the current block of code completes execution.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2061disable_menu_optionNever used in native. Apparently deprecated as menu options have prerequisite code blocks now.Game encounter handling operations
Z19Game Control: Screens, Menus, Dialogs and Encounters.1020set_party_battle_modeUsed before or during the mission to start battle mode. Enables that any party you encouter will permanently take away player's health, can loot the defeated player and various things like that. Basically makes a party encounter like a proper battle (and apparently lets agents use appropriate AI), not just a training run where the player gains back again all his health after the battle.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1019finish_party_battle_modeUsed during the mission to stop battle mode.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1300start_encounter<party_id>Forces the player party to initiate encounter with the specified party. Distance does not matter in this situation.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1301leave_encounterLeaves encounter mode.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1302encounter_attackApparently starts the standard battle with the encountered party. 4research.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1303select_enemy<value>When joining a battle, this determines what side player will be helping. Defending party is always 0, and attacking party is always 1. Player can support either attackers (value = 0, i.e. defenders are the enemy) or defenders (value = 1).
Z19Game Control: Screens, Menus, Dialogs and Encounters.1304set_passage_menu<value>When setting up a mission, this allows you to determine what game menu will be used for that mission passages instead of "mnu_town". Passage menu item number will determine what menu option (in sequential order, starting from 0) will be executed when the player activates that passage on the scene. Note that menu option condition code block will be ignored.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1920start_mission_conversation<troop_id>During the mission, initiates the dialog with specified troop.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2197set_conversation_speaker_troop<troop_id>Allows to dynamically switch speaking troops during the dialog when developer doesn't know in advance who will be doing the speaking. Should be placed in post-talk code section of dialog entry.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2198set_conversation_speaker_agent<agent_id>Allows to dynamically switch speaking agents during the dialog when developer doesn't know in advance who will be doing the speaking. Should be placed in post-talk code section of dialog entry.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2199store_conversation_agent<destination>Stores identifier of agent who is currently speaking.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2200store_conversation_troop<destination>Stores identifier of troop who is currently speaking.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2201store_partner_faction<destination>Stores faction of the troop player is speaking to.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2202store_encountered_party<destination>Stores identifier of the encountered party.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2203store_encountered_party2<destination>Stores the identifier of the second encountered party (when first party is in battle, this one will return its battle opponent).
Z19Game Control: Screens, Menus, Dialogs and Encounters.2205set_encountered_party<party_no>Sets the specified party as encountered by player, but does not run the entire encounter routine. Used in Native during chargen to set up the starting town and then immediately throw the player into street fight without showing him the town menu.
Z19Game Control: Screens, Menus, Dialogs and Encounters.1307end_current_battleApparently ends the battle between player's party and its opponent. Exact effects not clear. 4research.Operations specific to dialogs
Z19Game Control: Screens, Menus, Dialogs and Encounters.50store_repeat_object<destination>Used in the dialogs code in combination with repeat_for_* dialog parameters, when creating dynamical player responses. Stores the value for the current iteration (i.e. a faction ID when repeat_for_factions is used, etc).
Z19Game Control: Screens, Menus, Dialogs and Encounters.2020talk_info_show<hide_or_show>Used in the dialogs code to display relations bar on opponent's portrait when mouse is hovering over it (value = 1) or disable this functionality (value = 0)
Z19Game Control: Screens, Menus, Dialogs and Encounters.2021talk_info_set_relation_bar<value>Sets the relations value for relationship bar in the dialog. Value should be in range -100..100. Enter an invalid value to hide the bar.
Z19Game Control: Screens, Menus, Dialogs and Encounters.2022talk_info_set_line<line_no>, <string_no>)Sets the additional text information (usually troop name) to be displayed together with the relations bar.
Z20Scenes and Missions.1003all_enemies_defeated[<time-value>]Checks if all agents from the enemy are defeated. When a time value x (in seconds) is given the operation only succeeds if the last status change (dead, alive, wounded...) happened more than (or exactly) x seconds ago.
Z20Scenes and Missions.1004race_completed_by_playerNot used in Native. Deprecated. Doesn't do anything, only returns true.
Z20Scenes and Missions.1005num_active_teams_le<value>Checks if the number of active teams (i.e. teams with at least one active agent) is less than or equal to given value.
Z20Scenes and Missions.neg|num_active_teams_lenum_active_teams_gt<value>Checks if the number of active teams is bigger than given value.
Z20Scenes and Missions.1006main_hero_fallenChecks if the player has been knocked out.
Z20Scenes and Missions.neg|main_hero_fallenmain_hero_aliveChecks if the player is alive and not knocked out.
Z20Scenes and Missions.1834scene_allows_mounted_unitsChecks if scene entry has the flag sf_no_horses.
Z20Scenes and Missions.2222is_zoom_disabledVersion 1.153+. Checks that the zoom is currently disabled in the module.ini by setting the parameter disable_zoom = 1.Scene slot operations
Z20Scenes and Missions.503scene_set_slot<scene_id>, <slot_no>, <value>
Z20Scenes and Missions.523scene_get_slot<destination>, <scene_id>, <slot_no>
Z20Scenes and Missions.543scene_slot_eq<scene_id>, <slot_no>, <value>
Z20Scenes and Missions.563scene_slot_ge<scene_id>, <slot_no>, <value>
Z20Scenes and Missions.neg|scene_slot_gescene_slot_lt<scene_id>, <slot_no>, <value>Scene visitors handling operations
Z20Scenes and Missions.1250add_troop_to_site<troop_id>, <scene_id>, <entry_no>Set troop's position in the world to the specified scene and entry point. Entry point must have mtef_scene_source type. Agent will always appear at that entry when entering that scene. No longer used in Native.
Z20Scenes and Missions.1251remove_troop_from_site<troop_id>, <scene_id>Removes the troop from the specified scene. No longer used in Native.
Z20Scenes and Missions.1261modify_visitors_at_site<scene_id>Declares the scene which visitors will be modified from that moment on.
Z20Scenes and Missions.1262reset_visitorsResets all visitors to the scene.
Z20Scenes and Missions.1263set_visitor<mission_template_spawn_record>, <troop_id>, [<dna>]Adds the specified troop as the visitor to the specified spawn record (not the entry point) of the scene defined with (modify_visitors_at_site). Entry point must have mtef_visitor_source type. Optional DNA parameter allows for randomization of agent looks (only applies to non-hero troops).
Z20Scenes and Missions.1264set_visitors<mission_template_spawn_record>, <troop_id>, <number_of_troops>Same as (set_visitors), but spawns an entire group of some troop type.
Z20Scenes and Missions.1265add_visitors_to_current_scene<mission_template_spawn_record>, <troop_id>, <number_of_troops>, <team_no>, <group_no>Adds a number of troops to the specified spawn record (not the entry point) when the scene is already loaded. Requires the entry point to have the flag mtef_visitor_source. Team and group parameters are used in multiplayer mode only, singleplayer mode uses team settings for selected entry point as defined in module_mission_templates.py.
Z20Scenes and Missions.1940mission_tpl_entry_set_override_flags<mission_template_id>, <entry_no>, <value>Allows modder to use a different set of equipment override flags (see af_* constants in header_mission_templates.py) for the selected entry point.
Z20Scenes and Missions.1941mission_tpl_entry_clear_override_items<mission_template_id>, <entry_no>Clears the list of override equipment provided by the entry point definition in module_mission_templates.py.
Z20Scenes and Missions.1942mission_tpl_entry_add_override_item<mission_template_id>, <entry_no>, <item_kind_id>Specified item will be added to any agent spawning on specified entry point. Must be used after using the set_jump_mission to define the context, otherwise it won't work properly.
Z20Scenes and Missions.1943mission_tpl_are_all_agents_spawnedAgents >300 may keep spawning after ti_after_mission_start (fires .1 second too early) if there is not enough space to spawn for agents.Mission/scene general operations
Z20Scenes and Missions.1906set_mission_result<value>Sets the result of the current mission (1 for victory, -1 for defeat).
Z20Scenes and Missions.1907finish_mission<delay_in_seconds>Exits the scene after the specified delay.
Z20Scenes and Missions.1911set_jump_mission<mission_template_id>Tells the game to use the specified mission template for the next mission. Apparently should precede the call to (jump_to_scene).
Z20Scenes and Missions.1910jump_to_scene<scene_id>,<entry_no>(jump_to_scene, <scene_id>, [entry_no]),Tells the game to use the specified scene for the next mission. Usually followed by (change_screen_mission) call. Parameter entry_no does not seem to have any effect.
Z20Scenes and Missions.1912set_jump_entry<entry_no>Defines what entry point the player will appear at when the mission starts.
Z20Scenes and Missions.2211store_current_scene<destination>Retrieves the identifier of the current scene. Note that the operation will return the scene id even after the mission is completed and the player is already on global map.
Z20Scenes and Missions.1789close_order_menuVersion 1.161+. If orders menu is currently open, it will be closed.
Z20Scenes and Missions.1780entry_point_get_position<position>, <entry_no>Retrieves the position of the entry point on the scene.
Z20Scenes and Missions.1781entry_point_set_position<entry_no>, <position>Moves the entry point to the specified position on the scene.
Z20Scenes and Missions.1782entry_point_is_auto_generated<entry_no>Checks that the entry point is auto-generated (in other words, there was no such entry point placed in the scene file).Scene parameters handling
Z20Scenes and Missions.1266scene_set_day_time<value>Defines the time for the scene to force the engine to select a different skybox than the one dictated by current game time. Must be called within ti_before_mission_start trigger in module_mission_templates.py. Value should be in range 0..23.
Z20Scenes and Missions.1797set_rain<rain-type>, <strength>Sets a new weather for the mission. Rain_type values: 0 = clear, 1 = rain, 2 = snow. Strength is typically used in range 0..100 but is actually unlimited. Affects number of particles and fog density.
Z20Scenes and Missions.1798set_fog_distance<distance_in_meters>, [fog_color]Sets the density (and optionally color) of the fog for the mission.
Z20Scenes and Missions.2389set_skybox<non_hdr_skybox_index>, <hdr_skybox_index>Version 1.153+. Forces the scene to be rendered with specified skybox. Index of -1 will disable.
Z20Scenes and Missions.2390set_startup_sun_light<r>, <g>, <b>Version 1.153+. Defines the sunlight color for the scene.
Z20Scenes and Missions.2391set_startup_ambient_light<r>, <g>, <b>Version 1.153+. Defines the ambient light level and colour for the scene. Expects Fixed Point values between 0 and 1.
Z20Scenes and Missions.2392set_startup_ground_ambient_light<r>, <g>, <b>Version 1.153+. Defines the ambient light color for the ground.
Z20Scenes and Missions.2394get_startup_sun_light<position_no>Version 1.165+. Returns startup sunlight color in (x, y, z) coordinates of position register.
Z20Scenes and Missions.2395get_startup_ambient_light<position_no>Version 1.165+. Returns startup ambient light color in (x, y, z) coordinates of position register.
Z20Scenes and Missions.2396get_startup_ground_ambient_light<position_no>Version 1.165+. Returns startup ambient ground lighting color in (x, y, z) coordinates of position register.
Z20Scenes and Missions.1690get_battle_advantage<destination>Retrieves the calculated battle advantage.
Z20Scenes and Missions.1691set_battle_advantage<value>Sets a new value for battle advantage.
Z20Scenes and Missions.1799get_scene_boundaries<position_min>, <position_max>Retrieves the coordinates of the top-left and bottom-right corner of the scene to the provided position registers.
Z20Scenes and Missions.1935mission_enable_talkAllows dialogue with agents on the scene.
Z20Scenes and Missions.1936mission_disable_talkDisables dialogue with agents on the scene.
Z20Scenes and Missions.2002mission_get_time_speed<destination_fixed_point>Retrieves current time speed factor for the mission.
Z20Scenes and Missions.2003mission_set_time_speed<value_fixed_point>Instantly changes the speed of time during the mission. Speed of time cannot be set to zero or below. Operation only works when cheat mode is enabled.
Z20Scenes and Missions.2004mission_time_speed_move_to_value<value_fixed_point>, <duration-in-1/1000-seconds>Changes the speed of time during the mission gradually, within the specified duration period. Speed of time cannot be set to zero or below. Operation only works when cheat mode is enabled.
Z20Scenes and Missions.2006mission_set_duel_mode<value>Sets duel mode for the multiplayer mission. Values: 0 = off, 1 = on.
Z20Scenes and Missions.2220store_zoom_amount<destination_fixed_point>Version 1.153+. Stores current zoom rate.Works only if native shift zoom is disabled via module.ini parameter disable_zoom = 1.
Z20Scenes and Missions.2221set_zoom_amount<value_fixed_point>Version 1.153+. Sets new zoom rate.Works only if native shift zoom is disabled via module.ini parameter disable_zoom = 1.Mission timers
Z20Scenes and Missions.2375reset_mission_timer_aResets the value of first mission timer and starts it from zero.
Z20Scenes and Missions.2376reset_mission_timer_bResets the value of second mission timer and starts it from zero.
Z20Scenes and Missions.2377reset_mission_timer_cResets the value of third mission timer and starts it from zero.
Z20Scenes and Missions.2370store_mission_timer_a<destination>Retrieves current value of first mission timer, in seconds.
Z20Scenes and Missions.2371store_mission_timer_b<destination>Retrieves current value of second mission timer, in seconds.
Z20Scenes and Missions.2372store_mission_timer_c<destination>Retrieves current value of third mission timer, in seconds.
Z20Scenes and Missions.2365store_mission_timer_a_msec<destination>Retrieves current value of first mission timer, in milliseconds.
Z20Scenes and Missions.2366store_mission_timer_b_msec<destination>Retrieves current value of second mission timer, in milliseconds.
Z20Scenes and Missions.2367store_mission_timer_c_msec<destination>Retrieves current value of third mission timer, in milliseconds.Camera and rendering operations
Z20Scenes and Missions.61is_camera_in_first_person
Z20Scenes and Missions.62set_camera_in_first_person<value>1 = first, 0 = third person
Z20Scenes and Missions.2001mission_cam_set_mode<mission_cam_mode>, <duration-in-1/1000-seconds>, <value>Not documented. Changes main camera mode. Camera mode is 0 for automatic and 1 for manual (controlled by code). Duration parameter is used when switching from manual to auto, to determine how long will camera move to its new position.if value = 0, then camera velocity will be linear, else it will be non-linear. Otherwise the third parameter is not documented.
Z20Scenes and Missions.2008mission_cam_set_screen_color<value>Not documented. Paints the screen with solid color. Parameter <value> contains color code with alpha component. Can be used to block screen entirely, add tint etc.
Z20Scenes and Missions.2009mission_cam_animate_to_screen_color<value>, <duration-in-1/1000-seconds>Not documented. Same as above, but color change is gradual. Used in Native to fill the screen with white before the end of marriage scene.
Z20Scenes and Missions.2010mission_cam_get_position<position_register_no>Retrieves the current position of camera during the mission (i.e. the point from which the player is observing the game).
Z20Scenes and Missions.2011mission_cam_set_position<position_register_no>Moves the camera to the specified position during the mission.
Z20Scenes and Missions.2012mission_cam_animate_to_position<position_register_no>, <duration-in-1/1000-seconds>, <value>Moves the camera to the specified position smoothly. Second parameter determines how long it will take camera to move to destination, third parameter determines whether camera velocity will be linear (value = 0) or non-linear (value = 1).
Z20Scenes and Missions.2013mission_cam_get_aperture<destination>If player is holding shift for zooming aperture = 37, normal aperture = 75. When player dies with shift holding mission cam aperture don't return to normal.
Z20Scenes and Missions.2014mission_cam_set_aperture<value>Set aperture for cam.
Z20Scenes and Missions.2015mission_cam_animate_to_aperture<value>, <duration-in-1/1000-seconds>, <value>Not documented. if value = 0, then camera velocity will be linear. else it will be non-linear
Z20Scenes and Missions.2016mission_cam_animate_to_position_and_aperture<position_register_no>, <value>, <duration-in-1/1000-seconds>, <value>Not documented. if value = 0, then camera velocity will be linear. else it will be non-linear
Z20Scenes and Missions.2017mission_cam_set_target_agent<agent_id>, <value>Not documented. if value = 0 then do not use agent's rotation, else use agent's rotation
Z20Scenes and Missions.2018mission_cam_clear_target_agentNot documented.
Z20Scenes and Missions.2019mission_cam_set_animation<anim_id>Plays any bone animation from animations.py, taking the coordinates from the first bone in the hierarchy. The name and number of bones does not matter.
Z20Scenes and Missions.751mouse_get_world_projection<position_no_1>, <position_no_2>Version 1.161+. Returns current camera coordinates (first position) and mouse projection to the back of the world (second position). Rotation data of resulting positions seems unreliable.
Z20Scenes and Missions.1900cast_ray<destination>, <hit_position_register>, <ray_position_register>, [<ray_length_fixed_point>]Version 1.161+. Casts a ray starting from <ray_position_register> and stores the closest hit position into <hit_position_register> (fails if no hits). Rotations of hit position will be normal to the surface, i.e. perpendicular. If the body hit is a scene prop, its instance id will be stored into <destination>, otherwise it will be -1. Optional <ray_length> parameter seems to have no effect.Y-axis points to obstacle.
Z20Scenes and Missions.2386set_postfx<postfx_params-ID>)Sets the respective postfx effect for the current scene. Count through your post_fx-settings beginning from 0 to get the ID for the effect or put the line 'ID_postfx_params import *' at the top to use directly the ID-name. Not used in Native. Can get called with all mission triggers, even when already in the scene. However, in latter case a delay can be noticed when the postfx switches. Appearantly a manually set postfx disappears if HDR gets toggled on/off in the graphic options.
Z20Scenes and Missions.2387set_river_shader_to_mud???)Changes river material for muddy env. This operation is not documented nor any examples of its use could be found. Parameters are unknown.[?] Makes the engine to change the water shading effect _in the current scene_ to one drastically darker.
Z20Scenes and Missions.2393rebuild_shadow_mapVersion 1.153+. Rebuilds shadow map for the current scene to match props' new positions. When you move the prop and don't use this operation, its shadow will still fall on its old position.
Z20Scenes and Missions.2400set_shader_param_int<parameter_name>, <value>), #Sets the int shader parameter <parameter_name> to <value>Version 1.153+. UNTESTED. Allows direct manupulation of shader parameters. Operation scope is unknown, possibly global. Parameter is an int value.
Z20Scenes and Missions.2401set_shader_param_float<parameter_name>, <value_fixed_point>), #Sets the float shader parameter <parameter_name> to <value>Version 1.153+. Allows direct manupulation of shader parameters. Operation scope is unknown, possibly global. Parameter is a float value.
Z20Scenes and Missions.2402set_shader_param_float4<parameter_name>, <valuex>, <valuey>, <valuez>, <valuew>Version 1.153+. Allows direct manupulation of shader parameters. Operation scope is unknown, possibly global. Parameter is a set of 4 float values.
Z20Scenes and Missions.2403set_shader_param_float4x4<parameter_name>, [0][0], [0][1], [0][2], [1][0], [1][1], [1][2], [2][0], [2][1], [2][2], [3][0], [3][1], [3][2]), Sets the float4x4 shader parameter <parameter_name> to the given values .w components are 0001 by defaultVersion 1.153+. Allows direct manupulation of shader parameters. Operation scope is unknown, possibly global. Parameter is a set of 4x4 float values.
Z21Scene Props and Prop Instances.1838prop_instance_is_valid<scene_prop_instance_id>Checks that the reference to a scene prop instance is valid (i.e. it was not removed).
Z21Scene Props and Prop Instances.1862prop_instance_is_animating<destination>, <scene_prop_id>Checks that the scene prop instance is currently animating.
Z21Scene Props and Prop Instances.1880prop_instance_intersects_with_prop_instance<checked_scene_prop_id>, <scene_prop_id>Checks if two scene props are intersecting (i.e. collided). Useful when animating scene props movement. Pass -1 for second parameter to check the prop against all other props on the scene. Scene props must have active collision meshes.Official: cannot check polygon-to-polygon physics models, but can check any other combinations between sphere, capsule and polygon physics models.
Z21Scene Props and Prop Instances.1801scene_prop_has_agent_on_it<scene_prop_instance_id>, <agent_id>Checks that the specified agent is above the scene prop instance. scene_prop_has_agent_over_it would be a more appropriate name for the operation.Scene prop instance slot operations
Z21Scene Props and Prop Instances.510scene_prop_set_slot<scene_prop_instance_id>, <slot_no>, <value>
Z21Scene Props and Prop Instances.530scene_prop_get_slot<destination>, <scene_prop_instance_id>, <slot_no>
Z21Scene Props and Prop Instances.550scene_prop_slot_eq<scene_prop_instance_id>, <slot_no>, <value>
Z21Scene Props and Prop Instances.570scene_prop_slot_ge<scene_prop_instance_id>, <slot_no>, <value>Scene prop general operations
Z21Scene Props and Prop Instances.1853prop_instance_get_scene_prop_kind<destination>, <scene_prop_id>Retrieves the scene prop for the specified prop instance.
Z21Scene Props and Prop Instances.1810scene_prop_get_num_instances<destination>, <scene_prop_id>Retrieves the total number of instances of a specified scene prop on the current scene.
Z21Scene Props and Prop Instances.1811scene_prop_get_instance<destination>, <scene_prop_id>, <instance_no>Retrieves the reference to a scene prop instance by its number.
Z21Scene Props and Prop Instances.1800scene_prop_enable_after_time<scene_prop_id>, <time_period>Prevents usable scene prop from being used for the specified time period in 1/100th of second. Commonly used to implement "cooldown" periods.
Z21Scene Props and Prop Instances.1970set_spawn_position<position>Defines the position which will later be used by (spawn_scene_prop), (spawn_scene_item), (spawn_agent) and (spawn_horse) operations.
Z21Scene Props and Prop Instances.1974spawn_scene_prop<scene_prop_id>Spawns a new scene prop instance of the specified type at the position defined by the last call to (set_spawn_position). Operation stores the prop_instance_id of the spawned position in reg0. Be aware: it is not possible to unspawn a scene prop while a mission is running.
Z21Scene Props and Prop Instances.1840prop_instance_get_variation_id<destination>, <scene_prop_id>Retrieves the first variation ID number for the specified scene prop instance.
Z21Scene Props and Prop Instances.1841prop_instance_get_variation_id_2<destination>, <scene_prop_id>Retrieves the second variation ID number for the specified scene prop instance.
Z21Scene Props and Prop Instances.1889replace_prop_instance<scene_prop_id>, <new_scene_prop_id>Replaces a single scene prop instance with an instance of another scene prop (usually with the same dimensions, but not necessarily so). Can only be called in ti_before_mission_start trigger in module_mission_templates.py.
Z21Scene Props and Prop Instances.1890replace_scene_props<old_scene_prop_id>, <new_scene_prop_id>Replaces all instances of specified scene prop type with another scene prop type. Commonly used to replace damaged walls with their intact versions during normal visits to castle scenes. Can only be called in ti_before_mission_start trigger in module_mission_templates.py.
Z21Scene Props and Prop Instances.1822scene_prop_fade_out<prop_instance_id>, <fade_out_time>, [meta_mesh]Version 1.153+. Makes the scene prop instance disappear within specified time. Leaving meta_mesh blank will have the operation only affect the main mesh, setting it to -1 will affect all submeshes.
Z21Scene Props and Prop Instances.1823scene_prop_fade_in<scene_prop_id>, <fade_in_time>Version 1.153+. Makes the scene prop instance reappear within specified time.
Z21Scene Props and Prop Instances.2617prop_instance_set_material<prop_instance_no>, <sub_mesh_no>, <string_register>Version 1.161+. 4research. give sub mesh as -1 to change all meshes' materials.Scene prop manipulation
Z21Scene Props and Prop Instances.1812scene_prop_get_visibility<destination>, <scene_prop_id>Retrieves the current visibility state of the scene prop instance (1 = visible, 0 = invisible).
Z21Scene Props and Prop Instances.1813scene_prop_set_visibility<scene_prop_id>, <value>Shows (value = 1) or hides (value = 0) the scene prop instance. The collision mesh remains, so you need to always run a seperate operation (prop_instance_enable_physics) to turn on and off to match the collision mesh. Use (rebuild_shadow_map), afterwards to remove prop shadows (Will stutter for a frame)
Z21Scene Props and Prop Instances.1815scene_prop_get_hit_points<destination>, <scene_prop_id>Retrieves current number of hit points that the scene prop instance has.
Z21Scene Props and Prop Instances.1816scene_prop_get_max_hit_points<destination>, <scene_prop_id>Retrieves the maximum number of hit points that the scene prop instance has (useful to calculate the percent of damage).
Z21Scene Props and Prop Instances.1814scene_prop_set_hit_points<scene_prop_id>, <value>Sets the number of hit points that the scene prop has. Both current and max hit points are affected. Only makes sense for sokf_destructible scene props.
Z21Scene Props and Prop Instances.1820scene_prop_set_cur_hit_points<scene_prop_id>, <value>Version 1.153+. Sets current HP amount for scene prop.
Z21Scene Props and Prop Instances.1877prop_instance_receive_damage<scene_prop_id>, <agent_id>, <damage_value>Makes scene prop instance receive specified amount of damage from any arbitrary agent. Agent reference is apparently necessary to properly initialize ti_on_scene_prop_hit trigger parameters.
Z21Scene Props and Prop Instances.1870prop_instance_refill_hit_points<scene_prop_id>Restores hit points of a scene prop instance to their maximum value.
Z21Scene Props and Prop Instances.1817scene_prop_get_team<value>, <scene_prop_id>Retrieves the team controlling the scene prop instance.
Z21Scene Props and Prop Instances.1818scene_prop_set_team<scene_prop_id>, <value>Assigns the scene prop instance to a certain team.
Z21Scene Props and Prop Instances.1819scene_prop_set_prune_time<scene_prop_id>, <value>Not documented. Not used in Native. Taleworlds comment: Prune time can only be set to objects that are already on the prune queue. Static objects are not affected by this operation.
Z21Scene Props and Prop Instances.1850prop_instance_get_position<position>, <scene_prop_id>Retrieves the prop instance current position on the scene.
Z21Scene Props and Prop Instances.1851prop_instance_get_starting_position<position>, <scene_prop_id>Retrieves the prop instance starting position on the scene (i.e. the place where it was positioned when initialized).
Z21Scene Props and Prop Instances.1855prop_instance_set_position<scene_prop_id>, <position>, [dont_send_to_clients]Teleports prop instance to another position. Optional flag dont_send_to_clients can be used on the server to prevent position change from being replicated to client machines (useful when doing some calculations which require to move the prop temporarily to another place). Gets synchronized by game engine automatically if called on server. Each time you call this operation the game sends a network event to all clients. Too many calls will fresh or mess up the client completely, so the only solution is not calling them 20 times per frame.
Z21Scene Props and Prop Instances.1860prop_instance_animate_to_position<scene_prop_id>, position, <duration-in-1/100-seconds>Moves prop instance to another position during the specified time frame (i.e. animates). Time is specified in 1/100th of second.
Z21Scene Props and Prop Instances.1863prop_instance_get_animation_target_position<pos>, <scene_prop_id>Retrieves the position that the prop instance is currently animating to.
Z21Scene Props and Prop Instances.1861prop_instance_stop_animating<scene_prop_id>Stops animating of the prop instance in the current position.
Z21Scene Props and Prop Instances.1852prop_instance_get_scale<position>, <scene_prop_id>Retrieves the current scaling factors of the prop instance.
Z21Scene Props and Prop Instances.1854prop_instance_set_scale<scene_prop_id>, <value_x_fixed_point>, <value_y_fixed_point>, <value_z_fixed_point>Sets new scaling factors for the scene prop.
Z21Scene Props and Prop Instances.1864prop_instance_enable_physics<scene_prop_id>, <value>Enables (value = 1) or disables (value = 0) physics calculation (gravity, collision checks and objects) for the scene prop instance.
Z21Scene Props and Prop Instances.1866prop_instance_initialize_rotation_angles<scene_prop_id>Should be called to initialize the scene prop instance prior to any calls to (prop_instance_rotate_to_position).
Z21Scene Props and Prop Instances.1865prop_instance_rotate_to_position<scene_prop_id>, <position>, <duration-in-1/100-seconds>, <total_rotate_angle_fixed_point>Specified prop instance will move to the target position within the specified duration of time, and within the same time it will rotate for the specified angle. Used in Native code to simulate behavior of belfry wheels and rotating winches.
Z21Scene Props and Prop Instances.1885prop_instance_clear_attached_missiles<scene_prop_id>Version 1.153+. Removes all missiles currently attached to the scene prop. Only works with dynamic scene props (non-retrievable missiles).
Z21Scene Props and Prop Instances.1871prop_instance_dynamics_set_properties<scene_prop_id>, <position>Initializes physical parameters of a scene prop. Position (X,Y) coordinates are used to store object's mass and friction coefficient. Coordinate Z is reserved (set it to zero just in case). Scene prop must be defined as sokf_moveable|sokf_dynamic_physics, and a call to (prop_instance_enable_physics) must be previously made.Official: (prop_instance_dynamics_set_properties,<scene_prop_id>,mass_friction),
Z21Scene Props and Prop Instances.1872prop_instance_dynamics_set_velocity<scene_prop_id>, <position>Sets current movement speed for a scene prop. Position's coordinates define velocity along corresponding axis. Same comments as for (prop_instance_dynamics_set_properties).Official: (prop_instance_dynamics_set_velocity,<scene_prop_id>,linear_velocity),
Z21Scene Props and Prop Instances.1873prop_instance_dynamics_set_omega<scene_prop_id>, <position>Sets current rotation speed for a scene prop. Position's coordinates define rotational speed around corresponding axis. Same comments as for (prop_instance_dynamics_set_properties).Official: (prop_instance_dynamics_set_omega,<scene_prop_id>,angular_velocity),
Z21Scene Props and Prop Instances.1874prop_instance_dynamics_apply_impulse<scene_prop_id>, <position>Applies an impulse of specified scale to the scene prop. Position's coordinates define instant change in movement speed along corresponding axis. Same comments as for (prop_instance_dynamics_set_properties).Official: (prop_instance_dynamics_apply_impulse,<scene_prop_id>,impulse_force),
Z21Scene Props and Prop Instances.2610prop_instance_deform_to_time<prop_instance_no>, <value>Version 1.161+. Deforms a vertex-animated scene prop to specified vertex time. If you open the mesh in OpenBrf, right one of "Time of frame" boxes contains the relevant value.
Z21Scene Props and Prop Instances.2611prop_instance_deform_in_range<prop_instance_no>, <start_frame>, <end_frame>, <duration-in-1/1000-seconds>Version 1.161+. Animate vertex-animated scene prop from start frame to end frame within the specified time period (in milliseconds). If you open the mesh in OpenBrf, right one of "Time of frame" boxes contains the relevant values for frame parameters.
Z21Scene Props and Prop Instances.2612prop_instance_deform_in_cycle_loop<prop_instance_no>, <start_frame>, <end_frame>, <duration-in-1/1000-seconds>Version 1.161+. Performs looping animation of vertex-animated scene prop within the specified vertex frame ranges and within specified time (in milliseconds). If you open the mesh in OpenBrf, right one of "Time of frame" boxes contains the relevant values for frame parameters.
Z21Scene Props and Prop Instances.2615prop_instance_get_current_deform_progress<destination>, <prop_instance_no>Version 1.161+. Returns a percentage value between 0 and 100 if animation is still in progress. Returns 100 otherwise.
Z21Scene Props and Prop Instances.2616prop_instance_get_current_deform_frame<destination>, <prop_instance_no>Version 1.161+. Returns current frame of a vertex-animated scene prop, rounded to nearest integer value.
Z21Scene Props and Prop Instances.1881prop_instance_play_sound<scene_prop_id>, <sound_id>, [flags]Version 1.153+. Makes the scene prop play a specified sound. See sf_* flags in header_sounds.py for reference on possible options.
Z21Scene Props and Prop Instances.1882prop_instance_stop_sound<scene_prop_id>Version 1.153+. Stops any sound currently played by the scene prop instance.Scene items operations
Z21Scene Props and Prop Instances.1830scene_item_get_num_instances<destination>, <item_id>Gets the number of specified scene items present on the scene. Scene items behave exactly like scene props (i.e. cannot be picked).
Z21Scene Props and Prop Instances.1831scene_item_get_instance<destination>, <item_id>, <instance_no>Retrieves the reference to a single instance of a scene item by its sequential number.
Z21Scene Props and Prop Instances.1832scene_spawned_item_get_num_instances<destination>, <item_id>Retrieves the number of specified spawned items present on the scene. Spawned items are actual items, i.e. they can be picked by player.
Z21Scene Props and Prop Instances.1833scene_spawned_item_get_instance<destination>, <item_id>, <instance_no>Retrieves the reference to a single instance of a spawned item by its sequential number.
Z21Scene Props and Prop Instances.1891replace_scene_items_with_scene_props<old_item_id>, <new_scene_prop_id>Replaces all instances of specified scene item with scene props. Can only be called in ti_before_mission_start trigger in module_mission_templates.py.
Z21Scene Props and Prop Instances.1970set_spawn_position<position>), ## DUPLICATE ENTRYDefines the position which will later be used by (spawn_scene_prop), (spawn_scene_item), (spawn_agent) and (spawn_horse) operations.
Z21Scene Props and Prop Instances.1971spawn_item<item_kind_id>, <item_modifier>, [seconds_before_pruning]Spawns a new item, possibly with modifier, on the scene in the position specified by previous call to (set_spawn_position). Optional parameter determines time period (in second) after which the item will disappear. Using 0 will prevent the item from disappearing.
Z21Scene Props and Prop Instances.1976spawn_item_without_refill<item_kind_id>, <item_modifier>, [seconds_before_pruning]Version 1.153+. UNTESTED. It is unclear how this is different from standard (spawn_item).Light sources and particle systems
Z21Scene Props and Prop Instances.1950set_current_color<red_value>, <green_value>, <blue_value>Sets color for subsequent calls to (add_point_light) etc. Color component ranges are 0..255.
Z21Scene Props and Prop Instances.1955set_position_delta<value>, <value>, <value>Can only be called inside item or scene prop triggers. Sets (X,Y,Z) offsets from the item/prop current position for subsequent calls to (add_point_light) etc. Offsets are apparently in centimeters.
Z21Scene Props and Prop Instances.1960add_point_light[flicker_magnitude], [flicker_interval]Adds a point light source to an object with optional flickering magnitude (range 0..100) and flickering interval (in 1/100th of second). Uses position offset and color provided to previous calls to (set_position_delta) and (set_current_color). Can only be used in item triggers.
Z21Scene Props and Prop Instances.1961add_point_light_to_entity[flicker_magnitude], [flicker_interval]Adds a point light source to an object with optional flickering magnitude (range 0..100) and flickering interval (in 1/100th of second). Uses position offset and color provided to previous calls to (set_position_delta) and (set_current_color). Can only be used in scene prop triggers.[?] Attaches an emissive into any [Item] or [Scene Prop] when putting this into their functions. Doesn't work on the Original Game.
Z21Scene Props and Prop Instances.1965particle_system_add_new<par_sys_id>,[position]Adds a new particle system to an object. Uses position offset and color provided to previous calls to (set_position_delta) and (set_current_color). Can only be used in item/prop triggers.
Z21Scene Props and Prop Instances.1968particle_system_emit<par_sys_id>, <value_num_particles>, <value_period>Adds a particle system in some fancy way. Uses position offset and color provided to previous calls to (set_position_delta) and (set_current_color). Can only be used in item/prop triggers.
Z21Scene Props and Prop Instances.1969particle_system_burst<par_sys_id>, <position>, [percentage_burst_strength]Bursts a particle system in specified position.
Z21Scene Props and Prop Instances.1975particle_system_burst_no_sync<par_sys_id>,<position_no>,[percentage_burst_strength]Version 1.153+. Same as above, but apparently does not synchronize this between server and client.
Z21Scene Props and Prop Instances.1886prop_instance_add_particle_system<scene_prop_id>, <par_sys_id>, <position_no>Version 1.153+. Adds a new particle system to the scene prop. Note that <position_no> is local, i.e. in relation to scene prop's coordinates and rotation.
Z21Scene Props and Prop Instances.1887prop_instance_stop_all_particle_systems<scene_prop_id>Version 1.153+. Removes all particle systems currently associated with scene prop instance.
Z22Agents and Teams.1693agent_is_in_special_mode<agent_id>Checks if the agent is currently in scripted mode. It's set after executing agent_set_scripted_destination or agent_set_scripted_destination_no_attack and is cleared with agent_clear_scripted_mode.
Z22Agents and Teams.1699agent_is_routed<agent_id>Checks if the agent has fled from the map (i.e. reached the edge of the map in fleeing mode and then faded).
Z22Agents and Teams.1702agent_is_alive<agent_id>Checks if the agent is alive. Only succeeds if agent is not down.
Z22Agents and Teams.1703agent_is_wounded<agent_id>Checks if the agent has been knocked unconscious. Fails for dead agents.
Z22Agents and Teams.neg|agent_is_aliveagent_is_down<agent_id>Checks if the agent is dead or unconscious.
Z22Agents and Teams.1704agent_is_human<agent_id>Checks if the agent is human (i.e. not horse).
Z22Agents and Teams.neg|agent_is_humanagent_is_horse<agent_id>Checks if the agent is a horse.
Z22Agents and Teams.1706agent_is_ally<agent_id>Checks if the agent is allied to the player (belongs to player's party or allied party in current encounter).
Z22Agents and Teams.neg|agent_is_allyagent_is_enemy<agent_id>Checks if the agent is hostile to the player.
Z22Agents and Teams.1707agent_is_non_player<agent_id>Checks if the agent is not a player. Working in MP?
Z22Agents and Teams.1708agent_is_defender<agent_id>Checks if the agent belongs to the defending side (see encounter operations for details).
Z22Agents and Teams.neg|agent_is_defenderagent_is_attacker<agent_id>Checks if the agent belongs to the attacking side.
Z22Agents and Teams.1712agent_is_active<agent_id>Checks if the agent reference is active. This will succeed for dead or routed agents, for as long as the agent reference itself is valid. Engine will delete agent reference aproximatly 30 sec after his death.
Z22Agents and Teams.1729agent_has_item_equipped<agent_id>, <item_id>Checks if the agent has a specific item equipped.
Z22Agents and Teams.1769agent_is_in_parried_animation<agent_id>Checks if the agent is currently in parrying animation (defending from some attack).
Z22Agents and Teams.1806agent_is_alarmed<agent_id>Checks if the agent is alarmed (in combat mode with weapon drawn).
Z22Agents and Teams.1775class_is_listening_order<team_no>, <sub_class>Checks if the specified group of specified team is listening to player's orders.
Z22Agents and Teams.1788teams_are_enemies<team_no>, <team_no_2>Checks if the two teams are hostile to each other.
Z22Agents and Teams.1826agent_is_in_line_of_sight<agent_id>, <position_no>Version 1.153+. Checks if the agent can be seen from specified position. Rotation of position register is not used (i.e. agent will be seen even if position is "looking" the other way).Team and agent slot operationsTeam and agent slots reset every mission.
Z22Agents and Teams.509team_set_slot<team_id>, <slot_no>, <value>
Z22Agents and Teams.529team_get_slot<destination>, <player_id>, <slot_no>
Z22Agents and Teams.549team_slot_eq<team_id>, <slot_no>, <value>
Z22Agents and Teams.569team_slot_ge<team_id>, <slot_no>, <value>
Z22Agents and Teams.neg|team_slot_geteam_slot_lt<team_id>, <slot_no>, <value>
Z22Agents and Teams.505agent_set_slot<agent_id>, <slot_no>, <value>
Z22Agents and Teams.525agent_get_slot<destination>, <agent_id>, <slot_no>
Z22Agents and Teams.545agent_slot_eq<agent_id>, <slot_no>, <value>
Z22Agents and Teams.565agent_slot_ge<agent_id>, <slot_no>, <value>
Z22Agents and Teams.neg|agent_slot_geagent_slot_lt<agent_id>, <slot_no>, <value>Agent spawning, removal and general operations
Z22Agents and Teams.1930add_reinforcements_to_entry<mission_template_spawn_record>, <wave_size>For battle missions, adds reinforcement wave to the specified spawn record (not the entry point). Additional parameter determines relative wave size. Agents in reinforcement wave are taken from all parties of the side that the entry point belongs to due to mtef_team_* flags.
Z22Agents and Teams.1970set_spawn_position<position>), ## DUPLICATE ENTRYDefines the position which will later be used by (spawn_scene_prop), (spawn_scene_item), (spawn_agent) and (spawn_horse) operations.
Z22Agents and Teams.1972spawn_agent<troop_id>Spawns a new troop in the specified position and saves the reference to the new agent in reg0.
Z22Agents and Teams.1973spawn_horse<item_kind_id>, <item_modifier>Spawns a new horse (with any modifier) in the specified position and saves the reference to the new agent in reg0.
Z22Agents and Teams.1755remove_agent<agent_id>Instantly kills or wounds an agent (will emit dying sound). Dead agents can't be removed of the game, they have to be alive.
Z22Agents and Teams.1749agent_fade_out<agent_id>Fades out the agent from the scene (same effect as fleeing enemies when they get to the edge of map). They will be counted as alive for battle missions. Dead agents can't be faded out of the game, they have to be alive.
Z22Agents and Teams.1750agent_play_sound<agent_id>, <sound_id>Makes the agent emit the specified sound. Gets synchronized by game engine automatically if called on server. Works appearantly the same way as with particle effects, it's getting cut off at a specific distance, up4research.
Z22Agents and Teams.1808agent_stop_sound<agent_id>Stops whatever sound agent is currently performing. Only the reference to the last used sound channel is stored, it is impossible to know which ones were used before for a certain agent.
Z22Agents and Teams.2096agent_set_visibility<agent_id>, <value>Version 1.153+. Sets agent visibility. 0 for invisible, 1 for visible.
Z22Agents and Teams.1700get_player_agent_no<destination>Retrieves the reference to the player-controlled agent. Singleplayer mode only.
Z22Agents and Teams.1723agent_get_kill_count<destination>, <agent_id>, [get_wounded]Retrieves the total number of kills by the specified agent during this battle. Call with non-zero <get_wounded> parameter to retrieve the total number of enemies the agent has knocked down.
Z22Agents and Teams.1710agent_get_position<position>, <agent_id>Retrieves the position of the specified agent on the scene.X, Y, Z - fixed point values, rotation - integer values in degrees from 0 to 359.Position is at ground level even when agent is jumping.Sets X-rotation = 0, Y-rotation = 0. Y-rotation can change from 340 to 20 (aproximately) when turning mounted.Horse and rider have the same position and speed-position.
Z22Agents and Teams.1711agent_set_position<agent_id>, <position>Teleports the agent to specified position on the scene, sets to ground level automatically if dynamics are not turned off before setting agent position (agent_set_no_dynamics). Be careful with riders - you must teleport the horse, not the rider for the operation to work correctly! Does not properly set the rotation of players in MP Warband as their mouse-look direction overrides it. Gets synchronized by game engine automatically if called on server. Each time you call this operation the game sends a network event to all clients. Too many calls will fresh or mess up the client completely, so the only solution is not calling them 20 times per frame.
Z22Agents and Teams.1714agent_get_horse<destination>, <agent_id>Retrieves the reference to the horse agent that the specified agent is riding, or -1 if he's not riding a horse (or is a horse himself).
Z22Agents and Teams.1715agent_get_rider<destination>, <horse_agent_id>Retrieves the reference to the rider agent who is riding the specified horse, or -1 if there's no rider or the specified agent is not a horse.
Z22Agents and Teams.1716agent_get_party_id<destination>, <agent_id>Retrieves the party that the specified agent belongs to (supposedly should only work in battle missions for agents spawned as starting/reinforcement waves).
Z22Agents and Teams.1717agent_get_entry_no<destination>, <agent_id>Retrieves the entry point number where this agent has spawned. What does this return for agents spawned with (spawn_agent)? 4research.
Z22Agents and Teams.1718agent_get_troop_id<destination>, <agent_id>Retrieves the troop type of the specified agent. Returns -1 for horses (because horses are items, not troops).
Z22Agents and Teams.1719agent_get_item_id<destination>, <horse_agent_id>Retrieves the item type of the specified horse agent. Returns -1 for humans.Agent combat parameters and stats
Z22Agents and Teams.1720store_agent_hit_points<destination>, <agent_id>, [absolute]Retrieves current agent health. Optional last parameter determines whether actual health (absolute = 1) or relative percentile health (absolute = 0) is returned. Default is relative.
Z22Agents and Teams.1721agent_set_hit_points<agent_id>, <value>,[absolute]Sets new value for agent health. Optional last parameter determines whether the value is interpreted as actual health (absolute = 1) or relative percentile health (absolute = 0). Default is relative. Gets synchronized by game engine automatically if called on server.
Z22Agents and Teams.2090agent_set_max_hit_points<agent_id>, <value>, [absolute]Version 1.153+. Changes agent's max hit points. Optional flag [absolute] determines if <value> is an absolute number of his points, or relative percentage (0..1000) of default value. Treated as percentage by default.Official: range [0..100], can be exceeded when using absolute values(?)
Z22Agents and Teams.1722agent_deliver_damage_to_agent<agent_id_deliverer>, <agent_id>, [damage_amount], [weapon_item_id]damage value was optional?Official: (agent_deliver_damage_to_agent, <agent_id_deliverer>, <agent_id>, <value>, [item_id]),Makes one agent deal damage to another. Parameter damage_amount is optional, if it is skipped or <= 0, then damage will be calculated using attacker's weapon item and stats (like a normal weapon attack). Optional parameter weapon_item_id was added in 1.153 and will force the game the calculate the damage using this weapon.
Z22Agents and Teams.1827agent_deliver_damage_to_agent_advanced<destination>, <attacker_agent_id>, <agent_id>, <value>, [weapon_item_id]Version 1.153+. Same as (agent_deliver_damage_to_agent), but resulting damage is returned. Also operation takes relations between agents into account, which may result in no damage, or even damage to attacker due to friendly fire rules.Official: (agent_deliver_damage_to_agent_advanced, <destination>, <agent_id_deliverer>, <agent_id>, <value>, [item_id]), #if value <= 0, then damage will be calculated using the weapon item. # item_id is the item that the damage is delivered. can be ignored. #this advanced mode of agent_deliver_damage_to_agent has 2 differences. 1- the delivered damage is returned. 2- the damage delivery is done after checking the relationship between agents. this might cause no damage, or even damage to the shooter agent because of a friendly fire.
Z22Agents and Teams.1829add_missile<agent_id>, <starting_position>, <starting_speed_fixed_point>, <weapon_item_id>, <weapon_item_modifier>, <missile_item_id>, <missile_item_modifier>Version 1.153+. Creates a missile with specified parameters. Note that <starting_position> parameter also determines the direction in which missile flies.Gets probably pos1 of wielded item after being called.
Z22Agents and Teams.1689agent_get_speed<position>, <agent_id>Retrieves agent speed to (X,Y) coordinates of the position register. Speed is local position to agent.X, Y - fixed point values. Sets Z = 0, rotation of <position> doesn't affected. Cavalry don't have x-coordinate. Their position-y-rotation leans to left or right.
Z22Agents and Teams.1733agent_set_no_death_knock_down_only<agent_id>, <value>Sets the agent as unkillable (value = 1) or normal (value = 0). Unkillable agents will drop on the ground instead of dying and will stand up afterwards.
Z22Agents and Teams.1734agent_set_horse_speed_factor<agent_id>, <speed_multiplier-in-1/100>Multiplies agent's horse speed (and maneuverability?) by the specified percentile value (using 100 will make the horse). Note that this is called on the rider, not on the horse! Supposedly will persist even if the agent changes horses. 4research.
Z22Agents and Teams.1736agent_set_speed_limit<agent_id>, <speed_limit(kilometers/hour)>Limits agent speed by the specified value in kph. Use 5 for average walking speed. Affects only AI agents.
Z22Agents and Teams.2065agent_get_damage_modifier<destination>, <agent_id>Output value is in percentage, 100 is default
Z22Agents and Teams.2091agent_set_damage_modifier<agent_id>, <value>Version 1.153+. Changes the damage delivered by this agent. Value is in percentage, 100 is default, 1000 is max possible value.
Z22Agents and Teams.2066agent_get_accuracy_modifier<destination>, <agent_id>Output value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2092agent_set_accuracy_modifier<agent_id>, <value>Version 1.153+. Changes agent's accuracy (with ranged weapons?). Value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2067agent_get_speed_modifier<destination>, <agent_id>Output value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2093agent_set_speed_modifier<agent_id>, <value>Version 1.153+. Changes agent's speed. Value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2068agent_get_reload_speed_modifier<destination>, <agent_id>Output value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2094agent_set_reload_speed_modifier<agent_id>, <value>Version 1.153+. Changes agent's reload speed. Value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2069agent_get_use_speed_modifier<destination>, <agent_id>Output value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2095agent_set_use_speed_modifier<agent_id>, <value>Version 1.153+. Changes agent's speed with using various scene props. Value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.2099agent_set_ranged_damage_modifier<agent_id>, <value>Version 1.157+. Changes agent's damage with ranged weapons. Value is in percentage, 100 is default, value can be between [0..1000]
Z22Agents and Teams.1760agent_get_time_elapsed_since_removed<destination>, <agent_id>Retrieves the number of seconds that have passed since agent's death. Native uses this only for multiplayer to track player's respawns. Can it be used in singleplayer too? 4research.Agent equipment
Z22Agents and Teams.1692agent_refill_wielded_shield_hit_points<agent_id>Restores all hit points for the shield the agent is currently wielding.
Z22Agents and Teams.1725agent_set_invulnerable_shield<agent_id>, <value>Makes the agent shield invulnerable to any damage (value = 1) or makes it vulnerable again (value = 0).
Z22Agents and Teams.1726agent_get_wielded_item<destination>, <agent_id>, <hand_no>Retrieves the item reference that the agent is currently wielding in his right hand (hand_no = 0) or left hand (hand_no = 1). Note that weapons are always wielded in right hand, and shield in left hand. When wielding a two-handed weapon (including bows and crossbows), this operation will return -1 for left hand.
Z22Agents and Teams.1727agent_get_ammo<destination>, <agent_id>, <value>Retrieves the current ammo amount agent has for his wielded item (value = 1) or all his items (value = 0).
Z22Agents and Teams.1977agent_get_item_cur_ammo<destination>, <agent_id>, <slot_no>Version 1.153+. Returns remaining ammo for specified agent's item.
Z22Agents and Teams.1728agent_refill_ammo<agent_id>Refills all ammo and throwing weapon stacks that the agent has in his equipment. Doesn't work at items with the flag itp_remove_item_on_use.
Z22Agents and Teams.1747agent_set_wielded_item<agent_id>, <item_id>Forces the agent to wield the specified item. Agent must have that item in his equipment for this to work. Use item_id = -1 to unwield any currently wielded item.
Z22Agents and Teams.1779agent_equip_item<agent_id>, <item_id>, [weapon_slot_no], [modifier]Adds the specified item to agent and forces him to equip it. Optional weapon_slot_no parameter is only used with weapons and will put the newly added item to that slot (range 1..4) and with optional modifier. If it is omitted with a weapon item, then the agent must have an empty weapon slot for the operation to succeed. Gets synchronized (for weapons, not for armor) by game engine automatically if called on server. Weapons and shields should only be equipped on the server but armor should be equipped on the server for the damage calculations and also on all the clients for the visible meshes.
Z22Agents and Teams.1774agent_unequip_item<agent_id>, <item_id>, [weapon_slot_no]Removes the specified item from the agent. Optional parameter weapon_slot_no is in range 1..4 and determines what weapon slot to remove (item_id must still be set correctly).
Z22Agents and Teams.1776agent_set_ammo<agent_id>, <item_id>, <value>Sets current agent ammo amount to the specified value between 0 and maximum ammo. <item_id> means - ammo item (arrows, bullets, grenades).When you have more than one "quiver" of the same type you must add the total value of all in order to set the correct ammo amount.
Z22Agents and Teams.1804agent_get_item_slot<destination>, <agent_id>, <value>Retrieves item_id for specified agent's slot Possible slot values range in 0..7, order is weapon1, weapon2, weapon3, weapon4, head_armor, body_armor, leg_armor, hand_armor.
Z22Agents and Teams.1825agent_get_ammo_for_slot<destination>, <agent_id>, <slot_no>Retrieves the amount of ammo agent has in the referenced slot (range 0..3).Agent animations
Z22Agents and Teams.1762agent_set_no_dynamics<agent_id>, <value>Makes the agent stand on the spot (value = 1) or move normally (value = 0). When frozen on the spot the agent can still turn around and fight if necessary. Used in Native for the wedding scene (required for cut-scenes). Agent will have collision and physics disabled on it if dynamics are turned off, allowing for (agent_set_position) to teleport them to any location, as well as allowing for a scripted no clipping flight mode ala Half-Life.
Z22Agents and Teams.1768agent_get_animation<destination>, <agent_id>, <body_part>Retrieves current agent animation for specified body part (0 = lower, 1 = upper).
Z22Agents and Teams.1740agent_set_animation<agent_id>, <anim_id>, [channel_no]Forces the agent to perform the specified animation. Optional channel_no parameter determines whether upper body (value = 1) or lower body (value = 0, default) is affected by animation. Gets synchronized by game engine automatically if called on server and if the animation doesn't have the amf_client_prediction flag. Some animations might still need a server event, might be influenced by the flags amf_client_owner_prediction and amf_client_prediction, up4research.
Z22Agents and Teams.1741agent_set_stand_animation<agent_id>, <anim_id>Defines the animation that this agent will use when standing still. Does not force the agent into actually doing this animation.
Z22Agents and Teams.1742agent_set_walk_forward_animation<agent_id>, <anim_id>Defines the animation that this agent will use when walking forward. Only works for NPC agents.
Z22Agents and Teams.1743agent_set_animation_progress<agent_id>, <value_fixed_point>Allows to skip the agent to a certain point in the animation cycle, as specified by the fixed point value (0..fixed_point_multiplier).
Z22Agents and Teams.2083agent_ai_set_can_crouch<agent_id>, <value>Version 1.153+. Allows or forbids the agent to crouch. 0 to forbid, 1 to allow.
Z22Agents and Teams.2097agent_get_crouch_mode<destination>, <agent_id>Version 1.153+. Retrieves agent's crouch status (1 = crouching, 0 = standing).
Z22Agents and Teams.2098agent_set_crouch_mode<agent_id>, <value>Version 1.153+. Sets agent's crouch status (1 = crouch, 0 = stand up).
Z22Agents and Teams.1756agent_get_attached_scene_prop<destination>, <agent_id>Retrieves the reference to scene prop instance which is attached to the agent, or -1 if there isn't any.
Z22Agents and Teams.1757agent_set_attached_scene_prop<agent_id>, <scene_prop_id>Attaches the specified prop instance to the agent. Used in multiplayer CTF missions to attach flags to players. Does not get synchronized by game engine automatically if called on server. The scale factor at the skin entry gets applied to the scene prop.
Z22Agents and Teams.1758agent_set_attached_scene_prop_x<agent_id>, <value>Offsets the position of the attached scene prop in relation to agent, in centimeters, along the X axis (left/right).
Z22Agents and Teams.1809agent_set_attached_scene_prop_y<agent_id>, <value>Offsets the position of the attached scene prop in relation to agent, in centimeters, along the Y axis (backwards/forward).
Z22Agents and Teams.1759agent_set_attached_scene_prop_z<agent_id>, <value>Offsets the position of the attached scene prop in relation to agent, in centimeters, along the Z axis (down/up).
Z22Agents and Teams.2076agent_get_bone_position<position_no>, <agent_no>, <bone_no>, [<local_or_global>]Version 1.161+. Returns current position for agent's bone. Examine skeletons.brf and horse_skeleton.brf in CommonRes folder to see hitboxes of these bones and their <bone_no>.Pass 1 as optional <local_or_global> parameter to retrieve global bone coordinates.Agent AI and scripted behavior
Z22Agents and Teams.2077agent_ai_set_interact_with_player<agent_no>, <value>Version 1.165+. Enables or disables agent AI interation with player. Dialog? Combat? 4research.
Z22Agents and Teams.1807agent_set_is_alarmed<agent_id>, <value>Sets agent's status as alarmed (value = 1) or peaceful (value = 0).
Z22Agents and Teams.1802agent_clear_relations_with_agents<agent_id>Clears any agent-to-agent relations for specified agent.
Z22Agents and Teams.1803agent_add_relation_with_agent<agent_id>, <agent_id>, <value>Changes relations between two agents on the scene to enemy (value = -1), neutral (value = 0), ally (value = 1). Note that neutral agents are immune to friendly fire.
Z22Agents and Teams.1761agent_get_number_of_enemies_following<destination>, <agent_id>Retrieves the total number of enemies who are currently attacking the specified agents. May be used for AI decision-making.
Z22Agents and Teams.2670agent_ai_get_num_cached_enemies<destination>, <agent_no>Version 1.165+. Returns total number of nearby enemies as has been cached by agent AI. Enemies are numbered from nearest to farthest.
Z22Agents and Teams.2671agent_ai_get_cached_enemy<destination>, <agent_no>, <cache_index>Version 1.165+. Return agent reference from AI's list of cached enemies, from nearest to farthest. Returns -1 if the cached enemy is not active anymore.Max slots are 16. Every 2 seconds renew cashed enemies in order from nearest to farthest.
Z22Agents and Teams.1763agent_get_attack_action<destination>, <agent_id>Retrieves agent's current attack action. Possible values: free = 0, readying_attack = 1, releasing_attack = 2, completing_attack_after_hit = 3, attack_parried = 4, reloading = 5, after_release = 6, cancelling_attack = 7.
Z22Agents and Teams.1764agent_get_defend_action<destination>, <agent_id>Retrieves agent's current defend action. Possible values: free = 0, parrying = 1, blocking = 2.
Z22Agents and Teams.1767agent_get_action_dir<destination>, <agent_id>Retrieves the direction of current agent's action.Possible values at attacking: invalid = -1, ranged/thrust = 0, right swing = 1, left swing = 2, overswing = 3.Possible values at defending: invalid = -1, forward/down = 0, right = 1, left = 2, up = 3, global/blocking with shield = 5.
Z22Agents and Teams.1745agent_set_attack_action<agent_id>, <direction_value>, <action_value>Forces the agent to perform an attack action. Direction value: -2 = cancel any action (1.153+), 0 = thrust, 1 = slashright, 2 = slashleft, 3 = overswing. Action value: 0 = ready and release, 1 = ready and hold.
Z22Agents and Teams.1746agent_set_defend_action<agent_id>, <value>, <duration-in-1/1000-seconds>Forces the agent to perform a defend action. Possible values: -2 = cancel any action (1.153+), 0 = defend_down, 1 = defend_right, 2 = defend_left, 3 = defend_up. Does time value determine delay, speed or duration? 4research.
Z22Agents and Teams.1730agent_set_scripted_destination<agent_id>, <position>, [auto_set_z_to_ground_level], [no_rethink]Official: (agent_set_scripted_destination, <agent_id>, <position_no>, <auto_set_z_to_ground_level>, <no_rethink>),Forces the agent to travel to specified position and stay there until new behavior is set or scripted mode cleared. First optional parameter determines whether the position Z coordinate will be automatically set to ground level (value = 1) or not (value = 0). Second optional parameter added in 1.165 patch, set it to 1 to save resources. It works also for AI cavalry riders and riderless horses.
Z22Agents and Teams.1748agent_set_scripted_destination_no_attack<agent_id>, <position>, <auto_set_z_to_ground_level>Same as above, but the agent will not attack his enemies.
Z22Agents and Teams.1731agent_get_scripted_destination<position>, <agent_id>Retrieves the position which is defined as agent's scripted destination, if any.
Z22Agents and Teams.1732agent_force_rethink<agent_id>Forces the agent to recalculate his current actions after setting him a new scripted destination or changing other factors affecting his behavior.
Z22Agents and Teams.1735agent_clear_scripted_mode<agent_id>Clears scripting mode from the agent, making him behave as usual again.
Z22Agents and Teams.1737agent_ai_set_always_attack_in_melee<agent_id>, <value>Forces the agent to continuously attack in melee combat, instead of defending. Used in Native to prevent stalling at the top of the siege ladder. Use value = 0 to clear this mode.
Z22Agents and Teams.1738agent_get_simple_behavior<destination>, <agent_id>Retrieves agent's current simple behavior (see aisb_* constants in header_mission_templates.py for details).
Z22Agents and Teams.2082agent_ai_get_behavior_target<destination>, <agent_id>Version 1.153+. UNTESTED. Supposedly returns agent_id which is the target of current agent's behavior.
Z22Agents and Teams.1739agent_get_combat_state<destination>, <agent_id>Retrieves agent's current combat state:0 = nothing special, this value is also always returned for player and for dead agents.1 = target in sight (for ranged units)2 = guarding (without a shield)3 = preparing a melee attack or firing a ranged weapon4 = releasing a melee attack or reloading a crossbow7 = recovering after being hit in melee OR blocking with a shield. Contradictory information, 4research.8 = target to the right (horse archers) OR no target in sight (ranged units). Contradictory information, 4research.
Z22Agents and Teams.2081agent_ai_get_move_target<destination>, <agent_id>Version 1.153+. UNTESTED. Supposedly returns the enemy agent to whom the agent is currently moving to.
Z22Agents and Teams.1709agent_get_look_position<position>, <agent_id>Retrieves the coordinates of the agent position and currently looking angles. It is a position that is located centrally horizontally and vertically on the bottom of the model. Basically, it is a position rotated with the agents direction but located underneath the feet.
Z22Agents and Teams.1744agent_set_look_target_position<agent_id>, <position>Forces the agent to look at specified position (turn his head as necessary). Alarmed agents will ignore this. Agents will only look for a short amount of time.
Z22Agents and Teams.2080agent_ai_get_look_target<destination>, <agent_id>Version 1.153+. UNTESTED. Supposedly returns agent_id that the agent is currently looking at.
Z22Agents and Teams.1713agent_set_look_target_agent<watcher_agent_id>, <observed_agent_id>Forces the agent to look at specified agent (track his movements). Alarmed agents will ignore this.
Z22Agents and Teams.1751agent_start_running_away<agent_id>, [<position_no>]Makes the agent flee the battlefield, ignoring everything else and not attacking. If the agent reaches the edge of map in this mode, he will fade out. Optional position_no parameter added in 1.153 and will make the agent flee to specified position instead (pos0 is not allowed and will be ignored). When used on a mounted horse makes the agent 'fall off' instantly and the horse will run away (works for player too).
Z22Agents and Teams.1752agent_stop_running_away<agent_id>Cancels fleeing behavior for the agent, turning him back to combat state.
Z22Agents and Teams.1753agent_ai_set_aggressiveness<agent_id>, <value>Sets the aggressiveness parameter for agent AI to use. Default value is 100. Higher values make agent more aggressive. Actual game effects are not obvious, apparently used to speed up mob aggravation when previously neutral.
Z22Agents and Teams.1754agent_set_kick_allowed<agent_id>, <value>Enables (value = 1) or disables (value = 0) kicking for the specified agent. Only makes sense for player-controlled agents as bots don't know how to kick anyway (if not scripted into the mod, kicking AI).
Z22Agents and Teams.2379set_cheer_at_no_enemy<value>Version 1.153+. Determines whether the agents will cheer when no enemy remain on the map. 0 = do not cheer, 1 = cheer. A voice_victory sound entry at the skin entry is required for it to work.
Z22Agents and Teams.1777agent_add_offer_with_timeout<agent_id>, <offerer_agent_id>, <duration-in-1/1000-seconds>Esoteric stuff. Used in multiplayer duels. Second agent_id is offerer, 0 value for duration is an infinite offer.
Z22Agents and Teams.1778agent_check_offer_from_agent<agent_id>, <offerer_agent_id>), #second agent_id is offererEsoteric stuff. Used in multiplayer duels. Second agent_id is offerer.Team operations
Z22Agents and Teams.1765agent_get_group<destination>, <agent_id>In multiplayer: Retrieves reference to player who is currently the leader of specified bot agent.In singleplayer: Retrieves agent group wich is the same as agent team.
Z22Agents and Teams.1766agent_set_group<agent_id>, <player_leader_id>In multiplayer: Puts the bot agent under command of specified player.In singleplayer: Change the group. Agent team is not changed. Use agent_set_team.
Z22Agents and Teams.1770agent_get_team<destination>, <agent_id>Retrieves the team that the agent belongs to.
Z22Agents and Teams.1771agent_set_team<agent_id>, <value>Puts the agent to specified team number. Also copies "value" to agent group.
Z22Agents and Teams.1772agent_get_class<destination>, <agent_id>Retrieves the agent class (see grc_* constants in header_mission_templates.py for reference). Note this operation returns the troop class that the game divines from troop equipment and flags, ignoring any custom troop class settings.
Z22Agents and Teams.1773agent_get_division<destination>, <agent_id>Retrieves the agent division (custom troop class number in 0..8 range).
Z22Agents and Teams.1783agent_set_division<agent_id>, <value>Puts the agent into the specified division. This does not affect agent's troop class. Note that there's a bug in Warband: if an order is issued to agent's original division, the agent will immediately switch back to its original division number. Therefore, if you want to manipulate agent divisions dynamically during the battle, you need to implement some workarounds for this bug.
Z22Agents and Teams.1784team_get_hold_fire_order<destination>, <team_no>, <division>Retrieves current status of hold fire order for specified team/division (see aordr_* constants in header_mission_templates.py for reference).
Z22Agents and Teams.1785team_get_movement_order<destination>, <team_no>, <division>Retrieves current movement orders for specified team/division (see mordr_* constants in header_mission_templates.py for reference).
Z22Agents and Teams.1786team_get_riding_order<destination>, <team_no>, <division>Retrieves current status of riding order for specified team/division (see rordr_* constants in header_mission_templates.py for reference).
Z22Agents and Teams.1787team_get_weapon_usage_order<destination>, <team_no>, <division>Retrieves current status of weapon usage order for specified team/division (see wordr_* constants in header_mission_templates.py for reference).
Z22Agents and Teams.1790team_give_order<team_no>, <division>, <order_id>Issues an order to specified team/division.
Z22Agents and Teams.1791team_set_order_position<team_no>, <division>, <position>Defines the position for specified team/division when currently issued order requires one.
Z22Agents and Teams.1792team_get_leader<destination>, <team_no>Retrieves the reference to the agent who is the leader of specified team.
Z22Agents and Teams.1793team_set_leader<team_no>, <new_leader_agent_id>Sets the agent as the new leader of specified team.
Z22Agents and Teams.1794team_get_order_position<position>, <team_no>, <division>Retrieves position which is used for specified team/division current orders.
Z22Agents and Teams.1795team_set_order_listener<team_no>, <division>, [add_to_listeners]Official: (team_set_order_listener, <team_no>, <sub_class>, <value>), #merge with old listeners if value is non-zero #clear listeners if sub_class is less than zeroSet the specified division as the one which will be following orders issued by the player (assuming the player is on the same team). If optional parameter add_to_listeners is greater than 0, then the operation will instead *add* specified division to order listeners. If division number is -1, then list of order listeners is cleared. If division number is 9, then all divisions will listen to player's orders.
Z22Agents and Teams.1796team_set_relation<team_no>, <team_no_2>, <value>Sets relations between two teams. Possible values: enemy (-1), neutral (0) and friendly (1).
Z22Agents and Teams.2360store_remaining_team_no<destination>Retrieves the number of the last remaining team. Currently not used in Native, possibly deprecated.
Z22Agents and Teams.1828team_get_gap_distance<destination>, <team_no>, <sub_class>Version 1.153+. UNTESTED. Supposedly returns average gap between troops of a specified team/class (depends on how many Stand Closer/Spread Out orders were given).Combat statistics
Z22Agents and Teams.2380store_enemy_count<destination>No longer used in Native. Apparently stores total number of active enemy agents. Possibly deprecated. 4research.
Z22Agents and Teams.2381store_friend_count<destination>No longer used in Native. Apparently stores total number of active friendly agents. Possibly deprecated. 4research.
Z22Agents and Teams.2382store_ally_count<destination>No longer used in Native. Apparently stores total number of active allied agents (how is it different from friends?). Possibly deprecated. 4research.
Z22Agents and Teams.2383store_defender_count<destination>No longer used in Native. Apparently stores total number of active agents on defender's side. Possibly deprecated. 4research.
Z22Agents and Teams.2384store_attacker_count<destination>No longer used in Native. Apparently stores total number of active agents on attacker's side. Possibly deprecated. 4research.
Z22Agents and Teams.2385store_normalized_team_count<destination>, <team_no>Stores the number of agents belonging to specified team, normalized according to battle_size and advantage. Commonly used to calculate advantage and possibly reinforcement wave sizes.100% is equal to relative spawn agents count on mission start. For example if spawn point have 40 then 50% will be 20.
Z23Presentations.903is_presentation_active<presentation_idChecks if the specified presentation is currently running.General presentation operations
Z23Presentations.900start_presentation<presentation_id>Starts the specified presentation.
Z23Presentations.901start_background_presentation<presentation_id>Apparently allows you to start a presentation in background but stay in the menu. 4research.Official: can only be used in game menus
Z23Presentations.902presentation_set_duration<duration-in-1/100-seconds>Sets presentation duration time, in 1/100th of second. Must be called when a presentation is active. If several presentations are active, duration will be set for all of them.Creating overlays
Z23Presentations.910create_text_overlay<destination>, <string_id>Creates a text label overlay and returns its overlay_id.
Z23Presentations.911create_mesh_overlay<destination>, <mesh_id>Creates a mesh overlay and returns its overlay_id.
Z23Presentations.944create_mesh_overlay_with_item_id<destination>, <item_id>Creates a mesh overlay, using the specified item mesh. Returns overlay_id.
Z23Presentations.939create_mesh_overlay_with_tableau_material<destination>, <mesh_id>, <tableau_material_id>, <value>Creates a mesh overlay, using the specified tableau_material. When mesh_id = -1, it is generated automatically. Value is passed as the parameter for tableau_material script. Returns overlay_id.
Z23Presentations.912create_button_overlay<destination>, <string_id>Creates a generic button overlay and returns its overlay_id. The only difference between this and subsequent two operations is that they use different button meshes.
Z23Presentations.940create_game_button_overlay<destination>, <string_id>Creates a game button overlay and returns its overlay_id.
Z23Presentations.941create_in_game_button_overlay<destination>, <string_id>Creates an in-game button overlay and returns its overlay_id.
Z23Presentations.913create_image_button_overlay<destination>, <mesh_id>, <mesh_id>Creates an image button, using two meshes for normal (1st mesh) and pressed (2nd mesh) status. Button does not have a textual label. Returns button overlay_id.
Z23Presentations.938create_image_button_overlay_with_tableau_material<destination>, <mesh_id>, <tableau_material_id>, <value>Creates an image button from the specified mesh, using tableau_material as the image. When mesh = -1, it is generated automatically. Value is passed as the parameter to the tableau_material script. Returns overlay_id.
Z23Presentations.914create_slider_overlay<destination>, <min_value>, <max_value>Creates horizontal slider overlay, with positions of the slider varying between min and max values. Current value of the slider can be changed with (overlay_set_val). Returns slider's overlay_id.
Z23Presentations.915create_progress_overlay<destination>, <min_value>, <max_value>Creates progress bar overlay, with positions of the bar varying between min and max values. Current value of the progress bar can be changed with (overlay_set_val). Returns bar's overlay_id.
Z23Presentations.942create_number_box_overlay<destination>, <min_value>, <max_value>Creates a number box overlay (a small field for numeric value and small increase/decrease buttons to the right) with specified min and max values. Returns number box overlay_id.
Z23Presentations.917create_text_box_overlay<destination>Apparently deprecated. No longer used in Native.
Z23Presentations.919create_simple_text_box_overlay<destination>Creates a text field overlay, where user can enter any text. Returns text field's overlay_id. Text contents of the field can be retrieved from s0 trigger in ti_on_presentation_event_state_change event for the text field.
Z23Presentations.918create_check_box_overlay<destination>, <checkbox_off_mesh>, <checkbox_on_mesh>Creates a checkbox overlay. Returns checkbox overlay_id.
Z23Presentations.943create_listbox_overlay<destination>Creates a listbox overlay. Individual items can be added with (overlay_add_item) and index of currently selected item can be set with (overlay_set_val). Returns listbox overlay_id. Importance of later two parameters unclear (default text&value?). 4research.Old syntax (has it changed?): (create_list_box_overlay, <destination>, <string>, <value>),
Z23Presentations.948create_combo_label_overlay<destination>Creates a combo label overlay. Looks like plain text label. Individual items can be added with (overlay_add_item) and currently selected item can be set with (overlay_set_val). Returns combo block's overlay_id.
Z23Presentations.916create_combo_button_overlay<destination>Creates a combo button overlay. For example see "Screen Resolution" dropdown in Settings menu. Individual items can be added with (overlay_add_item) and currently selected item can be set with (overlay_set_val). Returns combo block's overlay_id.
Z23Presentations.931overlay_add_item<overlay_id>, <string_id>Adds an item to the listbox or combobox. Items are indexed from 0. Note the order in which items appear in the dropdown is reverse to the order in which they're added.Overlays hierarchy manipulation
Z23Presentations.945set_container_overlay<overlay_id>Defines the specified overlay as the container. All subsequently created overlays will be placed inside the container, and their coordinates will be based on container's position. All containers with their contents will be displayed *above* any non-container overlays. Use -1 to stop placing overlays to current container and resume normal behavior.
Z23Presentations.951overlay_set_container_overlay<overlay_id>, <container_overlay_id>Allows you to put one overlay into a container, or remove it from container (if container_overlay_id = -1) without setting current overlay. May be unreliable.Overlay manipulation
Z23Presentations.946overlay_get_position<position>, <overlay_id>Retrieves overlay current position to specified position trigger, using position's X and Y coordinates. Note that the screen size in Warband is (1.00,0.75), further modified by fixed point multiplier.
Z23Presentations.927overlay_set_val<overlay_id>, <value>Sets the value of the overlays which have numeric values.Official: can be used for sliders, combo buttons and check boxes
Z23Presentations.920overlay_set_text<overlay_id>, <string_id>Changes the overlay text (if it has any). Works for labels, text fields, buttons with text labels...
Z23Presentations.928overlay_set_boundaries<overlay_id>, <min_value>, <max_value>Changes the value boundaries for the overlays that have them.
Z23Presentations.926overlay_set_position<overlay_id>, <position>Sets the overlay position on the screen, using position's X and Y coordinates. Note that the screen size in Warband is (1.00,0.75), further modified by fixed point multiplier.
Z23Presentations.925overlay_set_size<overlay_id>, <position>Sets the overlay size, using position's X and Y coordinates. For meshes, button overlays, etc. the operation will modify the actual size of the overlay, whereas for text overlays it will dictate the font size the overlay will use. The default font size is X = 1000, Y = 1000 (with a fixed_point_multiplier of 1000). Note that the screen size in Warband is (1.00,0.75), further modified by fixed point multiplier. Also see (overlay_set_area_size).
Z23Presentations.929overlay_set_area_size<overlay_id>, <position>Defines the actual area on the screen used to display the overlay. If its size is greater than area size, it will create a scrollable area with appropriate scrollbars. Can be used to create scrollable areas for large text, or scrollable containers with many children elements (see Host Game screen for a typical example).
Z23Presentations.952overlay_set_additional_render_height<overlay_id>, <height_adder>Version 1.153+. Effects uncertain. 4research.
Z23Presentations.937overlay_animate_to_position<overlay_id>, <duration-in-1/1000-seconds>, <position>Moves overlay to specified position during a specified timeframe, specified in 1/1000th of second.
Z23Presentations.936overlay_animate_to_size<overlay_id>, <duration-in-1/1000-seconds>, <position>Changes overlay size to specified value during a specified timeframe, specified in 1/1000th of second.
Z23Presentations.930overlay_set_mesh_rotation<overlay_id>, <position>Despite the name, works with any overlay, allowing you to put it on the screen in rotated position. To determine the angles, position's rotation values are used (not coordinates!). Usually you will want to only use rotation around Z axis (which results in clockwise or anti-clockwise rotation as seen by user). Note that rotating overlays which are placed inside a container may cause strange results, so some trial and error will be necessary in such situation.
Z23Presentations.956overlay_set_material<overlay_id>, <string_no>Version 1.161+. Replaces the material used for rendering specified overlay.
Z23Presentations.921overlay_set_color<overlay_id>, <color>Changes the overlay color (hexadecimal value 0xRRGGBB). May not work with some overlay types.
Z23Presentations.922overlay_set_alpha<overlay_id>, <alpha>Changes the overlay alpha (hexadecimal value in 0x00..0xFF range). May not work with some overlay types.
Z23Presentations.923overlay_set_hilight_color<overlay_id>, <color>Highlights the overlay with specified color. May not work with some overlay types.
Z23Presentations.924overlay_set_hilight_alpha<overlay_id>, <alpha>Highlights the overlay with specified alpha. May not work with some overlay types.
Z23Presentations.932overlay_animate_to_color<overlay_id>, <duration-in-1/1000-seconds>, <color>Changes overlay's color during a specified timeframe, specified in 1/000th of second.
Z23Presentations.933overlay_animate_to_alpha<overlay_id>, <duration-in-1/1000-seconds>, <color>Changes overlay's alpha during a specified timeframe, specified in 1/000th of second.Doesn't work with text overlays using <tf_with_outline>.overlay_set_alpha doesn't work when animating is processed. Use overlay_animate_to_alpha with 0 msec.
Z23Presentations.934overlay_animate_to_highlight_color<overlay_id>, <duration-in-1/1000-seconds>, <color>Highlights overlay to specified color during a specified timeframe, specified in 1/000th of second.
Z23Presentations.935overlay_animate_to_highlight_alpha<overlay_id>, <duration-in-1/1000-seconds>, <color>Highlights overlay to specified alpha during a specified timeframe, specified in 1/000th of second.
Z23Presentations.947overlay_set_display<overlay_id>, <value>Shows (value = 1) or hides (value = 0) the specified overlay.
Z23Presentations.949overlay_obtain_focus<overlay_id>Makes the specified overlay obtain input focus. Only works for textboxes.
Z23Presentations.950overlay_set_tooltip<overlay_id>, <string_id>Defines a text which will be displayed as a tooltip when mouse pointer will hover over the specified overlay. Unreliable, always test how it works.Popups and some esoteric stuff
Z23Presentations.970show_item_details<item_id>, <position>, <price_multiplier_percentile>Shows a popup box at the specified position, containing standard game information for the specified item. Last parameter determines price percentile multiplier. Multiplier value of 100 will display item standard price, value of 0 will display "Default Item" instead of price (used in multiplayer equipment selection presentation).Official: price_multiplier is percent, usually returned by script_game_get_item_[buy/sell]_price_factor
Z23Presentations.972show_item_details_with_modifier<item_id>, <item_modifier>, <position>, <price_multiplier_percentile>Same as above, but displays stats and price information for an item with a modifier.
Z23Presentations.971close_item_detailsCloses the item details popup box.
Z23Presentations.2388show_troop_details<troop_id>, <position>, <troop_price>Version 1.153+. Supposedly displays a popup with troop information at specified place. 4research.
Z24Multiplayer And Networking.401player_is_active<player_id>Checks that the specified player is active (i.e. connected to server).Checks that the player reference corresponds to active player. Players are assigned a free ID after connection and on disconnection it becomes free/invalid until taken by another connecting player.
Z24Multiplayer And Networking.417multiplayer_is_serverChecks that the code is running on multiplayer server. Operation will fail on client machines or in singleplayer mode. This will succeed for listen and dedicated servers and will only fail on clients.
Z24Multiplayer And Networking.418multiplayer_is_dedicated_serverChecks that the game running is a dedicated server. This will only succeed for dedicated servers and will fail on listen servers and clients.
Z24Multiplayer And Networking.419game_in_multiplayer_modeChecks that the game is running in multiplayer mode.
Z24Multiplayer And Networking.430player_is_admin<player_id>Checks that the player used the admin password to join the server.
Z24Multiplayer And Networking.438player_is_busy_with_menus<player_id>Undocumented. Educated guess is it's true when player is running a presentation without prsntf_read_only flag.This one is used when a player presses a hotkey like TAB or ESC to check if he doesn't have any kind of presentation open, however, it works strangely and is almost always accompannied by some sort of (neg|is_presentation_active, "prst"), in nativeResearch: Is actually not getting used together with (neg|is_presentation_active, "prst"). It is getting called on the server and isn't synched with clients. Used in multiplayer to prevent the spawning of a player agent if the player is still busy with the menus (and might still change the loadout of the agent).
Z24Multiplayer And Networking.461player_item_slot_is_picked_up<player_id>, <item_slot_no>Checks that the provided item slot for the referenced player was picked up from the battlefield instead of bought.Player slot operations
Z24Multiplayer And Networking.508player_set_slot<player_id>, <slot_no>, <value>
Z24Multiplayer And Networking.528player_get_slot<destination>, <player_id>, <slot_no>
Z24Multiplayer And Networking.548player_slot_eq<player_id>, <slot_no>, <value>
Z24Multiplayer And Networking.568player_slot_ge<player_id>, <slot_no>, <value>Network communication operations
Z24Multiplayer And Networking.380send_message_to_url<string_id>, <encode_url>Sends an HTTP request. Response from that URL will be returned to "script_game_receive_url_response". Parameter <encode_url> is optional and effects are unclear. Supposedly its equivalent of calling (str_encode_url) on the first parameter which doesn't make sense for me.Accesses the the URL in the provided string. The result will be returned to script_game_receive_url_response.
Z24Multiplayer And Networking.388multiplayer_send_message_to_server<message_type>Multiplayer client operation. Send a simple message (only message code, no data) to game server.
Z24Multiplayer And Networking.389multiplayer_send_int_to_server<message_type>, <value>Multiplayer client operation. Send a message with a single extra integer value to game server.
Z24Multiplayer And Networking.390multiplayer_send_2_int_to_server<message_type>, <value>, <value>Same as (multiplayer_send_int_to_server), but two integer values are sent.
Z24Multiplayer And Networking.391multiplayer_send_3_int_to_server<message_type>, <value>, <value>, <value>Same as (multiplayer_send_int_to_server), but three integer values are sent.
Z24Multiplayer And Networking.392multiplayer_send_4_int_to_server<message_type>, <value>, <value>, <value>, <value>Same as (multiplayer_send_int_to_server), but four integer values are sent.
Z24Multiplayer And Networking.393multiplayer_send_string_to_server<message_type>, <string_id>Multiplayer client operation. Send a message with a string value to game server.<message_type> parameter must be between 0 and 127 or it will be truncated. In the case of Native they can be found on header_common.py as client and server events.These are handled in script_game_receive_network_message and are used for server events. As for strings, the input is s0 (in the script).The other 6 operations (multiplayer_send_*_to_player) have the same functionality but are called on the server and send the message to the player referenced by <player_id>. Also handled by script_game_receive_network_message.
Z24Multiplayer And Networking.394multiplayer_send_message_to_player<player_id>, <message_type>Multiplayer server operation. Send a simple message (only message code, no data) to one of connected players.
Z24Multiplayer And Networking.395multiplayer_send_int_to_player<player_id>, <message_type>, <value>Multiplayer server operation. Send a message with a single extra integer value to one of connected players.
Z24Multiplayer And Networking.396multiplayer_send_2_int_to_player<player_id>, <message_type>, <value>, <value>Same as (multiplayer_send_int_to_player), but two integer values are sent.
Z24Multiplayer And Networking.397multiplayer_send_3_int_to_player<player_id>, <message_type>, <value>, <value>, <value>Same as (multiplayer_send_int_to_player), but three integer values are sent.
Z24Multiplayer And Networking.398multiplayer_send_4_int_to_player<player_id>, <message_type>, <value>, <value>, <value>, <value>Same as (multiplayer_send_int_to_player), but four integer values are sent.
Z24Multiplayer And Networking.399multiplayer_send_string_to_player<player_id>, <message_type>, <string_id>Multiplayer server operation. Send a message with a string value to one of connected players.Player handling operations
Z24Multiplayer And Networking.400get_max_players<destination>Returns maximum possible number of connected players. Apparently always returns a constant value, however its return value can change as maximum increases with new patches.
Z24Multiplayer And Networking.402player_get_team_no<destination>, <player_id>Retrieves the team that the player belongs to.
Z24Multiplayer And Networking.403player_set_team_no<player_id>, <team_id>Assigns a player to the specified team.
Z24Multiplayer And Networking.404player_get_troop_id<destination>, <player_id>Retrieves player's selected troop reference.
Z24Multiplayer And Networking.405player_set_troop_id<player_id>, <troop_id>Assigns the selected troop reference to a player.
Z24Multiplayer And Networking.406player_get_agent_id<destination>, <player_id>Retrieves player's current agent reference. Returns a negative value if player has no agent.
Z24Multiplayer And Networking.1724agent_get_player_id<destination>, <agent_id>Retrieves player reference that is currently controlling the specified agent.
Z24Multiplayer And Networking.407player_get_gold<destination>, <player_id>Retrieves player's current gold amount.
Z24Multiplayer And Networking.408player_set_gold<player_id>, <value>, <max_value>Sets player's new gold amount and maximum allowed gold amount. Use 0 for <max_value> to remove gold limit.
Z24Multiplayer And Networking.409player_spawn_new_agent<player_id>, <entry_point>Spawns a new agent for the specified player. Essentially a combination of (spawn_agent) and (player_control_agent) operations.
Z24Multiplayer And Networking.410player_add_spawn_item<player_id>, <item_slot_no>, <item_id>Adds the specified item to the specified player. Will take effect after the next player_spawn_new_agent. Available item slots are: ek_item_0, ek_item_1, ek_item_2, ek_item_3, ek_head, ek_body, ek_foot, ek_gloves, ek_horse. Unsure if ek_food is used in multiplayer; Taken from header_items.py
Z24Multiplayer And Networking.411multiplayer_get_my_team<destination>Client operation. Retrieves player's currently selected team.
Z24Multiplayer And Networking.412multiplayer_get_my_troop<destination>Client operation. Retrieves player's currently selected troop.
Z24Multiplayer And Networking.413multiplayer_set_my_troop<destination>Client operation. Selects a new troop for the player.
Z24Multiplayer And Networking.414multiplayer_get_my_gold<destination>Client operation. Retrieves current player's gold amount.
Z24Multiplayer And Networking.415multiplayer_get_my_player<destination>Client operation. Retrieves current player's player_id reference.
Z24Multiplayer And Networking.420multiplayer_make_everyone_enemyUsed in deathmatch mode to make everyone hostile to all other agents.
Z24Multiplayer And Networking.421player_control_agent<player_id>, <agent_id>Server operation. Puts the agent under specified player's control. Operation will change agent's face code and banner to those of player.
Z24Multiplayer And Networking.422player_get_item_id<destination>, <player_id>, <item_slot_no>Server operation. Retrieves item that's currently equipped by specified player in <item_slot_no> equipment slot.
Z24Multiplayer And Networking.423player_get_banner_id<destination>, <player_id>Server operation. Retrieves banner_id reference used by the specified player. Note that in MP banners are enumerated starting from 0 (unlike single-player where they're enumeration depends on scene prop banners' reference range).
Z24Multiplayer And Networking.429player_set_is_admin<player_id>, <value>Server operation. Set the current player as admin (value = 1) or not (value = 0).
Z24Multiplayer And Networking.431player_get_score<destination>, <player_id>Gets the current score of the player.
Z24Multiplayer And Networking.432player_set_score<player_id>, <value>Sets the score of the player.
Z24Multiplayer And Networking.433player_get_kill_count<destination>, <player_id>Gets the current kill count of the player.
Z24Multiplayer And Networking.434player_set_kill_count<player_id>, <value>Sets the kill count of the player.
Z24Multiplayer And Networking.435player_get_death_count<destination>, <player_id>Gets the current death count of the player.
Z24Multiplayer And Networking.436player_set_death_count<player_id>, <value>Sets the death count of the player.
Z24Multiplayer And Networking.437player_get_ping<destination>, <player_id>Gets the current ping of the player.
Z24Multiplayer And Networking.439player_get_is_muted<destination>, <player_id>Checks if a player is currently muted (1) or not (0).
Z24Multiplayer And Networking.440player_set_is_muted<player_id>, <value>, [mute_for_everyone]Sets if a player gets muted (1) or unmuted (0). mute_for_everyone is an optional parameter and should be set to 1 if player is muted for everyone (this works only on server).
Z24Multiplayer And Networking.441player_get_unique_id<destination>, <player_id>), #can only bew used on server sideServer operation. Retrieves player's unique identifier which is determined by player's game license code. This number is supposed to be unique for each license, allowing reliable player identification across servers.
Z24Multiplayer And Networking.442player_get_gender<destination>, <player_id>Gets the current player gender/skin, in Native 0 for the male and 1 for the female skin. Take note that Native can only process two genders/skins in multiplayer.
Z24Multiplayer And Networking.459player_save_picked_up_items_for_next_spawn<player_id>Allows the player to keep the stuff he/she picked up during current round.
Z24Multiplayer And Networking.460player_get_value_of_original_items<destination>, <player_id>Official docs: this operation returns values of the items, but default troop items will be counted as zero (except horse)
Z24Multiplayer And Networking.350profile_get_banner_id<destination>Client operation. Retrieves banner_id reference used by the game for multiplayer. Note that in MP banners are enumerated starting from 0 (unlike single-player where they're enumeration depends on scene prop banners' reference range).
Z24Multiplayer And Networking.351profile_set_banner_id<value>Client operation. Assigns a new banner_id to be used for multiplayer. Note that in MP banners are enumerated starting from 0 (unlike single-player where they're enumeration depends on scene prop banners' reference range).Team handling operations
Z24Multiplayer And Networking.450team_get_bot_kill_count<destination>, <team_id>Gets the current kill count of the bots being part of the team.
Z24Multiplayer And Networking.451team_set_bot_kill_count<destination>, <team_id>Sets the kill count of the bots being part of the team.
Z24Multiplayer And Networking.452team_get_bot_death_count<destination>, <team_id>Gets the current death count of the bots being part of the team.
Z24Multiplayer And Networking.453team_set_bot_death_count<destination>, <team_id>Sets the death count of the bots being part of the team.
Z24Multiplayer And Networking.454team_get_kill_count<destination>, <team_id>Get the current kill count of the team.
Z24Multiplayer And Networking.455team_get_score<destination>, <team_id>Get the current score of the team.
Z24Multiplayer And Networking.456team_set_score<team_id>, <value>Set the current score of the team.
Z24Multiplayer And Networking.457team_set_faction<team_id>, <faction_id>Set the faction of the team.
Z24Multiplayer And Networking.458team_get_faction<destination>, <team_id>Gets the current faction of the team.General scene and mission handling operations
Z24Multiplayer And Networking.416multiplayer_clear_sceneRestarts the game mode from the beginning (respawns all players and the 3...2...1... countdown), removing all items on the ground.
Z24Multiplayer And Networking.425multiplayer_find_spawn_point<destination>, <team_no>, <examine_all_spawn_points>, <is_horseman>), set_spawn_effector_scene_prop_kind, set_spawn_effector_scene_prop_id - this two are used in capture the flag and similar game modes to make players of a certain team tend to spawn nearer to those scene props
Z24Multiplayer And Networking.426set_spawn_effector_scene_prop_kind<team_no>, <scene_prop_kind_no>Specifies some scene prop kind as one of the teams' spawn effector, making players of that team more likely to spawn closer to the specified effector prop instances. Use -1 to disable spawn effector for a team.
Z24Multiplayer And Networking.427set_spawn_effector_scene_prop_id<team_no>, <scene_prop_id>Specifies a single prop instance as a team's spawn effector. Different from (set_spawn_effector_scene_prop_kind) as other instances of the same scene prop will not affect player spawning.
Z24Multiplayer And Networking.470start_multiplayer_mission<mission_template_id>, <scene_id>, <started_manually>Administrative operations and settings
Z24Multiplayer And Networking.465kick_player<player_id>
Z24Multiplayer And Networking.466ban_player<player_id>, <value>, <player_id>Official docs: set value = 1 for banning temporarily, assign 2nd player id as the administrator player id if banning is permanentThose values are saved into a text file
Z24Multiplayer And Networking.467save_ban_info_of_player<player_id>
Z24Multiplayer And Networking.468ban_player_using_saved_ban_info
Z24Multiplayer And Networking.473server_add_message_to_log<string_id>server_get_renaming_server_allowed, server_get_changing_game_type_allowed - both of these get the values for dedicated servers which have commands to run on the console to (dis)allowing them
Z24Multiplayer And Networking.475server_get_renaming_server_allowed<destination>Official docs: 0-1
Z24Multiplayer And Networking.476server_get_changing_game_type_allowed<destination>Official docs: 0-1
Z24Multiplayer And Networking.478server_get_combat_speed<destination>Official docs: 0-2Gets the current combat speed at the server.
Z24Multiplayer And Networking.479server_set_combat_speed<value>Official docs: 0-2Unofficial: <value> is actually 0-4, going from slowest to fastest, you can see its use in module_presentations from 0 to 4Sets the combat speed at the server.
Z24Multiplayer And Networking.480server_get_friendly_fire<destination>Gets if friendly fire is enabled (1) or not (0).
Z24Multiplayer And Networking.481server_set_friendly_fire<value>Official docs: 0 = off, 1 = onSets if friendly fire is enabled (1) or not (0).
Z24Multiplayer And Networking.482server_get_control_block_dir<destination>Gets if control block direction at the server are 'automatic' (0) or 'by mouse movement' (1).
Z24Multiplayer And Networking.483server_set_control_block_dir<value>Official docs: 0 = automatic, 1 = by mouse movementSets if control block direction at the server are 'automatic' (0) or 'by mouse movement' (1).
Z24Multiplayer And Networking.484server_set_password<string_id>Sets the password for the server.
Z24Multiplayer And Networking.485server_get_add_to_game_servers_list<destination>Gets if server is added to game servers list (1) or not (0).
Z24Multiplayer And Networking.486server_set_add_to_game_servers_list<value>Sets if server is added to game servers list (1) or not (0).
Z24Multiplayer And Networking.487server_get_ghost_mode<destination>Gets if dead players are allowed to move their camera freely (0), sticked to any player (1), sticked to team members (2), sticked to team members' view (3).
Z24Multiplayer And Networking.488server_set_ghost_mode<value>Sets if dead players are allowed to move their camera freely (0), sticked to any player (1), sticked to team members (2), sticked to team members' view (3).
Z24Multiplayer And Networking.489server_set_name<string_id>Sets the name of the server.
Z24Multiplayer And Networking.490server_get_max_num_players<destination>Gets the maximum number of players allowed on the server.
Z24Multiplayer And Networking.491server_set_max_num_players<value>Sets the maximum number of players allowed on the server.
Z24Multiplayer And Networking.492server_set_welcome_message<string_id>Sets the welcome message which players can see when they join the server.
Z24Multiplayer And Networking.493server_get_melee_friendly_fire<destination>Gets if melee friendly fire is enabled (1) or not (0).
Z24Multiplayer And Networking.494server_set_melee_friendly_fire<value>Official docs: 0 = off, 1 = onSets if melee friendly fire is enabled (1) or not (0).
Z24Multiplayer And Networking.495server_get_friendly_fire_damage_self_ratio<destination>Gets the percentage of damage received by self when player hits a friend (0-100).
Z24Multiplayer And Networking.496server_set_friendly_fire_damage_self_ratio<value>Official docs: 0-100Sets the percentage of damage received by self when player hits a friend (0-100).
Z24Multiplayer And Networking.497server_get_friendly_fire_damage_friend_ratio<destination>Gets the percentage of damage received by friend when player hits a friend (0-100).
Z24Multiplayer And Networking.498server_set_friendly_fire_damage_friend_ratio<value>Official docs: 0-100Sets the percentage of damage received by friend when player hits a friend (0-100).
Z24Multiplayer And Networking.499server_get_anti_cheat<destination>Gets if valve anti cheat is enabled (1) or not (0).
Z24Multiplayer And Networking.477server_set_anti_cheat<value>Official docs: 0 = off, 1 = onSets if valve anti cheat is enabled (1) or not (0).
Z25Remaining Esoteric Stuff.58set_physics_delta_time<fixed_value>Default is 0.025 (40 fps). Was deprecated on VC.
Z25Remaining Esoteric Stuff.1130set_tooltip_text<string_id>Assigns the output text for the selected item?
Z25Remaining Esoteric Stuff.1805ai_mesh_face_group_show_hide<group_no>, <value>), # 1 for enable, 0 for disableDebug -- Draws the selected index of triangles/quads from the navigation graph on-screen.
Z25Remaining Esoteric Stuff.1305auto_set_meta_mission_at_end_commitedReturns the mission as successful by the game. Used in campaign.