On This Page

  • Reference
  • LUA API
  • Global
  • Util

Util

Functions

remove_kv

Clear the key value of the instance.

Parameters

VariableTypeDescription
_instableInstances.
_valuestrKey-value name.
up.remove_kv(_ins, _value)

remove_unit_kv

Clear unit type key value.

Parameters

VariableTypeDescription
_idnumberUnit type ID.
_valuestrKey-value name.
up.remove_unit_kv(_id, _value)

remove_item_kv

Clear item type key value.

Parameters

VariableTypeDescription
_idnumberItem type ID.
_valuestrKey-value name.
up.remove_item_kv(_id, _value)

remove_ability_kv

Clear skill type key.

Parameters

VariableTypeDescription
_idnumberSkill type ID.
_valuestrKey-value name.
up.remove_ability_kv(_id, _value)

remove_prefab_kv

Clear destructible objects/technology/projections/magic effects/type key.

Parameters

VariableTypeDescription
_idnumberSkill type ID.
_valuestrKey-value name.
up.remove_prefab_kv(_id, _value)

cleartag

Clear tags.

Parameter

VariableTypeDescription
_objtableObject.
up.clearartag(_obj)

create_random_pool

Create random pools.

up.create_random_pool()

set_weight_of_specified_number

Set random pool to specify integer weights.

Parameters

VariableTypeDescription
pooltableRandom pool.
numbernumberSpecified integer.
weightnumberWeight.
up.set_weight_of_specified_number(pool, number, weight)

remove_specified_number

Random pool to remove specified integers.

Parameters

VariableTypeDescription
pooltableRandom pool.
numbernumberSpecified integer.
up.remove_specified_number(pool, number)

pick_random_pool

Iterating over a random pool.

up.pick_random_pool()

display_info_to_player

Tips to players.

Parameters

VariableTypeDescription
playerplayerTarget player.
msgstrContent.
is_languageboolWhether multiple languages are required.
up.display_info_to_player(player, msg, is_language)

increase_weight_of_specified_number

Add specified integer weights to the random pool.

Parameters

VariableTypeDescription
pooltableRandom pool.
numbernumberSpecified integer.
weightnumberWeight.
up.create_weight_of_specified_number(pool, number, weight)

separate_string

Splitting an array of strings.

Parameters

VariableTypeDescription
str_listarrayAn array of strings.
str1strOriginal string.
str2strSeparator.
up.separate_string(str_list, str1, str2)

get_camp_by_camp_id

Get a camp.

Parameter

VariableTypeDescription
idnumberCamp ID.
up.get_camp_by_camp_id(id)

stringtobool

Convert string type to bool.

Parameter

VariableTypeDescription
_strstrString.
up.stringtobool(_str)

set_cascaded_shadow_distance

Set shadow distance.

Parameter

VariableTypeDescription
_disnumberShaded distance.
up.set_cascaded_shadow_distance(_dis)

remove_timer

Delete timer.

Parameter

VariableTypeDescription
timertimerTimer.
up.remove_timer(timer)

pause_timer

Pause timer.

Parameter

VariableTypeDescription
timertimerTimer.
up.pause_timer(timer)

resume_timer

Resume timer.

Parameter

VariableTypeDescription
timertimerTimer.
up.resume_timer(timer)

set_terrain_texture_at_a_specified_point

Set the terrain texture of a point.

Parameters

VariableTypeDescription
pointpointTarget point.
terrain_type_namestrTexture.
rangenumberRange.
area_type_namestrShape.
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

VariableTypeDescription
areaareaTarget area.
terrain_type_namestrInitial texture.
target_terrain_type_namestrReplace texture.
up.replace_specified_terrain_texture_in_region(area, terrain_type_name, target_terrain_type_name)

set_region_weather

Set regional weather.

Parameters

VariableTypeDescription
areaareaRegion.
weather_namestrWeather.
up.set_region_weather(area, weather_name)

set_global_weather

Set global weather.

Parameter

VariableTypeDescription
weather_namestrWeather.
up.set_global_weather(weather_name)

set_player_filter_effect

Set the player's filter effect.

Parameters

VariableTypeDescription
playerplayerPlayer.
filter_namestrFilter.
up.set_player_filter_effect(player, filter_name)

display_player_terrain_texture

Show/hide player ground textures.

Parameters

VariableTypeDescription
playerplayerPlayer.
is_visibleboolShow/hide.
up.display_player_terrain_texture(player, is_visible)

enable_vignetting

Set dark corner switch.

Parameters

VariableTypeDescription
playerplayerPlayer.
is_enableboolSwitch.
up.enable_vignetting(player, is_enable)

set_vignetting_size

Set dark corner size.

Parameters

VariableTypeDescription
playerplayerPlayer.
sizenumberDark corner size.
up.set_vignetting_size(player, size)

set_vignetting_breathing_period

Set dark corner breathing cycle.

Parameters

