• Reference
  • LUA API
  • Classes
  • Overview

Overview

Ability

Ability is one of the basic elements within the project and needs to be hooked up to a unit and released by the unit to produce a subsequent effect.

Functions

Ability triggers need to be included in a group to use group variables.

Events

Area

The Area is one of the base elements within the project that can be controlled against a fixed region, triggering the unit to enter and leave the region event.

Functions

Beam

You can create beam between units or points.

Functions

FunctionDescription
create_unit_to_pointCreate beam (from unit to point).
create_unit_to_unitCreate a beam (from unit to unit).
create_point_to_unitCreate a beam (from point to unit).
create_point_to_pointCreate a beam (from point to point).
remove_link_sfxDestroy a beam.
enable_link_sfx_showShow/hide a beam.
set_link_sfx_pointSet to point.
set_link_sfx_unit_socketSet to unit hookup point.

Camera

The camera is one of the basic elements within the project. The game camera is the tool that controls the player's point of view.

Functions

Destructible

Destructible is one of the basic elements in the project, which can be directly created on the map, generally immovable, and can interact with skills.

Functions

Destroyable triggers need to be contained in a group to use group variables.

Item

Item is one of the basic elements in a project, which can be placed on the map or held by units.

Functions

Item triggers need to be contained in a group to use group variables.

Events

EventDescription
Item createdItem creation event.
Item created as collectionItems are collected and created.
Item pick upItem acquisition event.
Item loseItem lost event.
Item usedItem use event.
Item in bagItem enters backpack event.
Item remove bagItem leaving inventory slot event.
Item in item barItem enters inventory event.
Item remove item barItem leaves inventory event.
Item stack changedItem change layer event.
Item charge changedItem change charge event.
Item destroyItem destruction event.

Item group

The item group can perform traversal operations on multiple items in the area.

Functions

FunctionDescription
get_all_items_in_shapesFilter all items in the range.

Light

Light Play Light is a tool that simulates real-world optical properties and can add realism and beauty to a game scene.

Functions

FunctionDescription
get_light_by_scene_idGet the Light according to the scene ID.
get_light_attributeGet the light attribute.
get_light_cast_shadow_stateGet whether the light casts a shadow.
create_point_light_at_pointCreate a point light to a point.
create_point_light_at_unit_socketCreate a point light to a unit socket.
create_directional_light_at_pointCreate directional light to point.
create_directional_light_at_unit_socketCreate a directional Light to a unit mount point.
remove_lightRemove light.
set_shadow_casting_statusSet whether the light casts shadows.
set_point_light_attributeSet the point light attribute.
set_directional_light_attributeSet the directional light attribute.

Modifier

Modifier is one of the basic elements in the project, which needs to be placed on the unit to produce the corresponding effect.

Functions

Magic effect triggers need to be contained in a group to use group variables.

Events

EventDescription
Gain modifierGet magic effect.
Lose modifierLost magic effect.
Period endsCycle expires.
Modifier stacks changeMagic effect layer change event.
About to gain modifierThe magic effect is about to be obtained.
Modifier overwrittenMagic effect override.

Particle

Particle implements various effects effects in the game, which can be created to be displayed on points, or units hanging on points.

Functions

FunctionDescription
create_at_pointCreate at point.
removeRemove.
create_at_unitCreate to unit.
set_rotational_angleSet the rotation angle.
set_orientationSet the orientation.
set_scaleSet the scaling.
set_heightSet the height.
set_coordinateSet the coordinates.
set_animation_speedSet the animation speed.
set_durationSet the duration.

Path

Path is one of the basic elements in a project, consisting of multiple point links that can be used as unit movement routes.

Functions

FunctionDescription
get_path_by_scene_idGet path by scene ID.
get_lua_path_from_pyCreate paths from py objects.
has_tagWhether the path has a tag or not.
remove_pathRemove path.
add_pointAdd a point to a path.
remove_pointRemove a point from a path.
add_tagAdds a tag to a path.
remove_tagRemove a tag from a path.
get_point_countGet the number of points in the path.
create_pathCreate a path starting with a point.

Players

The player is the main object within the project and can be played by either the user or the ai.

Functions

Player Group

Player Group can be filtered to store multiple players, and traverse the player group to perform uniform actions on the players in the player group.

Functions

