Template:Op tableaus and heraldics

Tableaus and heraldics
Tableaus are the tool that gives you limited access to the game graphical renderer. If you know 3D graphics, you know that all 3D objects consist of a mesh (which defines it's form) and the material (which defines how this mesh is "painted"). With tableau functions you can do two things. First, you can replace or alter the materials used to render the game objects (with many restrictions). If this sounds esoteric to you, have a look at the game heraldry - it is implemented using tableaus. Second, you can render images of various game objects and place them on the game menus, presentations and so on. For example, if you open the game Inventory window, you can see your character in his current equipment. This character is rendered using tableau operations. Similarly, if you open the Notes screen and select some kingdom lord on the Troops section, you will see that lord's face and banner. Both face and banner are drawn using tableaus.

cur_item_set_tableau_material = 1981
 * (cur_item_set_tableu_material, , ),
 * Can only be used inside ti_on_init_item trigger in module_items.py. Assigns tableau to the item instance. Value of  will be passed to tableau code. Commonly used for heraldic armors and shields.

cur_scene_prop_set_tableau_material = 1982
 * (cur_scene_prop_set_tableau_material, , ),
 * 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  will be passed to tableau code. Commonly used for static banners.

cur_map_icon_set_tableau_material = 1983
 * (cur_map_icon_set_tableau_material, , ),
 * 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  will be passed to tableau code. Commonly used for player/lord party banners.

cur_agent_set_banner_tableau_material = 1986
 * (cur_agent_set_banner_tableau_material, ),
 * Can only be used inside ti_on_agent_spawn trigger in module_mission_templates. Assigns heraldry.

Operations used in module_tableau_materials.py module
cur_tableau_add_tableau_mesh = 1980
 * (cur_tableau_add_tableau_mesh, ,, ),
 * Used in module_tableau_materials.py to add one tableau to another. Value parameter is passed to tableau_material as is.

cur_tableau_render_as_alpha_mask = 1984
 * (cur_tableau_render_as_alpha_mask)
 * Tells the engine to treat the tableau as an alpha (transparency) mask.

cur_tableau_set_background_color = 1985
 * (cur_tableau_set_background_color, ),
 * Defines solid background color for the current tableau.

cur_tableau_set_ambient_light = 1987
 * (cur_tableau_set_ambient_light, , , ),
 * Not documented. Used for tableaus rendered from 3D objects to provide uniform tinted lighting.

cur_tableau_set_camera_position = 1988
 * (cur_tableau_set_camera_position, ),
 * Not documented. Used for tableaus rendered from 3D objects to position camera as necessary (usually with a perspective camera).

cur_tableau_set_camera_parameters = 1989
 * (cur_tableau_set_camera_parameters, , <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.

cur_tableau_add_point_light = 1990
 * (cur_tableau_add_point_light,, <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.

cur_tableau_add_sun_light = 1991
 * (cur_tableau_add_sun_light,, <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.

cur_tableau_add_mesh = 1992
 * (cur_tableau_add_mesh, <mesh_id>,, <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.

cur_tableau_add_mesh_with_vertex_color = 1993
 * (cur_tableau_add_mesh_with_vertex_color, <mesh_id>,, <value_fixed_point>, <value_fixed_point>, ),
 * 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.

cur_tableau_add_mesh_with_scale_and_vertex_color = 2000
 * (cur_tableau_add_mesh_with_scale_and_vertex_color, <mesh_id>,, <scale_position>, <value_fixed_point>, ),
 * 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.

cur_tableau_add_map_icon = 1994
 * (cur_tableau_add_map_icon, <map_icon_id>,, <value_fixed_point>),
 * Adds a rendered image of a map icon to current tableau. Last parameter is the scale factor for the model.

cur_tableau_add_troop = 1995
 * (cur_tableau_add_troop, <troop_id>,, <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).

cur_tableau_add_horse = 1996
 * (cur_tableau_add_horse, <item_id>,, <animation_id>),
 * Adds a rendered image of a horse in a specified animation to current tableau.

cur_tableau_set_override_flags = 1997
 * (cur_tableau_set_override_flags, ),
 * 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.

cur_tableau_clear_override_items = 1998
 * (cur_tableau_clear_override_items),
 * Removes and previously defined equipment overrides for the troop, allowing to start from scratch.

cur_tableau_add_override_item = 1999
 * (cur_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.