VariableTypeDescription
playerplayerPlayer.
circle_timenumberCycle time.
up.set_vignetting_breathing_period(player, circle_time)

set_vignetting_changing_amplitude

Set the dark angle change range.

Parameters

VariableTypeDescription
playerplayerPlayer.
rangenumberRange of change.
up.set_vignetting_changing_amplitude(player, range)

set_vignetting_color

Set dark corner color.

Parameters

VariableTypeDescription
playerplayerPlayer.
rednumberRed.
greennumberGreen.
bluenumberBlue.
alphanumberOpacity.
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

VariableTypeDescription
distancenumberShaded distance.
up.set_cascaded_shadow_distanc(distance)

set_cascaded_shadow_enable

Switch cascade shading.

Parameter

VariableTypeDescription
is_enableboolSwitch.
up.set_cascaded_shadow_enable(is_enable)

set_post_effect

Switching the painting style for players.

Parameters

VariableTypeDescription
playerplayerPlayer.
processing_namestrPainting style.
up.set_post_effect(player, processing_name)

set_table_value

Set the value of a one-dimensional table.

Parameters

VariableTypeDescription
tabletableTable.
valuestrValue.
keystrPrimary key.
up.set_table_value(table, value, key)

set_table_value_multi

Set the value of a multi-dimensional table.

Parameters

VariableTypeDescription
tabletableTable.
valuestrValue.
keystrPrimary key.
fieldstrKey value.
up.set_table_value_multi(table, value, key, field)

insert_table_value

Insert values into a table.

Parameters

VariableTypeDescription
tabletableTable.
valuestrValue.
indexnumberInsert position.
up.insert_table_value(table, value, index)

remove_nth_table_value

Delete the N-th value of a one-dimensional table

Parameters

VariableTypeDescription
tabletableTable.
indexnumberLocation.
up.remove_nth_table_value(table, index)

pick_table

Traverse the table.

Parameter

VariableTypeDescription
tabletableTable.
up.pick_table(table)

pick_table_ordered

Traverse the table (order preserving).

Parameter

VariableTypeDescription
tabletableTable.
up.pick_table_ordered(table)

dump_table

Print the form.

Parameter

VariableTypeDescription
tabletableTable.
up.dump_table(table)

new_empty_table

Create an empty table.

Parameter

VariableTypeDescription
tabletableTable.

Return

TypeDescription
tableTable.
up.new_empty_table()

copy_table

Copy the table.

Parameter

VariableTypeDescription
tabletableTable.

Return

TypeDescription
tableTable.
up.copy_table(table)

pause_game

Pause the game.

up.pause_game()

start_new_round_of_game

Start a new round of game.

Parameter

VariableTypeDescription
is_quick_resetboolQuick reset.
up.start_new_round_of_game(is_quick_reset)

enable_soft_pause

Turn on soft pause.

up.enable_soft_pause()

resume_soft_pause

Resume soft pause.

up.resume_soft_pause()

set_damage_factor

Set damage factor.

Parameters

VariableTypeDescription
attack_type_namestrType of attack.
armor_type_namestrArmor type.
rationumberCoefficient.
up.set_damage_factor(attack_type_name, armor_type_name, ratio)

set_compound_attributes

Set composite properties.

Parameters

VariableTypeDescription
primary_attribute_namestrPrimary attribute.
secondary_attr_namestrSecondary attribute.
valuenumberCoefficient.
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

VariableTypeDescription
speednumberSpeed at which the game time passes.
up.set_game_time_elapsing_rate(speed)

set_game_time

Set game time.

Parameter

VariableTypeDescription
timenumberGame time.
up.set_game_time(time)

create_artificial_time

Create artificial time.

Parameters

VariableTypeDescription
timenumberTime.
durnumberDuration.
up.create_artificial_time(time, dur)

set_random_seed

Set random number seed.

Parameter

VariableTypeDescription
seednumberSeed.
up.set_random_seed(seed)

toggle_time_elapsing_is_on

Switch time passing.

Parameter

VariableTypeDescription
is_onboolSwitch.
up.toggle_time_elapsing_is_on(is_on)

toggle_target_point_grassland_is_on

Switch target point of grass.

Parameters

VariableTypeDescription
is_onboolSwitch.
pointpointTarget point.
up.toggle_target_point_grassland_is_on(is_on, point)

clear

Empty.

Parameter

VariableTypeDescription
player_or_unit_groupunit_group/player_groupUnit group or player group.
up.clear(player_or_unit_group)

play_screen_particle_for_a_set_duration

Create screen effects.

Parameters

VariableTypeDescription
sfx_idnumberSpecial effect type ID.
durationnumberDuration.
playerplayerVisible player.
is_on_fogboolWhether it will be affected by war shadows.
up.play_screen_particle_for_a_set_duration(sfx_id, duration, player, is_on_fog)

set_variable

Set variables.

Parameters

