Destructible
Destructible is one of the basic elements in the project, which can be directly created on the map, generally immovable, and can interact with skills.
Functions
create_destructible
Create destructible.
Parameters
destructible.create_destructible(type_id, point, angle, scale_x, scale_y, scale_z, height)
destroy
Kill destructible.
Parameter
destructible: destroy(killer_unit)
delete
Delete destructible.
resurrect
Revive destructible.
move_to_point
Move to target point.
Parameter
destructible: move_to_point(point)
set_hp
Set health.
Parameter
destructible: set_hp(value)
add_hp
Increase current health.
Parameter
destructible:add_hp(value)
set_max_hp
Set max health.
Parameter
destructible: set_max_hp(value)
add_max_hp
Increase max health.
Parameter
destructible:add_max_hp(value)
set_current_resource_number
Set the current number of resources.
Parameter
destructible: set_current_resource_number(value)
add_current_resource_number
Increase the current resource count.
Parameter
destructible:add_current_resource_number(value)
set_max_resource_number
Set the maximum number of resources.
Parameter
destructible: set_max_resource_number(value)
add_max_resource_number
Increase the maximum number of resources.
Parameter
destructible:add_max_resource_number(value)
set_name
Set the name of the destructible.
Parameter
destructible: set_name(name)
set_description
Set the description of the destructible.
Parameter
destructible:set_description(description)
set_scale
Set the scale of the destructible.
Parameters
destructible: set_scale(x, y, z)
set_rotation
Set the destructible to face.
Parameter
destructible:set_rotation(angle)
set_height
Set the height of the destructible.
Parameter
destructible:set_height(height)
add_height
Increased height of destructibles.
Parameter
destructible:add_height(height)
set_lockable_by_ability
Whether the setting can be locked by the skill indicator.
Parameter
destructible:set_lockable_by_ability(is_lockable)
set_attackable
Whether the setting can be attacked or not.
Parameter
destructible:set_attackable(is_attackable)
set_selectable
Whether the setting can be selected or not.
Parameter
destructible:set_selectable(is_selectable)
set_gatherable
Whether the setting can be collected or not.
Parameter
destructible:set_gatherable(is_gatherable)
add_tag
Add label.
Parameter
destructible:add_tag(tag)
remove_tag
Remove label.
Parameter
destructible: remove_tag(tag)
play_animation.
Play animation.
Parameters
destructible:play_animation(anim_name, start_time, end_time, is_loop, speed)
stop_animation
Stop animation.
Parameter
destructible: stop_animation(anim_name)
replace_model
Replace model.
Parameter
destructible:replace_model(model_id)
cancel_replace_model
Cancel replace model.
Parameter
destructible: cancel_replace_model(model_id)
set_visible
Show/hide destructibles.
Parameter
destructible:set_visible(is_visible)
is_lockable_by_ability
Whether the destructible object can be selected by skill indicators or not.
Return value
destructible:is_lockable_by_ability()
is_attackable
Whether the destructible object can be attacked.
Return value
destructible:is_attackable()
is_selectable
Whether the destructible object can be selected.
Return value
destructible: is_selectable()
is_collectable
Whether the destructible object can be harvested.
Return value
destructible: is_collectable()
is_visible
Whether the destructible is visible or not.
Return value
destructible:is_visible()
is_alive
Whether the destructible is alive or not.
Return value
has_tag
Whether the destructible has a tag or not.
Parameters
Return value
destructible:has_tag(tag)
get_destructible_type
Get the destructible type.
Return value
destructible: get_destructible_type()
get_destructible_name
Get the name of the destructible.
Return value
destructible: get_destructible_name()
get_destructible_description
Get destructible description.
Return value
destructible: get_destructible_description()
get_destructible_current_hp
Get the health of a destructible.
Return value
destructible: get_destructible_current_hp()
get_destructible_source_name
Get the resource name of the destructible.
Return value
destructible: get_destructible_source_name()
get_destructible_max_hp
Get the maximum health of a destructible.
Return value
destructible: get_destructible_max_hp()
get_current_source_number
Get the current resource count of the destructible.
Return value
destructible: get_current_source_number()
get_max_source_number
Get the maximum number of resources for destructibles.
Return value
destructible: get_max_source_number()
get_resource_type
Get the player property of the destructible.
Return value
destructible: get_resource_type()
get_item_type
Get the item type of the destructible.
Return value
destructible: get_item_type()
get_model
Get the model of the destructible.
Return value
destructible: get_model()
get_height
Get the height of the destructible.
Return value
destructible: get_height()
get_rotation
Get the facing angle of the destructible.
Return value
destructible: get_rotation()
get_position
Get the position of the destructible object.
Return value
destructible: get_position()
get_name_by_type
Get the name of the destructible type.
Parameter
Return value
destructible. get_name_by_type(type)
get_description_by_type
Get the description of the destructible type.
Parameter
Return value
destructible. get_description_by_type(type)
get_model_by_type
Get the model of the destructible type.
Parameter
Return value
destructible. get_model_by_type(type)
destructible_in_event
Destructibles in events.
Parameter
Return value
up. destructible_in_event(data)
Event
Destroyable triggers need to be contained in a group to use group variables.