FunctionDescription
add_playerAdd a player.
remove_playerRemove a player.
clear_groupClear the group.
get_player_numGet the number of players in a player group.
get_all_playersGet all players.
get_player_group_by_campAll players in the camp.
get_enemy_player_group_by_playerAll hostile players of the player.
get_ally_player_group_by_playerAll allied players of the player.
get_victorious_player_groupGet all the victorious players.
get_defeated_player_groupGet all defeated players.
get_neutral_player_groupAll non-neutral players.

Point

The point is one of the base elements within the project, and can be used as a prefabricated position, or a coordinate record.

Functions

FunctionDescription
get_point_by_scene_idGet area by scene ID.
get_lua_point_from_pyCreate points from py objects.
set_collisionSet the collision.
get_ground_collisionGet the collision type of the map at this point.
get_view_block_typeGets the view type of the map at the point's location.
get_point_xThe X coordinate of the point.
get_point_yThe Y coordinate of the point.
get_point_zThe Z coordinate of the point.
get_point_by_xyConvert coordinates to points.
get_point_offset_vectorPoint offset in the direction.
get_point_in_pathThe point in the path.

Projectile

Projectile is one of the basic elements in the project, which can be placed on the scene.

Functions

Projectile triggers need to be contained in a group to use group variables.

Events

EventDescription
Destructible createdDestructible creation.
Destructible revivedDestroyable resurrection.
Destructible diedDestructible death event.
Destructible collectedDestructibles are harvested.
Destructible resource changeChanges in the amount of destructible resources.
Destructible huntedDestructibles take damage.

Scene UI

The Scene UI is used in conjunction with the UI, which can be placed on a scene or unit pendant for display.

Functions

FunctionDescription
get_lua_scene_ui_from_pyGet the UI instance of the lua layer from the UI instance of the py layer.
create_scene_ui_at_player_unit_socketCreate a scene interface to a player unit mount point.
remove_scene_uiRemove the scene interface.
get_widget_in_scene_uiGet the controls in the scene UI
set_scene_ui_visible_distanceSet the visible distance of the scene interface to the player.

Selector

The selector selector can select multiple units in a certain area by specifying the shape and the corresponding selection rule.

Functions

FunctionDescription
get_units_in_circular_area
get_projectiles_in_circular_area

Timer

The timer is accurate to milliseconds. A callback function will be executed every time the timer expires.

Functions

FunctionDescription
get_elapsed_timeGet the elapsed time of the timer.
get_init_countGet the initial count of the timer.
get_remaining_timeGet the remaining time of the timer.
get_remaining_countGet the remaining count of the timer.
get_time_out_timeGet the time the timer was set for.

UI

UI is one of the basic elements in the project and one of the important ways for players to interact with the game.

Functions

UI Prefab

UI Prefab can be used in conjunction with UI, and multiple UI modules can be used.

Functions

FunctionDescription
get_lua_ui_prefab_from_pyGet the interface instance of lua layer from the interface instance of py layer.
create_ui_prefab_instanceCreate an interface module instance.
set_show_room_background_colorSet the background color of the interface model control.
remove_ui_prefabExample of removing an interface module.
get_ui_prefab_child_by_pathGet the controls under the interface module instance by the interface module path.

Unit

Unit is one of the basic elements in the project, skill and magic effect need to be attached to the unit to produce subsequent effects.

Functions

