set_ending_screen_data(message, file) | Setup the screen to be shown when the game is finished. |
print(message) | Print text to the chat console. |
clear_console() | Clear the chat console. |
get_goal_description() → LocalisedString | Get the current goal description, as a localised string. |
set_goal_description(text, only_update) | Set the text in the goal window (top left). |
set_controller{type=…, character=…} | Set the controller type of the player. |
build_from_cursor() → boolean | Build the entity in the player's cursor (hand). |
rotate_for_build() → boolean | Rotate the entity in cursor before building. |
disable_recipe_groups() | Disable recipe groups. |
disable_recipe_subgroups() | Disable recipe subgroups. |
print_entity_statistics(entities) | Print entity statistics to the player's console. |
unlock_achievement(name) | Unlock the achievements of the given player. |
clean_cursor() | Invokes the "clean cursor" action on the player as if the user pressed it. |
create_character(character) | Creates and attaches a character entity to this player. |
character :: LuaEntity [RW] | The character attached to this player, or nil if no character. |
index :: uint [R] | This player's index in LuaGameScript::players. |
gui :: LuaGui [R] | |
opened_self :: boolean [R] | true if the player opened itself. |
controller_type :: defines.controllers [R] | |
game_view_settings :: GameViewSettings [RW] | The player's game view settings. |
minimap_enabled :: boolean [RW] | true if the minimap is visible. |
color :: Color [RW] | The colour associated with the player. |
name :: string [RW] | The player's username. |
tag :: string [RW] | The tag that is shown after the player in chat and on the map. |
connected :: boolean [R] | true if the player is currently connected to the game. |
admin :: boolean [R] | true if the player is an admin. |
entity_copy_source :: LuaEntity [R] | The source entity used during entity settings copy-paste if any. |
afk_time :: uint [R] | How many ticks since the last action of this player |
online_time :: uint [R] | How many ticks did this player spend playing this save (all sessions combined) |
cursor_position :: Position [W] | Position of the player's mouse cursor. |
zoom :: double [W] | The player's zoom-level. |
valid :: boolean [R] | Is this object valid? |
Inherited from LuaControl: get_inventory, get_quickbar, can_insert, insert, set_gui_arrow, clear_gui_arrow, get_item_count, has_items_inside, can_reach_entity, clear_items_inside, remove_item, teleport, update_selected_entity, clear_selected_entity, disable_flashlight, enable_flashlight, get_craftable_count, begin_crafting, cancel_crafting, surface, position, vehicle, force, selected, opened, crafting_queue_size, walking_state, riding_state, mining_state, cursor_stack, driving, crafting_queue, cheat_mode, character_crafting_speed_modifier, character_mining_speed_modifier, character_running_speed_modifier, character_build_distance_bonus, character_item_drop_distance_bonus, character_reach_distance_bonus, character_resource_reach_distance_bonus, character_item_pickup_distance_bonus, character_loot_pickup_distance_bonus, quickbar_count_bonus, character_inventory_slots_bonus, character_logistic_slot_count_bonus, character_trash_slot_count_bonus, character_maximum_following_robot_count_bonus, character_health_bonus, auto_trash_filters |
A player in the game. Pay attention that a player may or may not have a character, which is the LuaEntity of the little guy running around the world doing things.
Setup the screen to be shown when the game is finished.
Clear the chat console.
Get the current goal description, as a localised string.
Set the text in the goal window (top left).
Set the controller type of the player.
type
is
defines.controllers.character, ignored otherwise.Build the entity in the player's cursor (hand). The effect is the same as if the player clicked the build button (left mouse).
true
if the building was successfull.Rotate the entity in cursor before building.
true
if the rotation was successful.Disable recipe groups.
Disable recipe subgroups.
Print entity statistics to the player's console.
Unlock the achievements of the given player. This has any effect only when this is the local player and the achievement isn't unlocked so far.
Invokes the "clean cursor" action on the player as if the user pressed it.
Creates and attaches a character entity to this player.
The character attached to this player, or nil
if no character.
This player's index in LuaGameScript::players.
true
if the player opened itself. I.e. if they opened the character or god-controller GUI.
The player's game view settings.
true
if the minimap is visible.
The colour associated with the player. This will be used to tint the player's character as well as their buildings and vehicles.
The player's username.
The tag that is shown after the player in chat and on the map.
true
if the player is currently connected to the game.
true
if the player is an admin.
The source entity used during entity settings copy-paste if any.
nil
if there isn't currently a source entity.
How many ticks since the last action of this player
How many ticks did this player spend playing this save (all sessions combined)
Position of the player's mouse cursor. This is in screen coordinates.
The player's zoom-level.