Grid Object system
get_open_grid_points(id_or_obj)
gets a list of open grid location
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
agent id or object to check |
required |
Returns:
Name | Type | Description |
---|---|---|
set |
a set of Vec3 with x and y set |
grid_clear_detailed_status(id_or_obj)
clears the detailed status string of a grid object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
The agent id of object |
required |
grid_clear_speech_bubble(id_or_obj)
clear the speech bubble for a grid object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
agent id or object of the grid object |
required |
grid_clear_target(grid_obj_or_set)
Clear the target of a grid object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid_obj_or_set
|
agent
|
the id of the object or set |
required |
grid_close_list(grid_obj, the_set, max_dist=None, filter_func=None)
Find and target the closest object matching the criteria
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid_obj_or_set
|
agent set
|
The agent |
required |
target_set
|
agent set
|
The items to test. Defaults to None. |
required |
max_dist
|
float
|
max distance. Defaults to None. |
None
|
filter_func
|
_type_
|
additional filer function. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
list[CloseData]
|
CloseData list: The gird close data of the closest objects |
grid_closest(grid_obj, target_set=None, max_dist=None, filter_func=None)
Find and target the closest object matching the criteria
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid_obj_or_set
|
agent set
|
The agent |
required |
target_set
|
agent set
|
The items to test. Defaults to None. |
None
|
max_dist
|
float
|
max distance. Defaults to None. |
None
|
filter_func
|
_type_
|
additional filer function. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
CloseData |
CloseData
|
The gird close data of the closest object |
grid_detailed_status(id_or_obj, status, color=None)
sets the detailed status of a grid object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
Agent id or object |
required |
status
|
str
|
The detailed status string |
required |
color
|
str
|
change the color of the detailed status text. None does not change the current value |
None
|
grid_get_grid_data()
get the grid data from all the grid_data.json files
Returns:
Name | Type | Description |
---|---|---|
dict |
a dictionary of grid data objects key is a ship key |
grid_get_grid_theme()
get the grid data from all the grid_data.json files
Returns:
Name | Type | Description |
---|---|---|
dict |
a dictionary of grid data objects key is a ship key |
grid_objects(so_id)
get a set of agent ids of the grid objects on the specified ship
Parameters:
Name | Type | Description | Default |
---|---|---|---|
so_id
|
agent
|
agent id or object |
required |
Returns:
Name | Type | Description |
---|---|---|
set |
a set of agent ids |
grid_objects_at(so_id, x, y)
get a set of agent ids of the grid objects on the specified ship, at the location specified
Parameters:
Name | Type | Description | Default |
---|---|---|---|
so_id
|
agent
|
agent id or object |
required |
x
|
int
|
The x grid location |
required |
y
|
int
|
The y grid location |
required |
Returns:
Name | Type | Description |
---|---|---|
set |
a set of agent ids |
grid_short_status(id_or_obj, status, color=None, seconds=0, minutes=0)
sets the short status (tool tip) and speech bubble text of a grid object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
Agent id or object |
required |
status
|
str
|
The detailed status string |
required |
color
|
str
|
change the color of the detailed status text. None does not change the current value |
None
|
seconds
|
int
|
The seconds for the speech bubble |
0
|
minutes
|
(int): The minutes for the speech bubble |
0
|
grid_speech_bubble(id_or_obj, status, color=None, seconds=0, minutes=0)
sets the speech bubble text of a grid object. The text will disappear if the seconds/minutes are set
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_obj
|
agent
|
Agent id or object |
required |
status
|
str
|
The detailed status string |
required |
color
|
str
|
change the color of the detailed status text. None does not change the current value |
None
|
seconds
|
int
|
The seconds for the speech bubble |
0
|
minutes
|
(int): The minutes for the speech bubble |
0
|
grid_target(grid_obj_or_set, target_id, speed=0.01)
Set a grid object to target the location of another grid object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid_obj_or_set
|
agent
|
an id, object or set of agent(s) |
required |
target_id
|
agent
|
an agent id or object |
required |
speed
|
float
|
the speed to move. Defaults to 0.01. |
0.01
|
grid_target_closest(grid_obj_or_set, target_set=None, max_dist=None, filter_func=None)
Find and target the closest object matching the criteria
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid_obj_or_set
|
agent set
|
The agent |
required |
target_set
|
agent set
|
The items to test. Defaults to None. |
None
|
max_dist
|
float
|
max distance. Defaults to None. |
None
|
filter_func
|
_type_
|
additional filer function. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
GridCloseData |
The gird close data of the closest object |
grid_target_pos(grid_obj_or_set, x, y, speed=0.01)
Set the grid object go to the target location
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid_obj_or_set
|
agent
|
An id, object or set of grid object agent(s) |
required |
x
|
float
|
x location |
required |
y
|
float
|
y location |
required |
speed
|
float
|
The grid object speed. Defaults to 0.01. |
0.01
|