Util
Functions
remove_kv
Clear the key value of the instance.
Parameters
up.remove_kv(_ins, _value)
remove_unit_kv
Clear unit type key value.
Parameters
up.remove_unit_kv(_id, _value)
remove_item_kv
Clear item type key value.
Parameters
up.remove_item_kv(_id, _value)
remove_ability_kv
Clear skill type key.
Parameters
up.remove_ability_kv(_id, _value)
remove_prefab_kv
Clear destructible objects/technology/projections/magic effects/type key.
Parameters
up.remove_prefab_kv(_id, _value)
cleartag
Clear tags.
Parameter
create_random_pool
Create random pools.
set_weight_of_specified_number
Set random pool to specify integer weights.
Parameters
up.set_weight_of_specified_number(pool, number, weight)
remove_specified_number
Random pool to remove specified integers.
Parameters
up.remove_specified_number(pool, number)
pick_random_pool
Iterating over a random pool.
display_info_to_player
Tips to players.
Parameters
up.display_info_to_player(player, msg, is_language)
increase_weight_of_specified_number
Add specified integer weights to the random pool.
Parameters
up.create_weight_of_specified_number(pool, number, weight)
separate_string
Splitting an array of strings.
Parameters
up.separate_string(str_list, str1, str2)
get_camp_by_camp_id
Get a camp.
Parameter
up.get_camp_by_camp_id(id)
stringtobool
Convert string type to bool.
Parameter
set_cascaded_shadow_distance
Set shadow distance.
Parameter
up.set_cascaded_shadow_distance(_dis)
remove_timer
Delete timer.
Parameter
pause_timer
Pause timer.
Parameter
resume_timer
Resume timer.
Parameter
set_terrain_texture_at_a_specified_point
Set the terrain texture of a point.
Parameters
up.set_terrain_texture_at_a_specified_point(point, terrain_type_name, range, area_type_name)
replace_specified_terrain_texture_in_region
Replace the specified terrain texture in the area.
Parameters
up.replace_specified_terrain_texture_in_region(area, terrain_type_name, target_terrain_type_name)
set_region_weather
Set regional weather.
Parameters
up.set_region_weather(area, weather_name)
set_global_weather
Set global weather.
Parameter
up.set_global_weather(weather_name)
set_player_filter_effect
Set the player's filter effect.
Parameters
up.set_player_filter_effect(player, filter_name)
display_player_terrain_texture
Show/hide player ground textures.
Parameters
up.display_player_terrain_texture(player, is_visible)
enable_vignetting
Set dark corner switch.
Parameters
up.enable_vignetting(player, is_enable)
set_vignetting_size
Set dark corner size.
Parameters
up.set_vignetting_size(player, size)
set_vignetting_breathing_period
Set dark corner breathing cycle.
Parameters
up.set_vignetting_breathing_period(player, circle_time)
set_vignetting_changing_amplitude
Set the dark angle change range.
Parameters
up.set_vignetting_changing_amplitude(player, range)
set_vignetting_color
Set dark corner color.
Parameters
up.set_vignetting_color(player, red, green, blue, alpha)
set_fog_attribute
Set the fog effect properties.
Parameters
up.set_fog_attribute(fog, direction, pos_x, pos_y, pos_z, scale_x, scale_y, scale_z, red, green, blue, concentration, speed)
set_cascaded_shadow_distanc
Set shadow distance.
Parameter
up.set_cascaded_shadow_distanc(distance)
set_cascaded_shadow_enable
Switch cascade shading.
Parameter
up.set_cascaded_shadow_enable(is_enable)
set_post_effect
Switching the painting style for players.
Parameters
up.set_post_effect(player, processing_name)
set_table_value
Set the value of a one-dimensional table.
Parameters
up.set_table_value(table, value, key)
set_table_value_multi
Set the value of a multi-dimensional table.
Parameters
up.set_table_value_multi(table, value, key, field)
insert_table_value
Insert values into a table.
Parameters
up.insert_table_value(table, value, index)
remove_nth_table_value
Delete the N-th value of a one-dimensional table
Parameters
up.remove_nth_table_value(table, index)
pick_table
Traverse the table.
Parameter
pick_table_ordered
Traverse the table (order preserving).
Parameter
up.pick_table_ordered(table)
dump_table
Print the form.
Parameter
new_empty_table
Create an empty table.
Parameter
Return
copy_table
Copy the table.
Parameter
Return
pause_game
Pause the game.
start_new_round_of_game
Start a new round of game.
Parameter
up.start_new_round_of_game(is_quick_reset)
enable_soft_pause
Turn on soft pause.
resume_soft_pause
Resume soft pause.
set_damage_factor
Set damage factor.
Parameters
up.set_damage_factor(attack_type_name, armor_type_name, ratio)
set_compound_attributes
Set composite properties.
Parameters
up.set_compound_attributes(primary_attribute_name, secondary_attr_name, value)
set_game_time_elapsing_rate
Set the speed of the game time passing.
Parameter
up.set_game_time_elapsing_rate(speed)
set_game_time
Set game time.
Parameter
create_artificial_time
Create artificial time.
Parameters
up.create_artificial_time(time, dur)
set_random_seed
Set random number seed.
Parameter
toggle_time_elapsing_is_on
Switch time passing.
Parameter
up.toggle_time_elapsing_is_on(is_on)
toggle_target_point_grassland_is_on
Switch target point of grass.
Parameters
up.toggle_target_point_grassland_is_on(is_on, point)
clear
Empty.
Parameter
up.clear(player_or_unit_group)
play_screen_particle_for_a_set_duration
Create screen effects.
Parameters
up.play_screen_particle_for_a_set_duration(sfx_id, duration, player, is_on_fog)
set_variable
Set variables.
Parameters
up.set_variable(key, value, type)
play_sound_for_player
Playback sound.
Parameters
up.play_sound_for_player(player, sound, is_loop, fade_in_time, fade_out_time)
stop_sound_for_player
Stop playing sound.
Parameters
up.stop_sound_for_player(player, sound, is_immediately)
play_3d_sound_for_player
Play 3D sound.
Parameters
up.play_3d_sound_for_player(player, sound, point, height, fade_in_time, fade_out_time, is_make_sure_play, is_loop)
follow_object_play_3d_sound_for_player
Follow the unit to play the sound.
Parameters
up.follow_object_play_3d_sound_for_player(player, sound, unit, fade_in_time, fade_out_time, is_make_sure_play, is_loop)
set_sound_volume
Setting the sound volume.
Parameters
up.set_sound_volume(player, sound, value)
print_to_dialog
Print log.
Parameters
up.print_to_dialog(type, information)
test_show_message_tip
Display interface test information.
Parameters
up.test_show_message_tip(information, time)
test_log_message
Record API test logs (optional display).
Parameters
up.test_log_message(information, time, is_center)
get_icon_id
Get an image of the icon of the skill/buff/item/unit.
Parameter
get_obj_from_data
Get the contents of a data table.
Parameters
Return
cli.get_obj_from_data(data, string)
all_conditions_succeed
All conditions are valid.
Parameter
Return
up.all_conditions_succeed(conditions)
any_conditions_succeed
Either condition holds.
Parameter
Return
up.any_conditions_succeed(conditions)
all_conditions_failed
All conditions are not valid.
Parameter
Return
up.all_conditions_failed(conditions)
get_str_length
Get the length of the string.
Parameter
Return
pos_in_str
Index of the target character in the string.
Parameters
Return
up.pos_in_str(_str1, _str2)
get_tech_max_level
Get the maximum level of technology.
Parameter
Return
up.get_tech_max_level(_techid)
get_player_ui_pos_x
Get the player's mouse screen coordinates X.
Parameter
Return
up.get_player_ui_pos_x(_player)
get_player_ui_pos_y
Get the player's mouse screen coordinates Y.
Parameter
Return
up.get_player_ui_pos_y(_player)
get_player_pointing_pos
Get the player's mouse coordinates.
Parameter
Return
up.get_player_pointing_pos(_player)
get_instance_location_point.
Get the point where the projectile/item/unit/damageable object is located.
Parameter
Return
up.get_instance_location_point(_ins)
get_team
Get the team the player/unit is in.
Parameter
Return
str_to_unit_command_type
String to unit command type.
Parameter
Return
up.str_to_unit_command_type(_str)
str_to_point
String to dot.
Parameter
Return
str_to_ability_cast_type
String to skill release type.
Parameter
Return
up.str_to_ability_cast_type(_str)
str_to_link_sfx_key
String to link effects.
Parameter
Return
up.str_to_link_sfx_key(_str)
str_to_role_relation
String-to-player relationships.
Parameter
Return
up.str_to_role_relation(_str)
str_to_unit_type
String to unit classification.
Parameter
Return
up.str_to_unit_type(_str)
str_to_unit_key
String to unit type.
Parameter
Return
str_to_unit_name
String to unit property.
Parameter
Return
up.str_to_unit_name(_str)
str_to_item_key
String to item type.
Parameter
Return
str_to_role_res
String to player attributes.
Parameter
Return
str_to_role_status
String to player status.
Parameter
Return
up.str_to_role_status(_str)
str_to_role_type
String to player control status.
Parameter
Return
up.str_to_role_type(_str)
str_to_ability_key
String to skill type.
Parameter
Return
up.str_to_ability_key(_str)
str_to_ability_type
String to skill slot type.
Parameter
Return
up.str_to_ability_type(_str)
str_to_dest_key
String to destructible type.
Parameter
Return
str_to_project_key
String to projector type.
Parameter
Return
up.str_to_project_key(_str)
str_to_particle_sfx_key
String to effects.
Parameter
Return
up.str_to_particle_sfx_key(_str)
str_to_tech_key
String to technology type.
Parameter
Return
str_to_model_key
String to model type.
Parameter
Return
up.str_to_model_key(_str)
str_to_modifier_key
String to magic effect type.
Parameter
Return
up.str_to_modifier_key(_str)
str_to_modifier_effect_type
String to magic effect effect type.
Parameter
Return
up.str_to_modifier_effect_type(_str)
str_to_modifier_type
String to magic effect category.
Parameter
Return
up.str_to_modifier_type(_str)
str_to_camp
String to camp.
Parameter
Return
str_to_keyboard_key
String to keyboard keys.
Parameter
Return
up.str_to_keyboard_key(_str)
str_to_mouse_key
String to mouse button conversion.
Parameter
Return
up.str_to_mouse_key(_str)
str_to_mouse_wheel
String to mouse wheel.
Parameter
Return
up.str_to_mouse_wheel(_str)
str_to_store_key
String to platform prop type.
Parameter
Return
up.str_to_store_key(_str)
str_to_damage_type
String to harm type.
Parameter
Return
up.str_to_damage_type(_str)
str_to_unit_attr_type
String to unit attribute type.
Parameter
Return
up.str_to_unit_attr_type(_str)
str_to_audio_key
String to sound type.
Parameter
Return
up.str_to_audio_key(_str)
get_icon_id
Get an image based on its ID.
Parameter
Return
move_to_pos
Move to a position.
Parameters
Return
up.move_to_pos(point, range)
stop
Stop.
Return
garrison
Stationed at a target point.
Parameter
Return
attack_move
Attack movement.
Parameters
Return
up.attack_move(point, range)
attack_target
Target of attack.
Parameters
Return
up.attack_target(unit, range)
move_along_path
Move along the path.
Parameters
Return
up.move_along_path(path, patrol_mode_name, is_attack, nearby_start_point, is_deviate_return)
cast_ability
Release skills.
Parameters
Return
up.cast_ability(ability, point1, point2, point3, unit, item, dest)
pick_up_item
Pick up items.
Parameter
Return
discard_item
Discarded items.
Parameters
Return
up.discard_item(item, point)
give_item
Give items.
Parameters
Return
use_item
Use of items
Parameters
Return
up.use_item(item, point1, point2, point3, unit, target_item, dest)
follow
Follow a unit.
Parameter
Return
empty
Empty command.
Return
table_length
Length of table.
Parameter
Return
get_max_tech_level
Get the maximum level of technology.
Parameter
Return
up.get_max_tech_level(tech_id)
get_tech_icon
Get the icon of the technology.
Parameters
Return
up.get_tech_icon(tech_id, index)
get_tech_type_from_event
Get the type of technology in the event.
Return
up.get_tech_type_from_event()
get_tech_type_description
Get the description of the type of technology.
Parameter
Return
up.get_tech_type_description(tech_id)
get_tech_type_name
Get the name of the technology type.
Parameter
Return
up.get_tech_type_name(tech_id)
get_current_game_mode
Get the current game mode.
Return
up.get_current_game_mode()
get_local_language_environment
Get local language environment.
Return
up.get_local_language_environment()
current_game_run_time
Time the game has been running.
Return
up.current_game_run_time()
get_current_game_time
Get the current time of the game.
Return
up.get_current_game_time()
get_damage_factor
Get damage factor.
Parameters
Return
up.get_damage_factor(attack_type_name, area_type_name)
get_coefficient
Get the slave coefficients of the 3D attributes.
Parameters
Return
up.get_coefficient(primary_attribute_name, secondary_attr_name)
get_game_environment_of_current_round
Acquire the game environment of the council.
Return
up.get_game_environment_of_current_round()
get_global_archive
Get global archive.
Parameter
Return
up.get_global_archive(name)
get_archive_rank_player_archive_value
Get integer archive leaderboard player archive values.
Parameters
Return
up.get_archive_rank_player_archive_value(file, index)
if_pri_attr_state_open
Whether to open the three-dimensional properties or not.
Return
up.if_pri_attr_state_open()
get_mover_bound_projectiles.
Obtain the motile binding projection.
Return
up.get_mover_bound_projectiles()
get_tech_changed_level
Get the level of technological change.
Parameter
Return
up.get_tech_changed_level(data)
trigger_modifier
Trigger magic effect.
Parameter
Return
up.trigger_modifier(data)
tech_researched
Technology being studied.
Return
get_unit_in_event
Get the units in the event.
Parameter
Return
up.get_unit_in_event(data)
modifier_receiver
Magic effect carriers.
Parameter
Return
up.modifier_receiver(data)
get_ability_owner
Acquisition of skill owners.
Parameter
Return
up.get_ability_owner(ability)
modifier_provider
Magic effect applicator.
Parameter
Return
up.modifier_provider(modifier)
ability_selected_target_item
Target item selected by the skill.
Parameters
Return
up.ability_selected_target_item(ability, data)
picked_modifier
Traversing to the magic effect.
Return
player_that_triggered_current_event
The player who triggered the current event.
Parameter
Return
up.player_that_triggered_current_event(data)
projectile_that_triggered_current_event
The projection that triggered the current event.
Parameter
Return
up.projectile_that_triggered_current_event(data)
ability_selected_target_unit
Get the unit selected by the skill.
Parameters
Return
up.ability_selected_target_unit(ability, data)
get_modifier_stack_changed_value
Get the value of the change in the number of layers of magic effects.
Parameter
Return
up.get_modifier_stack_changed_value(data)
tech_upgraded_or_downgraded
Technology for level up and down.
Return
up.tech_upgraded_or_downgraded()
item_selected_in_picking_item_group
Selected items when traversing the item group.
Return
up.item_selected_in_picking_item_group()
level_changed_tech
Grade change technology.
Return
get_damage_or_healing_target_unit
Get units that take damage (healing).
Parameter
Return
up.get_damage_or_healing_target_unit(data)
picked_unit_in_unit_group
Get the units traversed in the unit group.
Return
up.picked_unit_in_unit_group()
get_killer_unit
Get the killer unit.
Parameter
Return
get_picked_projectile
Get the traversed projection.
Return
up.get_picked_projectile()
get_dead_unit
Obtain death units.
Parameter
Return
Get_Damage_or_Healing_Source_Unit
Get units that apply damage (healing).
Parameter
Return
up.Get_Damage_or_Healing_Source_Unit(data)
unit_to_gain_item
Obtain item units.
Return
unit_to_lose_item
Loss of item unit.
Return
unit_to_use_item
Use of item units.
Return
unit_to_change_stacks
Holders of stacked layer change items.
Return
up.unit_to_change_stacks()
get_unit_about_to_gain_modifier
Obtain a unit that is about to acquire a magic effect.
Parameter
Return
up.get_unit_about_to_gain_modifier(modifier)
last_unit_to_make_purchase
The last unit to perform the purchase operation.
Return
up.last_unit_to_make_purchase()
last_unit_to_make_sale
The last unit to be sold.
Return
up.last_unit_to_make_sale()
get_current_array_index
Get the current array index.
Parameter
Return
up.get_current_array_index(data)
ability_that_triggered_current_event
Skills that trigger the current event.
Parameter
Return
up.ability_that_triggered_current_event(data)
ability_selected_destructible
The target selected by the skill can destroy the object.
Parameters
Return
up.ability_selected_destructible(ability, data)
destructible_in_event
Destructible objects in the event.
Parameter
Return
up.destructible_in_event(data)
damage_value_that_triggered_current_event
The value of the damage that triggered the current event.
Parameter
Return
up.damage_value_that_triggered_current_event(data)
item_that_triggered_current_event
The item that triggered the current event.
Parameter
Return
up.item_that_triggered_current_event(data)
unit_gains_item
Unit that acquires items.
Return
unit_loses_item
Unit that loses items.
Return
unit_uses_item
Unit that uses items.
Return
item_whose_stack_changed
Stacking layer change items.
Return
up.item_whose_stack_changed()
item_whose_charge_changed
Charge change items.
Return
up.item_whose_charge_changed()
item_purchased
Purchased items.
Return
item_sold
Items for sale.
Return
selected_location_by_ability
Skill selection to the point.
Return
up.selected_location_by_ability(ability, data)
string_in_event
Strings in events.
Return
mover_collision_unit
Exerciser collision unit.
Return value
up.mover_collision_unit()
get_unit_in_destructible_event
Get units in a destructible event.
Parameter
Return
up.get_unit_in_destructible_event(data)
get_current_damage_type
Get the current damage type.
Parameter
Return
up.get_current_damage_type(data)
player_resource_type_involved_in_the_event
Types of player resources in the event.
Parameter
Return
up.player_resource_type_involved_in_the_event(data)
unit_group_involved_in_the_event
Unit groups in events.
Parameter
Return
up.unit_group_involved_in_the_event(data)
current_purchasable
Current platform props.
Parameter
Return
up.current_purchasable(data)
convert_float_to_angle
Real number to angle.
Parameter
Return
up.convert_float_to_angle(value)
convert_angle_to_float
Angle to real number.
Parameter
Return
up.convert_angle_to_float(value)
get_ability_cast_direction
Get skill release directions.
Parameters
Return
up.get_ability_cast_direction(ability, data)
unit_in_destroy_destructible_event
Units in destructible mortality events.
Parameter
Return
up.unit_in_destroy_destructible_event(data)
unit_in_destructible_is_damaged_event
Units in vandalizable injury incidents.
Parameter
Return value
up.unit_in_destructible_is_damaged_event(data)
unit_in_destructible_is_gathered_event
Destructible objects are collected in the event of the unit.
Parameter
Return value
up.unit_in_destructible_is_gathered_event(data)
resource_change_value_in_destructible_event
Value of resource change in destructible events.
Parameter
Return value
up.resource_change_value_in_destructible_event(data)
ability_in_destructible_event
Skill objects in destructible events.
Parameter
Return
up.ability_in_destructible_event(data)
number_of_player_attributes_gathered_in_destructible_event
Number of player attributes collected in a destructible event.
Parameter
Return
up.number_of_player_attributes_gathered_in_destructible_event(data)
damage_value_in_destructible_event
Damage value in destructible events.
Parameter
Return
up.damage_value_in_destructible_event(data)
get_ability_by_unit_and_seq
Get skills in events.
Parameter
Return
up.get_ability_by_unit_and_seq(data)
get_build_unit
Get the build unit in the event.
Parameter
Return value
get_healing_value_before_settlement
Get the value of this treatment (before settlement).
Parameter
Return value
up.get_healing_value_before_settlement(data)
get_mover_bound_units
Get the kinematic binding unit.
Parameter
Return value
up.get_mover_bound_units(data)
all_units_belonging_to_specified_player
All units belonging to a player.
Parameter
Return
up.all_units_belonging_to_specified_player(player)
unit_of_a_specified_unit_type
Specify the unit type of the unit.
Parameter
Return
up.unit_of_a_specified_unit_type(unit_id)
number_random_units_from_unit_group
Random integer number of units in the unit group.
Parameters
Return
up.number_random_units_from_unit_group(unit_group, index)
number_of_units_in_unit_group
Get the number of units in the unit group.
Parameter
Return
up.number_of_units_in_unit_group(unit_group)
get_number_of_units_of_specified_type_in_unit_group
Number of unit types in the unit group.
Parameters
Return
up.get_number_of_units_of_specified_type_in_unit_group(unit_group, unit_id)
get_the_first_unit_in_a_unit_group
Get the first unit in the unit group.
Parameter
Return value
up.get_the_first_unit_in_a_unit_group(unit_group)
get_random_unit_from_unit_group
Get a random unit in the unit group.
Parameter
Return value
up.get_random_unit_from_unit_group(unit_group)
get_last_unit_in_unit_group
Get the last unit in the unit group.
Parameter
Return value
up.get_last_unit_in_unit_group(unit_group)
get_object_from_data
Obtaining objects from data.
Parameters
Return
up.get_object_from_data(data, name)
is_point_in_area
Is the point in the area.
Parameters
Return
up.is_point_in_area(point, area)
string_to_bool
String to boolean.
Parameter
Return
cli.string_to_bool(value)
get_global_weather
Get global weather.
Return
player_keyboard_key_is_pressed
Whether the player keyboard keys are pressed.
Parameters
Return
up.player_keyboard_key_is_pressed(player, key)
player_mouse_key_is_pressed
Whether the player mouse is pressed.
Parameters
Return
up.player_mouse_key_is_pressed(player, key)
check_tech_key_precondition
Check the technology type pre-requisites.
Parameters
Return
up.check_tech_key_precondition(player, tech_type)
joint_string.
String splicing.
Parameters
Return
up.joint_string(str1, str2)
extract_string
Intercept string.
Parameters
Return
up.extract_string(str, start_pos, end_pos)
delete_sub_string
Delete substring.
Parameters
Return
up.delete_sub_string(str, _sub_str, is_once)
get_text_config
Get multilingual content.
Parameter
Return value
get_random_pool_probability
Get the weight probability of the specified integer in the random pool.
Parameters
Return value
up.get_random_pool_probability(pool, value)
get_int_value_from_random_pool
Get a random integer from a random pool.
Parameter
Return
up.get_int_value_from_random_pool(pool)
get_random_pool_all_weight
Get the total weight of the random pool.
Parameter
Return value
up.get_random_pool_all_weight(pool)
get_random_pool_size
Get the number of integers in the random pool.
Parameter
Return
up.get_random_pool_size(pool)
get_random_pool_pointed_weight
Get the weight of the specified integer in the random pool.
Parameters
Return
up.get_random_pool_pointed_weight(pool, value)
get_point_ground_height
Get the layer of the map at the point location.
Parameter
Return
up.get_point_ground_height(point)
get_random_seed
Get random seeds.
Return
get_game_init_time_stamp
Get the game start time stamp.
Return
up.get_game_init_time_stamp()
get_game_x_resolution
Get initialized horizontal resolution.
Return
up.get_game_x_resolution()
get_game_y_resolution
Get initialized vertical resolution.
Return
up.get_game_y_resolution()
get_graphics_quality
Get initialized game picture quality.
Return
up.get_graphics_quality()
get_window_mode
Get the initialization window category.
Return