VariableTypeDescription
keystrVariable name.
valuestrVariable value.
typestrVariable type.
up.set_variable(key, value, type)

play_sound_for_player

Playback sound.

Parameters

VariableTypeDescription
playerplayerPlayer.
soundsoundSound.
is_loopboolWhether to loop or not.
fade_in_timenumberFade in time.
fade_out_timenumberFade out time.
up.play_sound_for_player(player, sound, is_loop, fade_in_time, fade_out_time)

stop_sound_for_player

Stop playing sound.

Parameters

VariableTypeDescription
playerplayerPlayer.
soundsoundSound.
is_immediatelyboolStop immediately.
up.stop_sound_for_player(player, sound, is_immediately)

play_3d_sound_for_player

Play 3D sound.

Parameters

VariableTypeDescription
playerplayerPlayer.
soundsoundSound.
pointpointPlay position.
heightnumberHeight.
fade_in_timenumberFade in time.
fade_out_timenumberFade out time.
is_make_sure_playboolMust play.
is_loopboolWhether to loop or not.
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

VariableTypeDescription
playerplayerPlayer.
soundsoundSound.
unitunitFollow unit.
fade_in_timenumberFade in time.
fade_out_timenumberFade out time.
is_make_sure_playboolMust play.
is_loopboolWhether to loop or not.
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

VariableTypeDescription
playerplayerPlayer.
soundsoundSound.
valuenumberVolume.
up.set_sound_volume(player, sound, value)

print_to_dialog

Print log.

Parameters

VariableTypeDescription
typenumberMessage type.
informationstrLog content.
up.print_to_dialog(type, information)

test_show_message_tip

Display interface test information.

Parameters

VariableTypeDescription
informationstrLog content.
timenumberDuration.
up.test_show_message_tip(information, time)

test_log_message

Record API test logs (optional display).

Parameters

VariableTypeDescription
informationstrLog content.
timenumberDuration.
is_centerboolWhether to center the display.
up.test_log_message(information, time, is_center)

get_icon_id

Get an image of the icon of the skill/buff/item/unit.

Parameter

VariableTypeDescription
objobjectObject.
up.get_icon_id(obj)

get_obj_from_data

Get the contents of a data table.

Parameters

VariableTypeDescription
datatableData table.
stringstrContent name.

Return

TypeDescription
tableContents of the table.
  cli.get_obj_from_data(data, string)

all_conditions_succeed

All conditions are valid.

Parameter

VariableTypeDescription
conditionstableList of conditions.

Return

TypeDescription
boolFinal result.
up.all_conditions_succeed(conditions)

any_conditions_succeed

Either condition holds.

Parameter

VariableTypeDescription
conditionstableList of conditions.

Return

TypeDescription
boolFinal result.
up.any_conditions_succeed(conditions)

all_conditions_failed

All conditions are not valid.

Parameter

VariableTypeDescription
conditionstableList of conditions.

Return

TypeDescription
boolFinal result.
up.all_conditions_failed(conditions)

get_str_length

Get the length of the string.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberLength of the string.
up.get_str_length(_str)

pos_in_str

Index of the target character in the string.

Parameters

VariableTypeDescription
_str1strFind string.
_str2strTarget string.

Return

TypeDescription
number
up.pos_in_str(_str1, _str2)

get_tech_max_level

Get the maximum level of technology.

Parameter

VariableTypeDescription
_techidnumberTechnology ID.

Return

TypeDescription
numberMaximum level.
up.get_tech_max_level(_techid)

get_player_ui_pos_x

Get the player's mouse screen coordinates X.

Parameter

VariableTypeDescription
_playerplayerPlayer.

Return

TypeDescription
numberX coordinate.
up.get_player_ui_pos_x(_player)

get_player_ui_pos_y

Get the player's mouse screen coordinates Y.

Parameter

VariableTypeDescription
_playerplayerPlayer.

Return

TypeDescription
numberY coordinate.
up.get_player_ui_pos_y(_player)

get_player_pointing_pos

Get the player's mouse coordinates.

Parameter

VariableTypeDescription
_playerplayerPlayer.

Return

TypeDescription
pointPoint.
up.get_player_pointing_pos(_player)

get_instance_location_point.

Get the point where the projectile/item/unit/damageable object is located.

Parameter

VariableTypeDescription
_instableInstances.

Return

TypeDescription
pointPoint.
up.get_instance_location_point(_ins)

get_team

Get the team the player/unit is in.

Parameter

VariableTypeDescription
_argtablePlayer/unit.

Return

TypeDescription
numberTeam ID.
up.get_team(_arg)

str_to_unit_command_type

String to unit command type.

Parameter

VariableTypeDescription
_strstrPlayer / unit.

Return

TypeDescription
numberCommand type.
up.str_to_unit_command_type(_str)

str_to_point

String to dot.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
point
up.str_to_point(_str)

str_to_ability_cast_type

