Area
The Area is one of the base elements within the project that can be controlled against a fixed region, triggering the unit to enter and leave the region event.
Functions
get_circle_area_by_scene_id
Get the circle area by scene ID.
Parameter
Variable | Type | Description |
---|---|---|
scene_id | number | ID in the edit scene. |
cli.get_circle_area_by_scene_id(scene_id)
get_rectangle_area_by_scene_id
Get the rectangle area by scene ID.
Parameter
Variable | Type | Description |
---|---|---|
scene_id | number | ID in the edit scene. |
cli.get_rectangle_area_by_scene_id(scene_id)
get_polygon_area_by_scene_id
Get polygon area by scene ID.
Parameter
Variable | Type | Description |
---|---|---|
scene_id | number | ID in the edit scene. |
cli.get_polygon_area_by_scene_id(scene_id)
get_lua_area_from_py
Create area from py object.
Parameters
Variable | Type | Description |
---|---|---|
py_area | table | Py layer object. |
type | table | See area.enum. |
area.get_lua_area_from_py(py_area, type)
add_trigger
Add a trigger to the area.
area:add_trigger(event_name, action)
remove_area
Remove an area.
area:remove()
set_collision
Set area collision.
Parameters
Variable | Type | Description |
---|---|---|
is_collision_effect | boolean | Whether collision is in effect. |
is_land_effect | boolean | Ground collision switch. |
is_air_effect | boolean | Aerial collision switch. |
area:set_collision(is_collision_effect, is_land_effect, is_air_effect)
add_tag
Add a tag to the area.
Parameter
Variable | Type | Description |
---|---|---|
tag | string | Tag. |
area:add_tag(tag)
remove_area_tag
Remove a tag from an area.
Parameter
Variable | Type | Description |
---|---|---|
tag | string | Tag. |
area:remove_area_tag(tag)
has_tag
Whether the area has a tag or not.
Parameter
Variable | Type | Description |
---|---|---|
tag | string | Tag. |
Return
Type | Description |
---|---|
boolean | Whether the region has tag. |
area:has_tag(tag)
set_area_visibility
Set the visibility of the polygon area to the player.
Parameters
Variable | Type | Description |
---|---|---|
player | player | Player. |
is_visibility | boolean | Whether to turn on visibility. |
is_real_visibility | boolean | Whether to turn on real visibility. |
area:set_area_visibility(player, is_visibility, is_real_visibility)
set_circle_area_radius
Set the radius of the circle area.
Parameter
Variable | Type | Description |
---|---|---|
radius | number | Radius. |
area:set_circle_area_radius(radius)
set_rectangle_area_size
Set the radius of the rectangle area.
Parameters
Variable | Type | Description |
---|---|---|
horizontal_length | number | Length. |
vertical_length | number | Width. |
area:set_rectangle_area_size(horizontal_length, vertical_length)
get_circle_area_radius
Get the radius of the circle area.
Return
Type | Description |
---|---|
number | Radius. |
area:get_circle_area_radius()
get_circle_area_min_x
Get the minimum X coordinate in the circle area.
Return
Type | Description |
---|---|
number | X coordinate. |
area:get_circle_area_min_x()
get_circle_area_min_y
Get the minimum Y coordinate in the circle area.
Return
Type | Description |
---|---|
number | Y coordinate. |
area:get_circle_area_min_y()
get_circle_area_max_x
Get the maximum X coordinate in the circle area.
Return
Type | Description |
---|---|
number | X coordinate. |
area:get_circle_area_max_x()
get_circle_area_max_y
Get the maximum Y coordinate in the circle area.
Return
Type | Description |
---|---|
number | Y coordinate. |
area:get_circle_area_max_y()
get_rectangle_area_min_x
Get the minimum X coordinate in the rectangle area.
Return
Type | Description |
---|---|
number | X coordinate. |
area:get_rectangle_area_min_x()
get_rectangle_area_min_y
Get the minimum Y coordinate in the rectangle area.
Return
Type | Description |
---|---|
number | Y coordinate. |
area:get_rectangle_area_min_y()
get_rectangle_area_max_x
Get the maximum X coordinate in the rectangle area.
Return
Type | Description |
---|---|
number | X coordinate. |
area:get_rectangle_area_max_x()
get_rectangle_area_max_y
Get the maximum Y coordinate in the rectangle area.
Return
Type | Description |
---|---|
number | Y coordinate. |
area:get_rectangle_area_max_y()
get_circle_area_center_point
Get the center point of the circle area.
Return
Type | Description |
---|---|
point | Point. |
area:get_circle_area_center_point()
get_random_point_in_circle_area
Get random points in a circle area.
Return
Type | Description |
---|---|
point | Point. |
area:get_random_point_in_circle_area()
get_rectangle_area_center_point
Get the rectangle area center point.
Return
Type | Description |
---|---|
point | Point. |
area:get_rectangle_area_center_point()
get_random_point_in_rectangle_area
Get random points in rectangle area.
Return
Type | Description |
---|---|
point | Point. |
area:get_random_point_in_rectangle_area()
get_weather
Get the weather of the area.
Return
Type | Description |
---|---|
number | Weather enumeration. |
area:get_weather()
get_all_unit_in_area
All units (groups of units) in the area.
Return
Type | Description |
---|---|
table | Unit group. |
area:get_all_unit_in_area()
get_unit_group_in_area
Player units in area (unit group).
Parameter
Variable | Type | Description |
---|---|---|
player | player | Player. |
Return
Type | Description |
---|---|
table | Unit group. |
area:get_unit_group_in_area(player)
get_unit_num_in_area
The number of units in the area.
Return
Type | Description |
---|---|
number | Number. |
area:get_unit_num_in_area()
get_usable_map_range
Get the full map area.
area.get_usable_map_range()
get_rectangle_area_last_created
Get the last created rectangle area.
area.get_rectangle_area_last_created()
create_circle_area
Create a circular area.
Parameters
Variable | Type | Description |
---|---|---|
point | point | Point. |
radius | number | Radius. |
Return
Type | Description |
---|---|
area | Circular area. |
area.create_circle_area(point, radius)
create_rectangle_area
Creates a rectangle area.
Parameters
Variable | Type | Description |
---|---|---|
point | point | Point. |
horizontal_length | number | Length. |
vertical_length | number | Width. |
Return
Type | Description |
---|---|
area | Rectangular area. |
area.create_rectangle_area(point, horizontal_length, vertical_length)
create_rectangle_area_from_two_points
Creates a rectangle area from two points.
Parameters
Variable | Type | Description |
---|---|---|
point_one | point | Point 1. |
point_two | point | Point 2. |
Return
Type | Description |
---|---|
area | Rectangular area. |
area.create_rectangle_area_from_two_points(point_one, point_two)
get_circle_areas_by_tag
Circle area -- iterate through the tags to do the action.
area.get_circle_areas_by_tag(tag)