### Object Event Registration Example Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Demonstrates how to register event callbacks for specific object types, using `Ability` as an example. ```APIDOC ## Object Event Registration Example ### Description Provides an example of how to register event callbacks for specific object types, such as abilities. ### Example Usage ```lua local m = y3.object.ability[134221924] function m.on_cast_start(ability, cast) log.debug(('施法开始,技能为:%s,目标为:%s'):format(ability:get_name(), cast:get_target_unit())) end function m.on_cast_stop() log.debug('施法结束') end ``` ``` -------------------------------- ### Unit Modification Example Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Example demonstrating how to modify unit data directly. ```APIDOC ## Modifying Unit Data ### Description Demonstrates how to modify unit data, such as the unit's name. ### Example ```lua local M = y3.object.unit[134274912] -- Guan Yu's ID M.data.name = '这是修改过的名字' ``` See `演示/物编` for details. ``` -------------------------------- ### Batch Registering Object Events in Y3 Lua Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Demonstrates how to batch register events for a specific type of object, such as abilities. Includes example event handlers for cast start and stop. ```lua local m = y3.object.ability[134221924] function m.on_cast_start(ability, cast) log.debug(('施法开始,技能为:%s,目标为:%s'):format(ability:get_name(), cast:get_target_unit())) end function m.on_cast_stop() log.debug('施法结束') end ``` -------------------------------- ### Add Ability:get_description Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the description of an ability. No specific setup is required. ```lua Ability:get_description ``` -------------------------------- ### Get Buff Description by Key Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the description for a buff type using its key. Use to get localized or standard descriptions for buff categories. ```lua function Buff.get_description_by_key(buff_key: py.ModifierKey) -> description: string ``` -------------------------------- ### Buff:get_description Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the description of the Buff object. ```APIDOC ## Buff:get_description ### Description Gets the description of the Buff object. ### Method (method) ### Returns * `description` (string) - The description. ``` -------------------------------- ### Deprecate Game-Start Event Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md The 'Game-Start' event has been deprecated and should be replaced with the 'Game-Initialization' event. No code example is provided for this change. ```lua 游戏-开始 ``` ```lua 游戏-初始化 ``` -------------------------------- ### Get All Recipes Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Synthesis.md Returns a table containing all registered synthesis recipes, mapping target items to their required ingredients and counts. ```lua Synthesis:get_recipes() -> table> ``` -------------------------------- ### Beam Following Scale Parameter Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Adds a `follow_scale` parameter to `y3.beam.create`, which is effective only when the beam's starting point is a unit. ```lua y3.beam.create(start_point, end_point, follow_scale) ``` -------------------------------- ### Object:kv_save and Object:kv_load Support Tables Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md The `Object:kv_save` and `Object:kv_load` methods now support table values. No specific setup is required. ```lua Object:kv_save ``` ```lua Object:kv_load ``` -------------------------------- ### y3.beam.create Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Creates a beam effect, with an option for `follow_scale` which is effective when the start point is a unit. ```APIDOC ## y3.beam.create ### Description Creates a beam effect between two points or entities. The `follow_scale` parameter, when true and the starting point is a unit, allows the beam's scale to follow the unit's scale. ### Method Not specified (assumed to be a function call) ### Endpoint Not applicable (Lua function) ### Parameters - `start_point` (Vector/Unit): The starting point or unit of the beam. - `end_point` (Vector/Unit): The ending point or unit of the beam. - `follow_scale` (boolean, optional): If true and `start_point` is a unit, the beam's scale will follow the unit's scale. ### Request Example ```lua y3.beam.create(unit, target_unit, true) ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### Add y3.game.get_current_server_time() Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface returns the current server time. No specific setup is required. ```lua y3.game.get_current_server_time() ``` -------------------------------- ### Add Player:get_selecting_unit Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the unit currently selected by the player. No specific setup is required. ```lua Player:get_selecting_unit ``` -------------------------------- ### Timer:get_elapsed_time Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Timer.md Gets the total time that has elapsed since the timer was started. ```APIDOC ## Timer:get_elapsed_time ### Description Returns the amount of time that has passed since the timer was initiated. ### Returns - **time** (number) - The elapsed time in seconds. ``` -------------------------------- ### Timer.get_elapsed_time - Get time passed since timer start Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Timer.md Retrieves the total time that has elapsed since the timer was started or last reset. This is useful for tracking progress or duration. ```lua (method) Timer:get_elapsed_time() -> time: number ``` -------------------------------- ### Develop.Helper.init Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Initializes the connection to the Y3 Development Assistant. ```APIDOC ## Develop.Helper.init ### Description Initializes the connection to the Y3 Development Assistant. If the game is launched with VSCode, it connects automatically. Otherwise, this function can be called manually if needed. ### Method Develop.Helper.init ### Parameters - `port` (integer) - Optional - The port to connect to. ``` -------------------------------- ### Develop.Helper.prepareForRestart Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Prepares the game for a restart with specified options. ```APIDOC ## Develop.Helper.prepareForRestart ### Description Prepares the game for a restart with specified options. ### Method Develop.Helper.prepareForRestart ### Parameters - `options` (Develop.Helper.RestartOptions) - Required - Options for the restart. ``` -------------------------------- ### Develop.Console.getHelpInfo Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Retrieves help information for the console. ```APIDOC ## Develop.Console.getHelpInfo ### Description Retrieves help information for the console. ### Method Develop.Console.getHelpInfo ### Returns - `string` - The help information. ``` -------------------------------- ### Add y3.player_group.create Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface creates an empty player group. It will be available after the March 28th update. No specific setup is required. ```lua y3.player_group.create ``` -------------------------------- ### Player:open_platform_shop Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Requests to open the platform's shop interface for purchasing items. ```APIDOC ## Player:open_platform_shop ### Description Initiates a request to open the platform's integrated shop interface, allowing the player to browse and purchase items. ### Method Not specified (assumed to be a method call on a Player object) ### Endpoint Not applicable (Lua method) ### Parameters None explicitly defined in the source. ### Request Example ```lua player:open_platform_shop() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### Add Ability:get_icon Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the icon of an ability. No specific setup is required. ```lua Ability:get_icon ``` -------------------------------- ### Enabling Hot-Reloading in Y3 Lua Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Introduces support for hot-reloading scripts, with an example provided in `演示/热重载/演示.lua`. Configuration options allow specifying which files can be reloaded. ```lua require = include ``` -------------------------------- ### Develop.Helper.Explorer.createRoot Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a root node for the explorer. ```APIDOC ## Develop.Helper.Explorer.createRoot ### Description Creates a root node for the explorer. ### Function Signature ```lua function Develop.Helper.Explorer.createRoot(name: string) -> Develop.Helper.TreeNode ``` ``` -------------------------------- ### Create Explorer Instance Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Factory function to create a new instance of the explorer. ```lua function Develop.Helper.Explorer.create() ``` -------------------------------- ### Removed Y3 Game Request Server Time and Get Client Player Interfaces Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Removes interfaces for requesting server time and getting the client player, suggesting alternatives. ```lua y3.game.request_server_time ``` ```lua y3.game.get_client_player -> y3.player.get_local ``` -------------------------------- ### enable_lua_profile Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Enables Tracy for Lua performance profiling. ```APIDOC ## enable_lua_profile ### Description Enables the use of Tracy for detailed performance profiling of Lua scripts. Documentation link will be provided later. ### Method `enable_lua_profile()` ``` -------------------------------- ### Buff:get_level Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the level of the Buff. ```APIDOC ## Buff:get_level ### Description Gets the level of the Buff. ### Method (method) ### Returns * `level` (integer) - The level. ``` -------------------------------- ### ECA Calling Lua Function Example Source: https://github.com/y3-editor/y3-lualib/blob/main/README.md Reference for registering a bound function to be called by ECA from Lua. This is useful for integrating ECA and Lua development workflows. ```Lua require "y3.演示.demo.ECA调用Lua函数" ``` -------------------------------- ### Buff:get_owner Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the owner of the magical effect. ```APIDOC ## Buff:get_owner ### Description Gets the owner of the magical effect. ### Method (method) ### Returns * `owner` (Unit?) - The owner. ``` -------------------------------- ### Y3 Lua Library Initialization Source: https://github.com/y3-editor/y3-lualib/blob/main/README.md Provides instructions for initializing the Y3 Lua library. This can be done automatically via the VSCode extension or manually by replacing the `script/y3` directory and running a configuration script. ```Batch script/y3/初始化配置.bat ``` -------------------------------- ### Develop.Helper.onReady Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Registers a callback to be executed when the Y3 Development Assistant is ready. ```APIDOC ## Develop.Helper.onReady ### Description Registers a callback to be executed when the Y3 Development Assistant is ready. ### Method Develop.Helper.onReady ### Parameters - `callback` (fun()) - Required - The function to call when the assistant is ready. ``` -------------------------------- ### Buff:get_name Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the name of the Buff object. ```APIDOC ## Buff:get_name ### Description Gets the name of the Buff object. ### Method (method) ### Returns * `name` (string) - The name. ``` -------------------------------- ### Add Game-HTTP Return Event Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md A new event, 'Game-HTTP Return', has been added to handle responses from HTTP requests made with 'y3.game:request_url'. No specific setup is required. ```lua 游戏-http返回 ``` -------------------------------- ### Add Ability:pre_cast Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface puts an ability into a targeting state. No specific setup is required. ```lua Ability:pre_cast ``` -------------------------------- ### Network Library for Socket Connections Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Provides a library for establishing socket connections as a client. Refer to the provided demonstration for detailed usage instructions. ```lua y3.network.connect(host, port, on_message, on_close) y3.network.send(data) y3.network.close() ``` -------------------------------- ### Buff:get_key Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the category of the magical effect. ```APIDOC ## Buff:get_key ### Description Gets the category of the magical effect. ### Method (method) ### Returns * `buff_key` (py.ModifierKey) - The category. ``` -------------------------------- ### Add Player:get_color Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the color of a player as a string. No specific setup is required. ```lua Player:get_color ``` -------------------------------- ### Prepare for Game Restart Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Prepares the game environment for a restart. This function takes options that may configure the restart process. ```lua function Develop.Helper.prepareForRestart(options: Develop.Helper.RestartOptions) ``` -------------------------------- ### Buff:get_buff_type Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the type of the magical effect. ```APIDOC ## Buff:get_buff_type ### Description Gets the type of the magical effect. ### Method (method) ### Returns * `type` (y3.Const.ModifierType) - The type of the magical effect. ``` -------------------------------- ### Light.create_spot_light_to_point Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Light.md Creates a spot light directed towards a specified point. ```APIDOC ## Light.create_spot_light_to_point ### Description Creates a spot light directed towards a specified point. @param `point` — Target point. @param `pos_offset_y` — Vertical offset for the light position. @param `unit_point_projectile` — The target object (Unit, Point, or Projectile). @param `target_offset_y` — Vertical offset for the target point. ### Parameters * **point** (Point) - The target point. * **pos_offset_y** (number, optional) - The vertical offset for the light position. * **unit_point_projectile** (Point|Projectile|Unit, optional) - The target object (Unit, Point, or Projectile). * **target_offset_y** (number, optional) - The vertical offset for the target point. ### Returns * **Light** - The created spot light. ``` -------------------------------- ### Add Unit:get_attr Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md A unified interface for retrieving unit attributes. No specific setup is required. ```lua Unit:get_attr ``` -------------------------------- ### Develop.Code.sync_run Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Broadcasts and then synchronously executes code, initiated locally. ```APIDOC ## Develop.Code.sync_run ### Description Broadcasts and then synchronously executes code. This function must be initiated locally. ### Method Develop.Code.sync_run ### Parameters - `code` (string) - Required - The code to execute. - `data` (table) - Optional - Data accessible within the code. - `id` (string) - Optional - The ID of the handler. ### Returns - `boolean` - Indicates if the execution was successful. - `string?` - An error message if execution failed. ``` -------------------------------- ### Buff Get By ID Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Interface for retrieving a buff by its ID. ```APIDOC ## Buff Get By ID ### Description Retrieves a buff object using its unique identifier. ### Interface - **Get buff by ID:** `y3.buff.get_by_id(buff_id: number): Buff` ``` -------------------------------- ### Buff:get_passed_time Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the elapsed duration of the magical effect. ```APIDOC ## Buff:get_passed_time ### Description Gets the elapsed duration of the magical effect. ### Method (method) ### Returns * `duration` (number) - The elapsed duration. ``` -------------------------------- ### Develop.Code.run Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Executes local code with an optional environment. ```APIDOC ## Develop.Code.run ### Description Executes local code with an optional environment. ### Method Develop.Code.run ### Parameters - `code` (string) - Required - The code to execute. - `env` (table) - Optional - The execution environment. ### Returns - `boolean` - Indicates if the execution was successful. - `any` - The result of the code execution. ``` -------------------------------- ### InputBox Initial Text Selection Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Defines the initial range of selected text in the InputBox, specified as a start and end index. ```lua [integer, integer] ``` -------------------------------- ### Add UI:set_equip_slot_use_operation Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface sets the operation mode for using an equipment slot. No specific setup is required. ```lua UI:set_equip_slot_use_operation ``` -------------------------------- ### Develop.Helper.InputBox.show Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Shows the input box and returns the entered value via a callback. ```APIDOC ## Develop.Helper.InputBox.show ### Description Shows the input box and returns the entered value via a callback. ### Method Signature ```lua (method) Develop.Helper.InputBox:show(callback: fun(value?: string)) ``` ### Parameters * `callback` - A callback function that is called after input is complete. If the user cancels the input, `value` will be `nil`. ``` -------------------------------- ### Buff:get_cycle_time Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the cycle time of the magical effect. ```APIDOC ## Buff:get_cycle_time ### Description Gets the cycle time of the magical effect. ### Method (method) ### Returns * `time` (number) - The cycle time. ``` -------------------------------- ### Buff:get_buff_effect_type Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the effect type of the magical effect. ```APIDOC ## Buff:get_buff_effect_type ### Description Gets the effect type of the magical effect. ### Method (method) ### Returns * `type` (y3.Const.EffectType) - The effect type of the magical effect. ``` -------------------------------- ### Add y3.game.get_obj_icon Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the icon for units, items, abilities, or magic effects. No specific setup is required. ```lua y3.game.get_obj_icon ``` -------------------------------- ### Camera:apply Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Applies the settings of a camera. ```APIDOC ## Camera:apply ### Description Applies the current settings of the camera, making them active. ### Method Not specified (assumed to be a method call on a Camera object) ### Endpoint Not applicable (Lua method) ### Parameters None. ### Request Example ```lua camera:apply() ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### Buff:get_buff_aura_range Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the aura range of the magical effect. ```APIDOC ## Buff:get_buff_aura_range ### Description Gets the aura range of the magical effect. ### Method (method) ### Returns * `range` (number) - The aura range. ``` -------------------------------- ### Add y3.game:request_url Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface sends an HTTP request. It is associated with the 'Game-HTTP Return' event. No specific setup is required. ```lua y3.game:request_url ``` -------------------------------- ### Group Creation and Player Group Count Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Interfaces for creating empty unit and player groups, and for getting the number of players in a player group. ```APIDOC ## y3.unit_group.create ### Description Creates an empty unit group. Available after the March 28th update. ### Method y3.unit_group.create() ## y3.player_group.create ### Description Creates an empty player group. Available after the March 28th update. ### Method y3.player_group.create() ## PlayerGroup:count ### Description Gets the number of players in a player group. ### Method PlayerGroup:count() ``` -------------------------------- ### Point:get_random_point Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Gets a random point within a specified range. ```APIDOC ## Point:get_random_point ### Description Returns a random point located within a defined range or area. ### Method Not specified (assumed to be a method call on a Point object) ### Endpoint Not applicable (Lua method) ### Parameters - `range` (number): The radius or range within which to find a random point. ### Request Example ```lua local random_pos = current_point:get_random_point(100) ``` ### Response - `Point`: A new Point object representing the random location. ``` -------------------------------- ### Get Recipes by Item Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Synthesis.md Fetches recipes related to a specific item, returning both the items it can be used to synthesize (parents) and the items required to synthesize it (children). ```lua Synthesis:get_recipes_by_item(item: any) -> { parents: any[], children: any[] } ``` -------------------------------- ### Get Spot Light by Resource ID Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Light.md Retrieves a spot light object using its resource ID. This allows for programmatic access to lights created in the scene editor. ```lua function Light.get_spot_light_by_res_id(res_id: py.LightID) -> Light ``` -------------------------------- ### Add y3.unit_group.create Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface creates an empty unit group. It will be available after the March 28th update. No specific setup is required. ```lua y3.unit_group.create ``` -------------------------------- ### Develop.Helper.isReady Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Checks if the Y3 Development Assistant is ready. ```APIDOC ## Develop.Helper.isReady ### Description Checks if the Y3 Development Assistant is ready. ### Method Develop.Helper.isReady ### Returns - `boolean` - True if the assistant is ready, false otherwise. ``` -------------------------------- ### Timer:get_remaining_time Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Timer.md Gets the amount of time left until the timer triggers. ```APIDOC ## Timer:get_remaining_time ### Description Returns the time left until the timer's next trigger. ### Returns - **time** (number) - The remaining time in seconds. ``` -------------------------------- ### Timer:get_remaining_count Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Timer.md Gets the number of times the timer can still execute. ```APIDOC ## Timer:get_remaining_count ### Description Returns the number of remaining executions allowed for this timer. ### Returns - **count** (integer) - The remaining count. ``` -------------------------------- ### Develop.Helper.Explorer.createGameTimer Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a game timer node in the explorer. ```APIDOC ## Develop.Helper.Explorer.createGameTimer ### Description Creates a game timer node in the explorer. ### Function Signature ```lua function Develop.Helper.Explorer.createGameTimer() -> Develop.Helper.TreeNode ``` ``` -------------------------------- ### Timer:get_init_count Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Timer.md Gets the initial count value the timer was set with. ```APIDOC ## Timer:get_init_count ### Description Retrieves the original count value that the timer was initialized with. ### Returns - **count** (integer) - The initial count of the timer. ``` -------------------------------- ### Introduce LocalUILogic Tool Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md A new tool class, LocalUILogic, is added for binding logic to local UI controls. Refer to 'y3\demo\demo\UI' for usage examples. ```lua LocalUILogic ``` -------------------------------- ### Buff:get_max_stack Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the maximum stack count of the magical effect. ```APIDOC ## Buff:get_max_stack ### Description Gets the maximum stack count of the magical effect. ### Method (method) ### Returns * `stack` (integer) - The maximum number of stacks. ``` -------------------------------- ### Timer:execute Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Timer.md Immediately executes the timer's action. ```APIDOC ## Timer:execute ### Description Immediately triggers the execution of the timer's associated action. ### Parameters - **...any** - Optional - Arguments to pass to the timer's execution. ``` -------------------------------- ### Getting Ability Level in Y3 Lua Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Retrieves the current level of an ability. ```lua Ability:get_level() -> integer ``` -------------------------------- ### Register New Recipe Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Synthesis.md Registers a new synthesis recipe, specifying the resulting item and the list of ingredients required. ```lua Synthesis:register(result: any, ingredients: any[]) ``` -------------------------------- ### Object Icon Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md An interface to get the icon of various game objects. ```APIDOC ## y3.game.get_obj_icon ### Description Gets the icon for units, items, abilities, or magic effects. ### Method y3.game.get_obj_icon(object_type, object_id) ``` -------------------------------- ### Timer:get_time_out_time Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Timer.md Gets the total time duration the timer was set to run for. ```APIDOC ## Timer:get_time_out_time ### Description Returns the total duration the timer was configured to operate for. ### Returns - **time** (number) - The total timeout time in seconds. ``` -------------------------------- ### Player Platform Shop Interaction Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Function to request opening the platform shop for purchasing items. This initiates the in-game store interface. ```lua Player:open_platform_shop() ``` -------------------------------- ### Buff:get_buff_aura_effect_key Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Gets the aura effect type ID of the magical effect. ```APIDOC ## Buff:get_buff_aura_effect_key ### Description Gets the aura effect type ID of the magical effect. ### Method (method) ### Returns * `type` (py.ModifierKey) - The aura effect type ID. ``` -------------------------------- ### y3.item.get_item_sell_price_by_key Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Gets the sell price of an item by its key, supporting player display names. ```APIDOC ## y3.item.get_item_sell_price_by_key ### Description Retrieves the price at which an item can be sold, identified by its key. This function also supports using the player's display name for context. ### Method Not specified (assumed to be a function call) ### Endpoint Not applicable (Lua function) ### Parameters - `item_key` (string): The key identifier of the item. - `player_display_name` (string, optional): The display name of the player for context. ### Request Example ```lua local sell_price = y3.item.get_item_sell_price_by_key('rare_gem', 'PlayerName') ``` ### Response - `number`: The sell price of the item. ``` -------------------------------- ### y3.item.get_item_buy_price Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Gets the buy price of an item, supporting player display names as parameters. ```APIDOC ## y3.item.get_item_buy_price ### Description Retrieves the price at which an item can be bought. This function now supports using the player's display name as a parameter for context. ### Method Not specified (assumed to be a function call) ### Endpoint Not applicable (Lua function) ### Parameters - `item_key` (string): The key identifier of the item. - `player_display_name` (string, optional): The display name of the player for context. ### Request Example ```lua local price = y3.item.get_item_buy_price('potion', 'PlayerName') ``` ### Response - `number`: The buy price of the item. ``` -------------------------------- ### Area:random_point Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Area.md Gets a random point within the area. Returns a Point object. ```APIDOC ## Area:random_point() ### Description Gets a random point within the area. ### Returns - Point: A Point object representing a random point within the area. ``` -------------------------------- ### Show InputBox with Callback Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Displays the InputBox to the user and calls the provided callback function upon completion. The callback receives the input value, or nil if cancelled. ```lua (method) Develop.Helper.InputBox:show(callback: fun(value?: string)) ``` -------------------------------- ### Tracking Motion Parameters Update Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Adds 'initial angle' and 'transition time' parameters to tracking motion. ```APIDOC ## Tracking Motion Parameters Update ### Description Tracking motion now includes parameters for 'initial angle' and 'transition time' for more advanced control. ### Parameters - `initial_angle` (number) - The starting angle for the motion. - `transition_time` (number) - The duration of the transition to the target. ``` -------------------------------- ### Develop.TriggerWatcherInstance Properties Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Properties for a TriggerWatcherInstance, including start and end times, and run-related data. ```APIDOC ## endTime ```lua unknown ``` 结束时间(毫秒) ``` ```APIDOC ## originalExecute ```lua function ``` ``` ```APIDOC ## runnedCallback ```lua table ``` ``` ```APIDOC ## runnedClock ```lua table ``` ``` ```APIDOC ## runnedCost ```lua table ``` ``` ```APIDOC ## startTime ```lua unknown ``` 开始时间(毫秒) ``` -------------------------------- ### Create Point Light at a Specific Point Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Light.md Creates a point light source at a given 3D coordinate. Use this to illuminate areas from a fixed position. ```lua function Light.create_point_light_at_point(point: Point, deviation_height: number) -> Light ``` -------------------------------- ### Develop.TriggerWatcher Methods Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Methods for managing the TriggerWatcher, including counting, starting, stopping, and reporting. ```APIDOC ## count ```lua function Develop.TriggerWatcher.count() -> { all: integer, alive: integer } ``` ``` ```APIDOC ## report ```lua function Develop.TriggerWatcher.report() -> { count: integer, cost: number, time: number, average: number, tops: string[] }|nil ``` 获取监控报告 ``` ```APIDOC ## start ```lua function Develop.TriggerWatcher.start() ``` 开始监控触发器 ``` ```APIDOC ## stop ```lua function Develop.TriggerWatcher.stop() ``` 停止监控触发器 ``` -------------------------------- ### Light.create_point_light_at_point Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Light.md Creates a point light at a specified point in the world. ```APIDOC ## Light.create_point_light_at_point ### Description Creates a point light at a specified point in the world. @param `point` — Target point. @param `deviation_height` — Height offset. ### Parameters * **point** (Point) - The target point. * **deviation_height** (number) - The height offset. ### Returns * **Light** - The created point light. ``` -------------------------------- ### Timer Operations Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Interfaces for interacting with timers, including getting elapsed, remaining, and timeout times. ```APIDOC ## Timer Operations ### Description Provides access to timer-related information, including elapsed time, remaining time, and timeout time. These functions return numerical values. ### Interfaces - **Get elapsed time:** `Timer:get_elapsed_time(): number` - **Get remaining time:** `Timer:get_remaining_time(): number` - **Get time out time:** `Timer:get_time_out_time(): number` ``` -------------------------------- ### Light.create_spot_light_at_unit_socket Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Light.md Creates a spot light at a specified socket on a unit. ```APIDOC ## Light.create_spot_light_at_unit_socket ### Description Creates a spot light at a specified socket on a unit. @param `unit` — Target unit. @param `socket_name` — Socket name. @param `pos_offset_y` — Vertical offset for the light position. @param `target_unit` — Target unit for the spot light. @param `target_offset_y` — Vertical offset for the target point. ### Parameters * **unit** (Unit) - The target unit. * **socket_name** (string) - The name of the socket. * **pos_offset_y** (number, optional) - The vertical offset for the light position. * **target_unit** (Unit, optional) - The target unit for the spot light. * **target_offset_y** (number, optional) - The vertical offset for the target point. ### Returns * **Light** - The created spot light. ``` -------------------------------- ### Light.create_lua_light_by_py Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Light.md Creates a Lua light object from a Python light object. ```APIDOC ## Light.create_lua_light_by_py ### Description Creates a Lua light object from a Python light object. ### Parameters * **py_light** (py.Light) - The Python light object to convert. ### Returns * **light** (Light) - The created Lua light object. ``` -------------------------------- ### Get Buff Level Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the level of a buff. Use for buffs that have a level progression or scaling. ```lua (method) Buff:get_level() -> level: integer ``` -------------------------------- ### Initialize Y3 Development Assistant Connection Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Initializes the connection to the Y3 Development Assistant. If the game is launched via VSCode, this connection is automatic. Otherwise, it can be manually initiated. ```lua function Develop.Helper.init(port?: integer) ``` -------------------------------- ### Add y3.save_data.save_table Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface allows saving a Lua table. No specific setup is required. ```lua y3.save_data.save_table ``` -------------------------------- ### Use Editor Names as Parameters for Scene UI Creation Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md The following interfaces now accept editor names as parameters: `y3.scene_ui.create_scene_ui_at_point` and `y3.scene_ui.create_scene_ui_at_player_unit_socket`. ```lua y3.scene_ui.create_scene_ui_at_point ``` ```lua y3.scene_ui.create_scene_ui_at_player_unit_socket ``` -------------------------------- ### Set Particle Color Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface sets the color of a particle effect. No specific setup is required. ```lua Particle:set_color ``` -------------------------------- ### Hot Reloading Support Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Initial support for hot reloading has been added, with a demonstration available in `演示/热重载/演示.lua`. The `include` function is used for this purpose. ```APIDOC ## Hot Reloading Support ### Description Initial implementation of hot reloading functionality, allowing scripts to be reloaded without restarting the game. A demonstration is provided in `演示/热重载/演示.lua`. ### Interface - **Include for hot reloading:** `include(filepath: string)` ``` -------------------------------- ### y3.game.load_sub_scene Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Creates a terrain preset by loading a sub-scene. ```APIDOC ## y3.game.load_sub_scene ### Description Loads a sub-scene to create or define a terrain preset. ### Method `y3.game.load_sub_scene(scene_name: string, preset_data: table?): TerrainPreset` ### Parameters #### Path Parameters - `scene_name` (string) - The name of the sub-scene to load. - `preset_data` (table, optional) - Data used to configure the terrain preset. ``` -------------------------------- ### Logging Configuration Options Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md New configuration options for controlling log levels and output destinations. ```APIDOC ## Logging Configuration Options ### Description Provides configuration settings to control the verbosity and output of log messages. ### Configuration Options - `y3.const.log.level = 'debug'` - Sets the minimum log level to display. Only logs with a level higher than this will be shown. - `y3.const.log.toDiaglog = true` - Determines whether logs are printed to the Diaglog window. - `y3.const.log.toGame = false` - Determines whether logs are displayed in the game window. ``` -------------------------------- ### Get Root Node Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Represents the root of a tree structure. Its type is unknown, indicating flexibility in its representation. ```lua unknown ``` -------------------------------- ### UI Grid View Configuration Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md A comprehensive set of functions for configuring and managing UI grid views, including adding components, setting layout, dimensions, spacing, alignment, scrolling, and adaptive sizing. ```lua UI:insert_ui_gridview_comp(grid_comp, comp) UI:set_ui_gridview_type(grid_comp, type) UI:set_ui_gridview_count(grid_comp, count) UI:set_ui_gridview_size(grid_comp, width, height) UI:set_ui_gridview_margin(grid_comp, margin) UI:set_ui_gridview_space(grid_comp, space) UI:set_ui_gridview_align(grid_comp, align) UI:set_ui_gridview_scroll(grid_comp, enable) UI:set_ui_gridview_size_adaptive(grid_comp, enable) UI:set_ui_gridview_bar_percent(grid_comp, percent) ``` -------------------------------- ### Get Buff Owner Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the unit that owns or is affected by the buff. Use to identify the target of the buff. ```lua (method) Buff:get_owner() -> owner: Unit? ``` -------------------------------- ### Develop.Helper.requestCommand Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Sends a command to the Y3 Development Assistant. ```APIDOC ## Develop.Helper.requestCommand ### Description Sends a command to the Y3 Development Assistant. ### Function Signature ```lua function Develop.Helper.requestCommand(command: string, args?: any[], callback?: fun(result: any)) ``` ### Parameters * `callback` - Optional - A callback function to receive the result. ``` -------------------------------- ### Get Buff Description Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the description of a buff object. Use to display information about the buff to the user. ```lua (method) Buff:get_description() -> description: string ``` -------------------------------- ### Create Game Speed UI Element Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a UI element for controlling game speed. ```lua function Develop.Helper.Explorer.createGameSpeed() ``` -------------------------------- ### Create Restart Game Button UI Element Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a UI element for a restart game button. Returns an unknown type. ```lua function Develop.Helper.Explorer.createRestartGameButton() -> unknown ``` -------------------------------- ### Get Material Map Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Synthesis.md Retrieves the material map, which details which materials can be used to synthesize which target items. ```lua Synthesis:get_material_map() -> table> ``` -------------------------------- ### Develop.Helper.Explorer.createUnitButton Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a button node for a unit in the explorer. ```APIDOC ## Develop.Helper.Explorer.createUnitButton ### Description Creates a button node for a unit in the explorer. ### Function Signature ```lua function Develop.Helper.Explorer.createUnitButton(unit: Unit) -> Develop.Helper.TreeNode ``` ``` -------------------------------- ### Create Selecting Button UI Element Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a UI element for a selecting button. Returns an unknown type. ```lua function Develop.Helper.Explorer.createSelectingButton() -> unknown ``` -------------------------------- ### Add Unit:is_hero Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface checks if a unit is classified as a hero. No specific setup is required. ```lua Unit:is_hero ``` -------------------------------- ### Selector:pick Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Selects entities and returns them as an array of units. ```APIDOC ## Selector:pick ### Description Selects entities based on certain criteria and returns them as a Lua array (table) of unit objects. ### Method Not specified (assumed to be a method call on a Selector object) ### Endpoint Not applicable (Lua method) ### Parameters None explicitly defined in the source, implies it operates on a pre-defined selection or context. ### Request Example ```lua local selected_units = Selector:pick() ``` ### Response - `table`: A table containing the selected unit objects. ``` -------------------------------- ### Add UnitGroup:clear() Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface clears all units from a unit group. No specific setup is required. ```lua UnitGroup:clear() ``` -------------------------------- ### LocalUILogic:on_init Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Registers a callback function to be executed when a control's initialization is complete. ```APIDOC ## LocalUILogic:on_init ### Description Allows subscribing to an event that fires when a UI control has finished its initialization process. ### Method Not specified (assumed to be a method call on a LocalUILogic object) ### Endpoint Not applicable (Lua method) ### Parameters - `callback` (function): The function to execute upon control initialization. ### Request Example ```lua localUILogic:on_init(function(control) print('Control initialized:', control.name) end) ``` ### Response None explicitly defined in the source. ``` -------------------------------- ### Add PlayerGroup:clear() Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface clears all players from a player group. No specific setup is required. ```lua PlayerGroup:clear() ``` -------------------------------- ### Interface Registration Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Enables registration of interfaces, key presses, and mouse events on players. ```APIDOC ## Interface Registration ### Description Allows for the registration of interfaces, key press events, and mouse events directly on player objects. ### Functionality - Register interfaces on players. - Register key press events on players. - Register mouse events on players. ``` -------------------------------- ### Create Reference Watcher UI Element Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a UI element for watching references. Returns a Develop.Helper.TreeNode. ```lua function Develop.Helper.Explorer.createRefWatcher() -> Develop.Helper.TreeNode ``` -------------------------------- ### Develop.Helper.TreeView Methods Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Methods for managing Develop.Helper.TreeView objects. ```APIDOC ## remove ```lua (method) Develop.Helper.TreeView:remove() ``` ``` -------------------------------- ### Add Unit:get_camp_id Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the team ID of a unit. No specific setup is required. ```lua Unit:get_camp_id ``` -------------------------------- ### Player:request_use_item Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Requests to use a shop item, with success notification via callback. ```APIDOC ## Player:request_use_item ### Description Requests the use of a shop item. The result of the item usage (success or failure) is communicated via a callback function. ### Method `Player:request_use_item(item_id: string, callback: function)` ### Parameters #### Path Parameters - `item_id` (string) - The identifier of the shop item to use. - `callback` (function) - A function to be called with the result of the item usage. ``` -------------------------------- ### Get TreeNode Child Nodes Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Represents an array of Develop.Helper.TreeNode objects, typically used to access child nodes. ```lua Develop.Helper.TreeNode[] ``` -------------------------------- ### Renaming UI Prefab Creation and Removal Interfaces Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Simplifies the interface names for creating and removing UI prefabs. ```lua y3.ui_prefab.create_ui_prefab_instance -> y3.ui_prefab.create ``` ```lua UIPrefab:remove_ui_prefab -> UIPrefab:remove ``` -------------------------------- ### Get Buff Passed Time Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the elapsed duration of a buff. Use to track how long a buff has been active. ```lua (method) Buff:get_passed_time() -> duration: number ``` -------------------------------- ### Get Buff Key Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the key identifier for a buff. Use to uniquely identify the type or category of a buff. ```lua (method) Buff:get_key() -> buff_key: py.ModifierKey ``` -------------------------------- ### Get Cycle Time from Buff Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the cycle time of a buff. Use to check the duration of periodic effects. ```lua (method) Buff:get_cycle_time() -> time: number ``` -------------------------------- ### Get Buff Type Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the type of a buff. Use to categorize the buff (e.g., positive, negative, status). ```lua (method) Buff:get_buff_type() -> type: y3.Const.ModifierType ``` -------------------------------- ### Add UI:set_anim_pos Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface sets the animation position for UI elements. No specific setup is required. ```lua UI:set_anim_pos ``` -------------------------------- ### ECAFunction:with_param Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/ECAFunction.md Adds a parameter definition to the ECAFunction configuration. ```APIDOC ## ECAFunction:with_param ### Description Adds a parameter to the ECAFunction, specifying its key and type. ### Method Signature ```lua (method) ECAFunction:with_param(key: string, type_name: string) -> ECAFunction ``` ### Parameters * **key** (string) - The name of the parameter. * **type_name** (string) - The data type of the parameter. ``` -------------------------------- ### Unit:get_exp Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Unit.md Retrieves the current experience points of the unit. ```APIDOC ## Unit:get_exp ### Description Retrieves the current experience points of the unit. ### Method (method) ### Returns - exp (integer) - The current experience points. ``` -------------------------------- ### Add UI:set_absolute_pos Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface sets the absolute coordinates for a UI control. No specific setup is required. ```lua UI:set_absolute_pos ``` -------------------------------- ### Develop.Helper.Explorer.createTimerWatcher Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a timer watcher node in the explorer. ```APIDOC ## Develop.Helper.Explorer.createTimerWatcher ### Description Creates a timer watcher node in the explorer. ### Function Signature ```lua function Develop.Helper.Explorer.createTimerWatcher() -> Develop.Helper.TreeNode ``` ``` -------------------------------- ### UIPrefab:kv_load Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Loads a value by its key from the UIPrefab's saved key-value pairs. ```APIDOC ## UIPrefab:kv_load ### Description Loads a value previously saved using `kv_save` for this UIPrefab instance. ### Method Not specified (assumed to be a method call on a UIPrefab object) ### Endpoint Not applicable (Lua method) ### Parameters - `key` (string): The key of the value to load. ### Request Example ```lua local setting = uiprefab:kv_load('user_setting') ``` ### Response - `any`: The loaded value, or nil if the key does not exist. ``` -------------------------------- ### Get Buff Name Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the name of a buff object. Use to display the buff's name in game interfaces. ```lua (method) Buff:get_name() -> name: string ``` -------------------------------- ### Get Buff Effect Type Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Buff.md Retrieves the effect type of a buff. Use to understand how the buff influences game mechanics. ```lua (method) Buff:get_buff_effect_type() -> type: y3.Const.EffectType ``` -------------------------------- ### Request Command with Arguments Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Send a command with optional arguments to the Y3 Development Assistant. A callback can be provided to receive the result. ```lua function Develop.Helper.requestCommand(command: string, args?: any[], callback?: fun(result: any)) ``` -------------------------------- ### Unit.get_description_by_key Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Unit.md Retrieves the description for a specific unit type using its key. ```APIDOC ## Unit.get_description_by_key ### Description Retrieves the description for a unit type by its key. ### Method function ### Parameters #### Path Parameters - unit_key (py.UnitKey) - The key identifying the unit type. ### Returns - des (string) - The description of the unit type. ``` -------------------------------- ### Develop.Helper.TreeView Properties Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Properties for Develop.Helper.TreeView, including its ID, name, and root node. ```APIDOC ## id ```lua integer ``` ``` ```APIDOC ## name ```lua string ``` ``` ```APIDOC ## root ```lua Develop.Helper.TreeNode ``` ``` -------------------------------- ### Unit:learn Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Unit.md Allows a unit to learn a new ability. ```APIDOC ## Unit:learn ### Description Allows a unit to learn a new ability. ### Method (method) ### Parameters #### Path Parameters - **ability_key** (py.AbilityKey) - Required - The ID of the ability to learn. ``` -------------------------------- ### Add UI:set_equip_slot_drag_operation Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface sets the drag operation mode for an equipment slot. No specific setup is required. ```lua UI:set_equip_slot_drag_operation ``` -------------------------------- ### Create Spot Light Pointing to a Specific Point Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Light.md Creates a spot light that illuminates a target point in the scene. Useful for focused lighting effects. ```lua function Light.create_spot_light_to_point(point: Point, pos_offset_y?: number, unit_point_projectile?: Point|Projectile|Unit, target_offset_y?: number) -> Light ``` -------------------------------- ### Add PlayerGroup:count() Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface returns the number of players within a player group. No specific setup is required. ```lua PlayerGroup:count() ``` -------------------------------- ### Develop.Helper.Explorer.createMemoryWatcher Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a memory watcher node in the explorer. ```APIDOC ## Develop.Helper.Explorer.createMemoryWatcher ### Description Creates a memory watcher node in the explorer. ### Function Signature ```lua function Develop.Helper.Explorer.createMemoryWatcher() -> Develop.Helper.TreeNode ``` ``` -------------------------------- ### Create Memory Watcher UI Element Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Creates a UI element for watching memory. Returns a Develop.Helper.TreeNode. ```lua function Develop.Helper.Explorer.createMemoryWatcher() -> Develop.Helper.TreeNode ``` -------------------------------- ### Add Unit:get_icon Interface for Unit Avatar Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the avatar icon for a unit. No specific setup is required. ```lua Unit:get_icon ``` -------------------------------- ### Add Player:get_selecting_group Interface Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md This interface retrieves the group of units currently selected by the player. No specific setup is required. ```lua Player:get_selecting_group ``` -------------------------------- ### Adding More Parameters to Unit Follow Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md The `Unit:follow` function has been updated to include additional parameters, offering more control over unit following behavior. ```lua Unit:follow(target, param1, param2, ...) ``` -------------------------------- ### Getting Ability by Sequence Source: https://github.com/y3-editor/y3-lualib/blob/main/更新日志.md Retrieves an ability object from a unit based on its sequence number, useful for accessing specific abilities in order. ```lua Unit:get_ability_by_seq(unit, sequence_number) ``` -------------------------------- ### InputBox Optional Settings Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Optional settings for an InputBox, mirroring VSCode's interface for input boxes. ```lua boolean ``` ```lua boolean ``` ```lua string ``` ```lua string ``` ```lua string ``` ```lua fun(value: string):string|nil ``` ```lua string ``` ```lua [integer, integer] ``` -------------------------------- ### Develop.Command.input Source: https://github.com/y3-editor/y3-lualib/blob/main/doc/API/Develop.md Simulates inputting a cheat command. ```APIDOC ## Develop.Command.input ### Description Simulates inputting a cheat command. This feature is only effective in development mode. ### Method Develop.Command.input ### Parameters - `prefix` (string) - Required - The prefix for the command input. - `input` (string) - Required - The command string to input. - `player` (Player) - Optional - The player associated with the input. ```