String to skill release type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberSkill release type.
up.str_to_ability_cast_type(_str)

str_to_link_sfx_key

String to link effects.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberLink effects ID.
up.str_to_link_sfx_key(_str)

str_to_role_relation

String-to-player relationships.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberPlayer relationship.
up.str_to_role_relation(_str)

str_to_unit_type

String to unit classification.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberUnit classification.
up.str_to_unit_type(_str)

str_to_unit_key

String to unit type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberUnit type.
up.str_to_unit_key(_str)

str_to_unit_name

String to unit property.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberUnit attribute.
up.str_to_unit_name(_str)

str_to_item_key

String to item type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberItem type ID.
up.str_to_item_key(_str)

str_to_role_res

String to player attributes.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberPlayer attributes.
up.str_to_role_res(_str)

str_to_role_status

String to player status.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberPlayer status.
up.str_to_role_status(_str)

str_to_role_type

String to player control status.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberPlayer control status.
up.str_to_role_type(_str)

str_to_ability_key

String to skill type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberSkill type ID.
up.str_to_ability_key(_str)

str_to_ability_type

String to skill slot type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberSkill slot type.
up.str_to_ability_type(_str)

str_to_dest_key

String to destructible type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberDestructible type ID.
up.str_to_dest_key(_str)

str_to_project_key

String to projector type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberProjection type ID.
up.str_to_project_key(_str)

str_to_particle_sfx_key

String to effects.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberSpecial effect type ID.
up.str_to_particle_sfx_key(_str)

str_to_tech_key

String to technology type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberTechnology type ID.
up.str_to_tech_key(_str)

str_to_model_key

String to model type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberModel type ID.
up.str_to_model_key(_str)

str_to_modifier_key

String to magic effect type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberMagic effect type ID.
up.str_to_modifier_key(_str)

str_to_modifier_effect_type

String to magic effect effect type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberType of magic effect effect.
up.str_to_modifier_effect_type(_str)

str_to_modifier_type

String to magic effect category.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberMagic effect category.
up.str_to_modifier_type(_str)

str_to_camp

String to camp.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberCamp ID.
up.str_to_camp(_str)

str_to_keyboard_key

String to keyboard keys.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberKeyboard keys.
up.str_to_keyboard_key(_str)

str_to_mouse_key

String to mouse button conversion.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberMouse button.
up.str_to_mouse_key(_str)

str_to_mouse_wheel

String to mouse wheel.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberMouse wheel.
up.str_to_mouse_wheel(_str)

str_to_store_key

String to platform prop type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberPlatform prop type ID.
up.str_to_store_key(_str)

str_to_damage_type

String to harm type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberType of damage.
up.str_to_damage_type(_str)

str_to_unit_attr_type

String to unit attribute type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberUnit property type.
up.str_to_unit_attr_type(_str)

str_to_audio_key

String to sound type.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberSound type ID.
up.str_to_audio_key(_str)

get_icon_id

Get an image based on its ID.

Parameter

VariableTypeDescription
_strstrString.

Return

TypeDescription
numberImage ID.
up.get_icon_id(id)

move_to_pos

Move to a position.

Parameters

VariableTypeDescription
pointpointTarget point.
rangenumberPathfinding range.

Return

TypeDescription
unit_commandCommand.
up.move_to_pos(point, range)

stop

Stop.

Return

TypeDescription
unit_commandCommand.
up.stop()

garrison

Stationed at a target point.

Parameter

VariableTypeDescription
pointpointTarget point.

Return

TypeDescription
unit_commandCommand.
up.garrison(point)

attack_move

Attack movement.

Parameters

VariableTypeDescription
pointpointTarget point.
rangenumberPathfinding range.

Return

TypeDescription
unit_commandCommand.
up.attack_move(point, range)

attack_target

Target of attack.

Parameters

VariableTypeDescription
unitunitTarget unit.
rangenumberPathfinding range.

Return

TypeDescription
unit_commandCommand.
up.attack_target(unit, range)

move_along_path

Move along the path.

Parameters

VariableTypeDescription
pathpathPath.
patrol_mode_namestrMove mode.
is_attackboolWhether to automatically attack.
nearby_start_pointboolSelect the starting point nearby.
is_deviate_returnboolNearest return path.

Return

TypeDescription
unit_commandCommand.
up.move_along_path(path, patrol_mode_name, is_attack, nearby_start_point, is_deviate_return)

cast_ability

Release skills.

Parameters

VariableTypeDescription
abilityabilitySkills.
point1pointTarget point.
point2pointTarget point 2.
point3pointTarget point 3.
unitunitTarget unit.
itemitemTarget item.
destdestructibleTarget destructible.

Return

TypeDescription
unit_commandCommand.
up.cast_ability(ability, point1, point2, point3, unit, item, dest)

pick_up_item

Pick up items.

Parameter

VariableTypeDescription
itemitemItem.

Return

