On This Page

  • Reference
  • LUA API
  • Classes
  • Player

Players

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

Functions

get_save_data_bool_value

Get player archive data.

Parameter

VariableTypeDescription
namestringArchive key.

Return

TypeDescription
booleanBoolean player archive data.
player:get_save_data_bool_value(name)

is_joins_in_the_middle_of_round

Whether the player joins in the middle of the round or not.

Return

TypeDescription
booleanWhether to join in the middle of the round.
player:is_joins_in_the_middle_of_round()

players_is_enemy

Whether the players are enemies or not.

Parameter

VariableTypeDescription
playerplayerPlayer.

Return

TypeDescription
booleanWhether the player is an enemy.
player:players_is_enemy(player)

is_hotkey_of_basic_operation_is_occupied

Whether the player's basic operation shortcut key is occupied or not.

Parameters

VariableTypeDescription
keyintegerPlayer.
assist_keyintegerPlayer.

Return

TypeDescription
booleanWhether it is occupied.
player:is_hotkey_of_basic_operation_is_occupied(key, assist_key)

set_role_name

Set the name.

Parameter

VariableTypeDescription
namestringName.
player:set_role_name(name)

set_faction_id

Set the team ID.

Parameter

VariableTypeDescription
idintegerName.
player:set_faction_id(id)

set_player_attribute

Set the value of the attribute.

Parameters

VariableTypeDescription
keystringName of the attribute.
valuenumberValue.
player:set_player_attribute(key, value)

add_player_attribute

Add an attribute value.

Parameters

VariableTypeDescription
keystringName of the attribute.
valuenumberValue.
player:add_player_attribute(key, value)

set_rate_of_gaining_exp

Set the rate of experience gained.

Parameter

VariableTypeDescription
ratenumberRate of experience gained.
player:set_rate_of_gaining_exp(rate)

set_hostile_relationship

Set hostile relationship.

Parameters

VariableTypeDescription
playerplayerPlayer.
is_hostilebooleanWhether hostile.
player:set_hostile_relationship(player, is_hostile)

set_strict_group_navigation

Set group pathfinding strict mode.

Parameter

VariableTypeDescription
is_strictbooleanWhether to be strict.
player:set_strict_group_navigation(is_strict)

select_unit

Select units/unit groups.

Parameter

VariableTypeDescription
unitunitUnit/unit group.
player:select_unit(unit)

set_follow_distance

Set the following distance.

Parameter

VariableTypeDescription
distancenumberDistance.
player:set_follow_distance(distance)

set_player_mouse_click_selection

Turn on/off mouse click selection for the player.

Parameter

VariableTypeDescription
is_enablebooleanWhether to turn on mouse click selection.
player:set_player_mouse_click_selection(is_enable)

set_player_mouse_drag_selection

Enable/disable mouse frame selection for the player.

Parameter

VariableTypeDescription
is_enablebooleanWhether to turn on mouse drag selection.
player:set_player_mouse_drag_selection(is_enable)

set_player_mouse_wheel

Turn on/turn off the mouse wheel for the player.

Parameter

VariableTypeDescription
is_enablebooleanWhether to turn on the mouse wheel.
player:set_player_mouse_wheel(is_enable)

set_role_editable_game_func

Set the player's basic action shortcuts (filter out the ones that are disabled).

Parameters

VariableTypeDescription
operationintegerEditable operation.
keyintegerFunction key.
assist_keyintegerAssist key.
player:set_role_editable_game_func(operation, key, assist_key)

set_role_all_game_func_enable

Set the player's basic operation switch (contains all basic operations).

Parameters

VariableTypeDescription
operationintegerEditable operation.
is_enablebooleanWhether to turn on.
player:set_role_all_game_func_enable(operation, is_enable)

set_tech_level

Set tech level.

Parameters

VariableTypeDescription
tech_typeintegerTech level.
levelintegerLevel.
player:set_tech_level(tech_type, level)

add_tech_level

Add a tech level.

Parameters

VariableTypeDescription
tech_typeintegerTech level.
levelintegerLevel.
player:add_tech_level(tech_type, level)

share_view_with_player

Open view with player.

Parameter

VariableTypeDescription
playerplayerPlayer.
player:share_view_with_player(player)

close_view_with_player

View is closed with player.

Parameter

VariableTypeDescription
playerplayerPlayer.
player:close_view_with_player(player)

share_view_with_unit

Unit is open to player view.

Parameter

VariableTypeDescription
unitunitUnit.
player:share_view_with_unit(unit)

close_view_with_unit

Unit closes the view with respect to the player.

Parameter

VariableTypeDescription
unitunitUnit.
player:close_view_with_unit(unit)

upload_save_data

Upload the archive.

player:upload_save_data()

add_global_archive

Add a global archive.

Parameters

VariableTypeDescription
keyintegerKey.
valuenumberValue.
player:add_global_archive(key, value)

save_data

Set the player archive.

player:save_data(key, value)

use_purchasable_item

Consume player platform props.

Parameters

VariableTypeDescription
countintegerNumber of items.
item_idintegerPlatform prop ID.
player:use_purchasable_item(count, item_id)

point_is_visible_to_player

Point is visible to the player.

Parameter

VariableTypeDescription
pointpointPoint.

Return

TypeDescription
booleanPoint is visible to the player.
player:point_is_visible_to_player(point)

point_is_in_fog_to_player

Point is in the fog.

Parameter

VariableTypeDescription
pointpointPoint.

Return

TypeDescription
booleanPoint is in the fog.
player:point_is_in_fog_to_player(point)