FunctionDescription
create_unitCreate unit.
remove_unitDelete unit.Deleting a unit will trigger a Unit Destroyed Event.
Teleport_to_PointMove unit to point instant. Units may get stuck in weird positions if the target point is not reachable.
set_unit_to_pointForce move unit to point. After smooth movement is checked, the unit will translate to the target point, forcing the movement to ignore restrictions such as collisions.
resurrect_unitResurrection unit to target point. Only units that have not been destroyed can be revived.
healsHeal the unit.
add_tagLabel an organization.
remove_tagRemove an organization's label.
add_stateAdd status to unit. The unit's status exists counted, that is, after being added twice, it needs to be removed twice before it can actually be removed.
remove_stateRemove the status of the unit. The unit's status exists counted, that is, after being added twice, it needs to be removed twice before it can actually be removed.
learns_abilityLet units learn skills. Learning requires skill points.
release_commandIssue orders to units.
set_orientationSet the orientation of the unit. The unit will slowly turn its face towards it during the turn time.
set_nameSet the name of the unit.
set_descriptionSet the description of the unit.
set_attributesSet the properties of the unit
increase_attributesAdd unit properties. Negative values decrease.
set_levelSet the level of the unit. Downgrading does not reclaim skill points.
increase_levelIncrease the level of the unit. Downgrading does not reclaim skill points.
set_expSet the unit's current experience.
increase_expAdd experience to units.
set_current_hpSet the unit's current health.
increase_current_hpIncrease the unit's current health.
set_current_mpSet the unit's current mana.
increase_current_mpIncrease the unit's current mana.
set_hero_ability_pointSet the number of skill points for a unit.
increase_hero_ability_pointAdd skill points to units.
set_unit_heightSet the flying height of the unit. After changing the altitude, the unit will slowly move past within the changing time.
set_life_cycleSet the lifecycle of the unit. After the life cycle runs out, the unit will die naturally.
set_pause_state_of_life_cycleSet a unit's lifecycle paused state.
set_alert_rangeSet the alert range of the unit.
set_cancel_alert_rangeSet the unit's disarm range.
set_unit_pkg_cntSet the number of slots in the unit's inventory slot.
set_unit_bar_cntSet the number of slots in the unit's inventory.
set_default_switch_behaviorSet the default behavior of units.
set_attr_growthSet the property growth of the unit.
set_unit_reward_expSet the experience value reward for the unit being killed.
set_unit_reward_resSet the attribute reward of the killed player.
set_attack_typeSet the unit's attack type.
set_armor_typeSet the armor type of the unit.
enable_afterimageTurn on afterimages of units.
disable_afterimageTurn off the afterimage of the unit.
set_afterimage_colorSet the afterimage color for units.
set_afterimage_timeSet the afterimage time for the unit.
set_unit_avatarSet unit avatar.
set_blood_bar_typeSet the unit's health bar style.
set_health_bar_displaySet the health bar display mode of the unit.
set_minimap_avatar_for_unitSet the unit minimap avatar.
set_minimap_avatar_for_enemy_unitSet the minimap portrait of the enemy unit.
set_model_scaleSet model scaling in units.
set_turning_speedSet the unit's turn speed.
replace_modelReplace model.
cancel_replace_modelCancel model replacement. Restore the unit's model to how it was originally.
set_semitransparency_when_hidden_unit_is_visibleSet whether to be translucent or not when invisible.
set_corpse_recyclable_status_after_fadingSet whether to recycle or not after the corpse disappears.
set_Xray_is_openSet perspective state.
add_tech_to_unitUnits add technology.
remove_tech_from_unitUnit delete technology.
research_techResearch technology.
play_animationplay animation.
stop_animationStop animation.
change_animationReplace animation.
cancel_change_animationCancel animation replacement.
clear_change_animationreset animation replacement
stop_cur_animationStop the currently playing animation.
set_animation_speedSet the animation playback rate.
add_itemAdd items to the store.
remove_itemRemove item from store.
set_item_stockSet the inventory of items in the store.
sell_item_to_shopSell items to shop.
purchase_item_from_shopPurchase items from the store.
remove_item_from_unitUnit removes items.
transfer_item_to_unitTransfer items.
add_item_to_unitUnit add items.
add_modifierAdd magic effects to units.
remove_modifier_typeUnit removal magic effect type.
delete_all_modifiers_by_effect_typeRemove magic effects that affect the type.
get_specified_modifier_typeGet the magic effect of the specified type for the unit.
get_recovery_interval_of_shop_goodsGet the stock interval of store items.
get_remaining_recovery_time_of_shop_goodsGet the remaining recovery time of a store item.
remove_abilities_in_typeRemove skills (specific types).
get_abilities_by_typeGet a specific type of skill.
add_abilityAdd skills.
remove_abilityRemove skill.
get_ability_by_typeFind skills by skill name.
get_ability_by_slotAcquiring the skill of a certain skill position.
get_item_by_slotGet the item in the unit's backpack slot.
get_all_itemsAll items in the unit.
kill_unitKill unit.
create_illusionCreate illusion.
unit_gains_techUnits gain technology.
change_unit_roleSet owning player.
get_tech_listTraversing research and development technology to do actions.
get_affect_techsTraversing applied technology doing actions.
get_shop_item_listIterate through the items in the store to perform actions.
get_current_unit_hpGet the current health value.
get_current_unit_mpGet the current mana.
get_attr_otherGet the property of the unit's extra property type.
get_attr_baseGet the property of the unit's base property type.
get_attr_base_ratioGet the attribute of the unit's basic attribute bonus type.
get_attr_bonusGet properties of unity gain property type.
get_attr_all_ratioGet the attribute of the unit's total attribute bonus type.
get_attr_bonus_ratioGet the attribute of the unit gain attribute bonus type.
get_unit_attribute_growthGet unit attribute growth.
get_life_cycle_of_unitGet unit lifecycle.
get_heightGet unit flight altitude.
get_unit_turning_speedGet unit turn speed.
get_unit_alert_rangeGet unit alert range.
get_unit_cancel_alert_rangeGet unit cancel alert range.
get_unit_collision_radiusGet the unit collision radius.
get_unit_resource_costGet unit construction resource consumption property.
get_player_attribute_gained_from_killing_unitGet the attribute of the player who was killed by the unit.
get_scaleGet the unit scale.
get_unit_selection_range_scaleGet unit selection circle zoom.
get_unit_xaxis_scaleGet the X-axis scaling of the unit.
get_unit_zaxis_scaleGet the Z-axis scaling of the unit.
get_unit_yaxis_scaleGet the Y-axis scaling of the unit.
get_shop_purchase_rangeGet the purchase scope of the store.
get_unit_levelGet unit level.
get_keyGet the unit type ID of the unit.
get_current_exp_of_unitGet the current experience value of the unit.
get_exp_required_for_current_upgradeGain the experience needed for the unit's current upgrade.
get_hero_ability_point_numberGet the hero's skill points.
get_unit_bag_slot_numberGet the number of slots in the unit's inventory.
get_unit_inventory_slot_numberGet the number of slots in the unit's inventory.
get_item_type_number_of_unitGet the number of item types owned by the unit.
get_exp_gained_from_killing_unitGet unit kill experience.
get_shield_value_of_specified_type_for_unitGet the shield value of the specified shield type for the unit.
get_shop_tab_numberGet the number of store tabs.
get_shop_item_stockGet the store's item inventory.
get_unit_nameGet unit name.
get_unit_descriptionGet the description of the unit.
get_unit_type_nameGet unit type name.
get_unit_type_descriptionGet the description of the unit type.
get_shop_tab_nameGet the store's page signature.
get_unit_subtypeGet unit classification.
get_image_of_unit_type_iconGet the avatar of the unit type.
get_unit_typeGet unit type.
last_unit_createdLast created unit.
get_unit_ownerGet the owner of the unit unit.
get_illusion_summonerGet the summoner of visions.
get_unit_orientationGet the orientation of the unit.
get_armor_typeGet armor type.
get_attack_typeGet attack type.
get_shop_goodsGet items from the store.
get_current_unit_modelGet the current model of the unit.
get_original_unit_modelGet the original model of the unit.
get_unit_location_pointGet the location of the unit.
get_nearest_reachable_point_to_unitGet the nearest passable point of the unit.
get_campGet unit's team.
has_tagWhether to have a label or not.
is_unit_aliveWhether to survive or not.
visibility_of_unitWhether it is visible or not.
is_unit_movingWhether the unit is moving or not.
is_in_radiusWhether it is near the unit or not.
unit_is_shopWhether the unit is a store or not.
is_unit_illusionWhether the unit is an illusion or not.
unit_in_groupWhether the unit is in the unit group or not.
is_in_battleWhether the unit is in combat or not.
has_buff_statusWhether the unit has a designated status or not.
check_has_ability_typeWhether the unit has a specific type of skill or not.
unit_has_itemWhether there are items or not.
unit_has_item_nameWhether there are items of the specified type or not.
unit_has_modifierWhether the unit has magic effect or not.
unit_has_modifier_styleWhether the unit has magic effects of the specified affect type or not.
unit_has_modifier_tagWhether the unit has the magic effects with specified tags or not.
check_unit_key_preconditionWhether the unit type precondition is passed or not.
is_enemy_relationWhether the unit is a hostile relationship or not.
can_teleport_toWhether the unit can be sent to the point or not.
unit_can_collide_with_pointWhether to collide with the point or not.
unit_can_from_point_to_pointWhether pathfinding is reachable or not.
get_unit_move_collisionWhether to have the specified collision type or not.
get_unit_playerGet the player the unit belongs to.

Unit triggers need to be included in a group to use group variables.

Events

Unit group

Unit Group allows you to put multiple units in a group for uniform processing.

Functions