TypeDescription
unit_commandCommand.
up.pick_up_item(item)

discard_item

Discarded items.

Parameters

VariableTypeDescription
itemitemItem.
pointpointTarget point.

Return

TypeDescription
unit_commandCommand.
up.discard_item(item, point)

give_item

Give items.

Parameters

VariableTypeDescription
itemitemItem.
unitunitUnit.

Return

TypeDescription
unit_commandCommand.
up.give_item(item, unit)

use_item

Use of items

Parameters

VariableTypeDescription
itemitemItem.
point1pointTarget point.
point2pointTarget point 2.
point3pointTarget point 3.
unitunitTarget unit.
itemitemTarget item.
destdestructibleTarget destructible.

Return

TypeDescription
unit_commandCommand.
up.use_item(item, point1, point2, point3, unit, target_item, dest)

follow

Follow a unit.

Parameter

VariableTypeDescription
unitunitTarget unit.

Return

TypeDescription
unit_commandCommand.
up.follow(unit)

empty

Empty command.

Return

TypeDescription
unit_commandCommand.
up.empty()

table_length

Length of table.

Parameter

VariableTypeDescription
tabletableTable.

Return

TypeDescription
numberLength of the table.
up.table_length(table)

get_max_tech_level

Get the maximum level of technology.

Parameter

VariableTypeDescription
tech_idnumberTechnology type ID.

Return

TypeDescription
numberTechnology type ID.
up.get_max_tech_level(tech_id)

get_tech_icon

Get the icon of the technology.

Parameters

VariableTypeDescription
tech_idnumberTechnology type ID.
indexnumberLevel.

Return

TypeDescription
numberTechnology icon.
up.get_tech_icon(tech_id, index)

get_tech_type_from_event

Get the type of technology in the event.

Return

TypeDescription
numberTechnology type ID.
up.get_tech_type_from_event()

get_tech_type_description

Get the description of the type of technology.

Parameter

VariableTypeDescription
tech_idnumberTechnology type ID.

Return

TypeDescription
stringDescription of the technology type.
up.get_tech_type_description(tech_id)

get_tech_type_name

Get the name of the technology type.

Parameter

VariableTypeDescription
tech_idnumberTechnology type ID.

Return

TypeDescription
stringName of the technology type.
up.get_tech_type_name(tech_id)

get_current_game_mode

Get the current game mode.

Return

TypeDescription
numberGame mode.
up.get_current_game_mode()

get_local_language_environment

Get local language environment.

Return

TypeDescription
numberLanguage environment.
up.get_local_language_environment()

current_game_run_time

Time the game has been running.

Return

TypeDescription
numberAmount of time it has been running.
up.current_game_run_time()

get_current_game_time

Get the current time of the game.

Return

TypeDescription
numberCurrent time.
up.get_current_game_time()

get_damage_factor

Get damage factor.

Parameters

VariableTypeDescription
attack_type_namestrType of attack.
area_type_namestrArmor type.

Return

TypeDescription
numberCoefficient.
up.get_damage_factor(attack_type_name, area_type_name)

get_coefficient

Get the slave coefficients of the 3D attributes.

Parameters

VariableTypeDescription
primary_attribute_namestrPrimary attribute.
secondary_attr_namestrSecondary attribute.

Return

TypeDescription
numberCoefficient.
up.get_coefficient(primary_attribute_name, secondary_attr_name)

get_game_environment_of_current_round

Acquire the game environment of the council.

Return

TypeDescription
numberGame environment.
up.get_game_environment_of_current_round()

get_global_archive

Get global archive.

Parameter

VariableTypeDescription
namestrArchive name.

Return

TypeDescription
stringArchives.
up.get_global_archive(name)

get_archive_rank_player_archive_value

Get integer archive leaderboard player archive values.

Parameters

VariableTypeDescription
filestrArchives.
indexnumberSerial number.

Return

TypeDescription
strArchived value.
up.get_archive_rank_player_archive_value(file, index)

if_pri_attr_state_open

Whether to open the three-dimensional properties or not.

Return

TypeDescription
booleanWhether to turn on.
up.if_pri_attr_state_open()

get_mover_bound_projectiles.

Obtain the motile binding projection.

Return

TypeDescription
projectileProjection.
up.get_mover_bound_projectiles()

get_tech_changed_level

Get the level of technological change.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberTechnology level.
up.get_tech_changed_level(data)

trigger_modifier

Trigger magic effect.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
modifierMagic effects.
up.trigger_modifier(data)

tech_researched

Technology being studied.

Return

TypeDescription
numberTechnology.
up.tech_researched()

get_unit_in_event

Get the units in the event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitUnit.
up.get_unit_in_event(data)

modifier_receiver

Magic effect carriers.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitUnit.
up.modifier_receiver(data)

get_ability_owner

Acquisition of skill owners.

Parameter

VariableTypeDescription
abilityabilitySkills.

Return