point_is_in_shadow_to_player

Point is in black shadow.

Parameter

VariableTypeDescription
pointpointPoint.

Return

TypeDescription
booleanPoint is in black shadow.
player:point_is_in_shadow_to_player(point)

get_key_related_to_basic_operation

Get the player's basic operation in response to keyboard keystrokes (filter out prohibited settings).

Parameters

VariableTypeDescription
keyintegerKey name.
assist_keyintegerKeyboard key.

Return

TypeDescription
stringBase action.
player:get_key_related_to_basic_operation(key, assist_key)

get_player_attribute

Get player attributes.

Parameter

VariableTypeDescription
keystringName of the attribute.

Return

TypeDescription
numberPlayer attribute.
player:get_player_attribute(key)

get_player_id

Get the player ID.

Return

TypeDescription
integerPlayer ID.
player:get_player_id()

get_game_state

Get the player's game state.

Return

TypeDescription
stringPlayer's game state.
player:get_game_state()

get_control_type

Get the player controller type.

Return

TypeDescription
stringPlayer controller type.
player:get_control_type()

get_name

Get the player name.

Return

TypeDescription
stringPlayer's name.
player:get_name()

get_save_data_table_value

Tabular player archive data.

Parameter

VariableTypeDescription
keystringArchive key.

Return

TypeDescription
tableTabular player archive data.
player:get_save_data_table_value(key)

get_exp_multiplier

Get the experience gain rate.

Return

TypeDescription
numberExperience gain rate.
player:get_exp_multiplier()

get_faction_id

Get the team ID.

Return

TypeDescription
integerTeam ID.
player:get_faction_id()

get_string_player_archive_data

String type player archive data.

Parameter

VariableTypeDescription
keystringArchive key.
player:get_string_player_archive_data(key)

get_float_player_archive_data

Real type archive data.

Parameter

VariableTypeDescription
keystringArchive key.

Return

TypeDescription
numberReal archive data.
player:get_float_player_archive_data(key)

get_tech_level

Gets the tech level.

Parameter

VariableTypeDescription
tech_idintegerTech ID.

Return

TypeDescription
integerTech level.
player:get_tech_level(tech_id)

get_platform_icon

Get the player's platform avatar.

Return

TypeDescription
integerPlatform avatar.
player:get_platform_icon()

get_player_purchasable_number

Number of player platform props.

Parameter

VariableTypeDescription
idintegerPlatform prop ID.

Return

TypeDescription
integerNumber of platform props.
player:get_player_purchasable_number(id)

get_int_player_archive_data

Get integer type archive data.

Parameter

VariableTypeDescription
keystringArchive key.

Return

TypeDescription
integerInteger archive data.
player:get_int_player_archive_data(key)

get_player_archive_rank_num

Get integer archive player rank.

Parameter

VariableTypeDescription
keystringArchive key.

Return

TypeDescription
integerInteger archive player rank.
player:get_player_archive_rank_num(key)

get_player_platform_level

Get player platform rank.

Return

TypeDescription
integerPlatform level.
player:get_player_platform_level()

is_player_in_group

The player is in the player group.

Parameter

VariableTypeDescription
player_groupplayer_groupPlayer group.

Return

TypeDescription
booleanPlayer in player group.
player:is_player_in_group(player_group)

all_units_belonging_to_specified_player

All units belonging to a player.

Return

TypeDescription
unit_groupUnit group.
player:all_units_belonging_to_specified_player()

remove_player

Force kick out.

Parameter

VariableTypeDescription
reasonstringReason for the kickout.
player:remove_player(reason)

set_currency_icon

Set the player property icon.

Parameters

VariableTypeDescription
keystringAttribute name.
idintegerIcon ID.
cli.set_currency_icon(key, id)

get_player_platform_model

Get the player platform appearance model.

Return

TypeDescription
integerModel ID.
player:get_player_platform_model()

get_mouse_world_coordinates_of_player

Get the mouse's in-game coordinates.

Return

TypeDescription
pointPoint.
player:get_mouse_world_coordinates_of_player()

get_proportion_of_player_mouse_screen_coordinate_x

Get the proportion of the player's mouse screen coordinate x.

Return

TypeDescription
numberProportion of X.
player:get_proportion_of_player_mouse_screen_coordinate_x()

get_proportion_of_player_mouse_screen_coordinate_y

Get the proportion of the player's mouse screen coordinate Y.

Return

TypeDescription
numberProportion of Y.
player:get_proportion_of_player_mouse_screen_coordinate_y()

get_player_ui_pos_x

Get the X coordinate of the mouse on the screen.

Return

TypeDescription
numberX coordinate.
player:get_player_ui_pos_x()

get_player_ui_pos_y

Get the Y coordinate of the mouse on the screen.

Return

TypeDescription
numberY coordinate.
player:get_player_ui_pos_y()

set_currency_icon_for_player_attribute

Get the currency icon for the player attribute.

Parameter

VariableTypeDescription
keystringName of the attribute.

Return

TypeDescription
integerIcon ID.
player.set_currency_icon_for_player_attribute(key)

convert_player_id_to_player

Convert player ID to player.

Parameter

VariableTypeDescription
idintegerPlayer ID.

Return

TypeDescription
playerPlayer.
player.convert_player_id_to_player(id)

get_player_attribute_name

Get the name of the player attribute.

Parameter

VariableTypeDescription
keystringName of the attribute.

Return

TypeDescription
stringName of the attribute.
player.get_player_attribute_name(key)