TypeDescription
unitUnit.
up.get_ability_owner(ability)

modifier_provider

Magic effect applicator.

Parameter

VariableTypeDescription
modifiermodifierMagic effects.

Return

TypeDescription
unitUnit.
up.modifier_provider(modifier)

ability_selected_target_item

Target item selected by the skill.

Parameters

VariableTypeDescription
abilityabilitySkills.
datatableEvent data.

Return

TypeDescription
itemItem.
up.ability_selected_target_item(ability, data)

picked_modifier

Traversing to the magic effect.

Return

TypeDescription
modifierMagic effects.
up.picked_modifier()

player_that_triggered_current_event

The player who triggered the current event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
playerPlayer.
up.player_that_triggered_current_event(data)

projectile_that_triggered_current_event

The projection that triggered the current event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
projectileProjection.
up.projectile_that_triggered_current_event(data)

ability_selected_target_unit

Get the unit selected by the skill.

Parameters

VariableTypeDescription
abilityabilitySkills.
datatableEvent data.

Return

TypeDescription
unitUnit.
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

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberValue of layer change.
up.get_modifier_stack_changed_value(data)

tech_upgraded_or_downgraded

Technology for level up and down.

Return

TypeDescription
numberTechnology.
up.tech_upgraded_or_downgraded()

item_selected_in_picking_item_group

Selected items when traversing the item group.

Return

TypeDescription
itemItem.
up.item_selected_in_picking_item_group()

level_changed_tech

Grade change technology.

Return

TypeDescription
numberTechnology for level changes.
up.level_changed_tech()

get_damage_or_healing_target_unit

Get units that take damage (healing).

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitUnit.
up.get_damage_or_healing_target_unit(data)

picked_unit_in_unit_group

Get the units traversed in the unit group.

Return

TypeDescription
unitUnit.
up.picked_unit_in_unit_group()

get_killer_unit

Get the killer unit.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitUnit.
up.get_killer_unit(data)

get_picked_projectile

Get the traversed projection.

Return

TypeDescription
projectileProjection.
up.get_picked_projectile()

get_dead_unit

Obtain death units.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitUnit.
up.get_dead_unit(data)

Get_Damage_or_Healing_Source_Unit

Get units that apply damage (healing).

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitUnit.
up.Get_Damage_or_Healing_Source_Unit(data)

unit_to_gain_item

Obtain item units.

Return

TypeDescription
unitUnit.
up.unit_to_gain_item()

unit_to_lose_item

Loss of item unit.

Return

TypeDescription
unitUnit.
up.unit_to_lose_item()

unit_to_use_item

Use of item units.

Return

TypeDescription
unitUnit.
up.unit_to_use_item()

unit_to_change_stacks

Holders of stacked layer change items.

Return

TypeDescription
unitUnit.
up.unit_to_change_stacks()

get_unit_about_to_gain_modifier

Obtain a unit that is about to acquire a magic effect.

Parameter

VariableTypeDescription
modifiermodifierMagic effects.

Return

TypeDescription
unitUnit.
up.get_unit_about_to_gain_modifier(modifier)

last_unit_to_make_purchase

The last unit to perform the purchase operation.

Return

TypeDescription
unitUnit.
up.last_unit_to_make_purchase()

last_unit_to_make_sale

The last unit to be sold.

Return

TypeDescription
unitUnit.
up.last_unit_to_make_sale()

get_current_array_index

Get the current array index.

Parameter

VariableTypeDescription
datatableData in the trigger callback function.

Return

TypeDescription
numberIndex value.
up.get_current_array_index(data)

ability_that_triggered_current_event

Skills that trigger the current event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
abilitySkills.
up.ability_that_triggered_current_event(data)

ability_selected_destructible

The target selected by the skill can destroy the object.

Parameters

VariableTypeDescription
abilityabilitySkills.
datatableEvent data.

Return

TypeDescription
destructibleDestructible object.
up.ability_selected_destructible(ability, data)

destructible_in_event

Destructible objects in the event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
destructibleDestructible object.
up.destructible_in_event(data)

damage_value_that_triggered_current_event

The value of the damage that triggered the current event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberValue of the damage.
up.damage_value_that_triggered_current_event(data)

item_that_triggered_current_event

The item that triggered the current event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
itemItem.
up.item_that_triggered_current_event(data)

unit_gains_item

Unit that acquires items.

Return

TypeDescription
itemItem.
up.unit_gains_item()

unit_loses_item

Unit that loses items.

Return

TypeDescription
itemItem.
up.unit_loses_item()

unit_uses_item

Unit that uses items.

Return

TypeDescription
itemItem.
up.unit_uses_item()

item_whose_stack_changed

Stacking layer change items.

Return

TypeDescription
itemItem.
up.item_whose_stack_changed()

item_whose_charge_changed

Charge change items.

Return

TypeDescription
itemItem.
up.item_whose_charge_changed()

item_purchased

Purchased items.

Return

TypeDescription
itemItem.
up.item_purchased()

item_sold

Items for sale.

Return

TypeDescription
itemItem.
up.item_sold()

selected_location_by_ability

Skill selection to the point.

Return

TypeDescription
pointPoint.
up.selected_location_by_ability(ability, data)

string_in_event

Strings in events.

Return

TypeDescription
strA string of characters.
up.string_in_event(data)

mover_collision_unit

Exerciser collision unit.

Return value

TypeDescription
unitUnit.
up.mover_collision_unit()

get_unit_in_destructible_event

Get units in a destructible event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitUnit.
up.get_unit_in_destructible_event(data)

get_current_damage_type

Get the current damage type.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberType of damage.
up.get_current_damage_type(data)

player_resource_type_involved_in_the_event

Types of player resources in the event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberPlayer resource type.
up.player_resource_type_involved_in_the_event(data)

unit_group_involved_in_the_event

Unit groups in events.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unit_groupUnit group.
up.unit_group_involved_in_the_event(data)

current_purchasable

Current platform props.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberPlatform prop ID.
up.current_purchasable(data)

convert_float_to_angle

Real number to angle.

Parameter

VariableTypeDescription
valuenumberReal number.

Return

TypeDescription
angleAngle.
up.convert_float_to_angle(value)

convert_angle_to_float

Angle to real number.

Parameter

VariableTypeDescription
valueangleReal number.

Return

TypeDescription
numberAngle.
up.convert_angle_to_float(value)

get_ability_cast_direction

Get skill release directions.

Parameters

VariableTypeDescription
abilityAbility skills.
datatableEvent data.

Return

TypeDescription
angleDirection of release.
up.get_ability_cast_direction(ability, data)

unit_in_destroy_destructible_event

Units in destructible mortality events.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
unitKiller unit.
up.unit_in_destroy_destructible_event(data)

unit_in_destructible_is_damaged_event

Units in vandalizable injury incidents.

Parameter

VariableTypeDescription
datatableEvent data.

Return value

TypeDescription
unitUnit from which the damage originates.
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

VariableTypeDescription
datatableEvent data.

Return value

TypeDescription
unitAcquisition unit.
up.unit_in_destructible_is_gathered_event(data)

resource_change_value_in_destructible_event

Value of resource change in destructible events.

Parameter

VariableTypeDescription
datatableEvent data.

Return value

TypeDescription
numberValue of the resource change.
up.resource_change_value_in_destructible_event(data)

ability_in_destructible_event

Skill objects in destructible events.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
abilityGathering skills.
up.ability_in_destructible_event(data)

number_of_player_attributes_gathered_in_destructible_event

Number of player attributes collected in a destructible event.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberNumber of player attributes.
up.number_of_player_attributes_gathered_in_destructible_event(data)

damage_value_in_destructible_event

Damage value in destructible events.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
numberDamage value.
up.damage_value_in_destructible_event(data)

get_ability_by_unit_and_seq

Get skills in events.

Parameter

VariableTypeDescription
datatableEvent data.

Return

TypeDescription
abilitySkills.
up.get_ability_by_unit_and_seq(data)

get_build_unit

Get the build unit in the event.

Parameter

VariableTypeDescription
datatableEvent data.

Return value

TypeDescription
unitUnit being built.
up.get_build_unit(data)

get_healing_value_before_settlement

Get the value of this treatment (before settlement).

Parameter

VariableTypeDescription
datatableEvent data.

Return value

TypeDescription
numberTreatment value.
up.get_healing_value_before_settlement(data)

get_mover_bound_units

Get the kinematic binding unit.

Parameter

VariableTypeDescription
datatableEvent data.

Return value

TypeDescription
unitUnit.
up.get_mover_bound_units(data)

all_units_belonging_to_specified_player

All units belonging to a player.

Parameter

VariableTypeDescription
playerplayerPlayer.

Return

TypeDescription
unit_groupUnit group.
up.all_units_belonging_to_specified_player(player)

unit_of_a_specified_unit_type

Specify the unit type of the unit.

Parameter

VariableTypeDescription
unit_idnumberUnit type ID.

Return

TypeDescription
unit_groupUnit group.
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

VariableTypeDescription
unit_groupunit_groupUnit group.
indexnumberNumber.

Return

TypeDescription
unit_groupUnit group.
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

VariableTypeDescription
unit_groupunit_groupUnit group.

Return

TypeDescription
numberNumber of units.
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

VariableTypeDescription
unit_groupunit_groupUnit group.
unit_idnumberUnit type ID.

Return

TypeDescription
numberQuantity.
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

VariableTypeDescription
unit_groupunit_groupUnit group.

Return value

TypeDescription
unitUnit.
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

VariableTypeDescription
unit_groupunit_groupUnit group.

Return value

TypeDescription
unitUnit.
up.get_random_unit_from_unit_group(unit_group)

get_last_unit_in_unit_group

Get the last unit in the unit group.

Parameter

VariableTypeDescription
unit_groupunit_groupUnit group.

Return value

TypeDescription
unitUnit.
up.get_last_unit_in_unit_group(unit_group)

get_object_from_data

Obtaining objects from data.

Parameters

VariableTypeDescription
datatableData.
namestrObject name.

Return

TypeDescription
objectObject.
up.get_object_from_data(data, name)

is_point_in_area

Is the point in the area.

Parameters

VariableTypeDescription
pointPoint point point.
areaareaArea.

Return

TypeDescription
booleanWhether to be in the area.
up.is_point_in_area(point, area)

string_to_bool

String to boolean.

Parameter

VariableTypeDescription
valuestrString.

Return

TypeDescription
boolBoolean value.
 cli.string_to_bool(value)

get_global_weather

Get global weather.

Return

TypeDescription
strName of the weather.
up.get_global_weather()

player_keyboard_key_is_pressed

Whether the player keyboard keys are pressed.

Parameters

VariableTypeDescription
playerplayerPlayer.
keynumberKeyboard key.

Return

TypeDescription
boolWhether to be pressed.
up.player_keyboard_key_is_pressed(player, key)

player_mouse_key_is_pressed

Whether the player mouse is pressed.

Parameters

VariableTypeDescription
playerplayerPlayer.
keynumberMouse button.

Return

TypeDescription
boolWhether to be pressed.
up.player_mouse_key_is_pressed(player, key)

check_tech_key_precondition

Check the technology type pre-requisites.

Parameters

VariableTypeDescription
playerplayerPlayer.
tech_typenumberTechnology type ID.

Return

TypeDescription
boolWhether the condition is satisfied.
up.check_tech_key_precondition(player, tech_type)

joint_string.

String splicing.

Parameters

VariableTypeDescription
str1strString 1.
str2strString 2.

Return

TypeDescription
strSpliced string.
up.joint_string(str1, str2)

extract_string

Intercept string.

Parameters

VariableTypeDescription
strstrString.
start_posnumberStart position.
end_posnumberEnd position.

Return

TypeDescription
strIntercepted string.
up.extract_string(str, start_pos, end_pos)

delete_sub_string

Delete substring.

Parameters

VariableTypeDescription
strstrString.
_sub_strstrSubstring.
is_onceboolDelete only once.

Return

TypeDescription
strString after deleting the substring.
up.delete_sub_string(str, _sub_str, is_once)

get_text_config

Get multilingual content.

Parameter

VariableTypeDescription
strstrCustom multilingual key.

Return value

TypeDescription
strCorresponding content in the multilingual table.
up.get_text_config(str)

get_random_pool_probability

Get the weight probability of the specified integer in the random pool.

Parameters

VariableTypeDescription
pooltableRandom pool.
valuenumberSpecified integer.

Return value

TypeDescription
numberWeight probability.
up.get_random_pool_probability(pool, value)

get_int_value_from_random_pool

Get a random integer from a random pool.

Parameter

VariableTypeDescription
pooltableRandom pool.

Return

TypeDescription
numberRandom integer.
up.get_int_value_from_random_pool(pool)

get_random_pool_all_weight

Get the total weight of the random pool.

Parameter

VariableTypeDescription
pooltableRandom pool.

Return value

TypeDescription
numberTotal weight.
up.get_random_pool_all_weight(pool)

get_random_pool_size

Get the number of integers in the random pool.

Parameter

VariableTypeDescription
pooltableRandom pool.

Return

TypeDescription
numberInteger number.
up.get_random_pool_size(pool)

get_random_pool_pointed_weight

Get the weight of the specified integer in the random pool.

Parameters

VariableTypeDescription
pooltableRandom pool.
valuenumberSpecified integer.

Return

TypeDescription
numberWeight.
up.get_random_pool_pointed_weight(pool, value)

get_point_ground_height

Get the layer of the map at the point location.

Parameter

VariableTypeDescription
pointpointTarget point.

Return

TypeDescription
numberHierarchy.
up.get_point_ground_height(point)

get_random_seed

Get random seeds.

Return

TypeDescription
numberRandom seed.
up.get_random_seed()

get_game_init_time_stamp

Get the game start time stamp.

Return

TypeDescription
numberTimestamp.
up.get_game_init_time_stamp()

get_game_x_resolution

Get initialized horizontal resolution.

Return

TypeDescription
numberHorizontal resolution.
up.get_game_x_resolution()

get_game_y_resolution

Get initialized vertical resolution.

Return

TypeDescription
numberVertical resolution.
up.get_game_y_resolution()

get_graphics_quality

Get initialized game picture quality.

Return

TypeDescription
numberPicture quality.
up.get_graphics_quality()

get_window_mode

Get the initialization window category.

Return

TypeDescription
numberWindow category.
up.get_window_mode()