Projectile
Projectile is one of the basic elements in the project, which can be placed on the scene.
Functions
add_tag
Add a tag to a projectile.
Parameter
Variable | Type | Description |
---|---|---|
tag | str | Tag name. |
projectile:add_tag(tag)
remove_tag
Remove tag from a projectile.
Parameter
Variable | Type | Description |
---|---|---|
tag | str | Tag name. |
projectile:remove_tag(tag)
create_projectile_at_unit_socket
A projectile will be created at the unit mount point.
Parameters
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
socket_name | str | Mount point name. |
direction | number | Angle. |
belong_unit | unit | Subordinate unit. |
belong_ability | ability | Subordinate ability. |
visible_name | number | Visibility rule. |
projectile:create_projectile_at_unit_socket(unit, socket_name, direction, belong_unit, belong_ability, visible_name)
set_affiliated_unit
Set up the unit.
Parameter
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
projectile:set_affiliated_unit(unit)
set_affiliated_ability
Set associated skills.
Parameter
Variable | Type | Description |
---|---|---|
ability | ability | Skill. |
projectile:set_affiliated_ability(ability)
destroy
Destroy the projectile.
projectile:destroy()
set_height
Set height.
Parameter
Variable | Type | Description |
---|---|---|
height | number | Height. |
projectile:set_height(height)
set_coordinate
Set coordinates.
Parameter
Variable | Type | Description |
---|---|---|
point | point | Location point. |
projectile:set_coordinate(point)
set_orientation
Set orientation.
Parameter
Variable | Type | Description |
---|---|---|
direction | number | Facing angle. |
projectile:set_orientation(direction)
set_rotation
Set rotation.
Parameters
Variable | Type | Description |
---|---|---|
x | number | Rotation. |
y | number | Rotation. |
z | number | Rotation. |
projectile:set_rotation(x, y, z)
set_scale
Set zoom.
Parameters
Variable | Type | Description |
---|---|---|
x | number | Zoom factor. |
y | number | Zoom factor. |
z | number | Zoom factor. |
projectile:set_scale(x, y, z)
set_animation_speed
Set animation speed.
Parameter
Variable | Type | Description |
---|---|---|
speed | number | Playback speed magnification. |
projectile:set_animation_speed(speed)
set_duration
Set duration.
Parameter
Variable | Type | Description |
---|---|---|
duration | number | Duration. |
projectile:set_duration(duration)
increase_duration
Increase duration.
Parameter
Variable | Type | Description |
---|---|---|
duration | number | Duration. |
projectile:increase_duration(duration)
get_type
Type of projectile.
Return value
Type | Description |
---|---|
number | Projectile type ID. |
projectile:get_type()
get_projectile_height
Get the height of the projectile.
Return value
Type | Description |
---|---|
number | Height. |
projectile:get_projectile_height()
get_remaining_projectile_duration
Get the remaining duration of the projectile.
Return value
Type | Description |
---|---|
number | Remaining duration. |
projectile:get_remaining_projectile_duration()
affiliated_unit
Get the owner of the projectile.
Return value
Type | Description |
---|---|
unit | Owner of the projectile. |
projectile:affiliated_unit()
get_projectile_orientation
Get projectile orientation.
Return value
Type | Description |
---|---|
number | Projectile orientation. |
projectile:get_projectile_orientation()
projectile_location_point
Get the point where the projectile is located.
Return value
Type | Description |
---|---|
point | Point where the projectile is located. |
projectile:projectile_location_point()
has_tag
Whether the projectile own the tag or not.
Parameter
Variable | Type | Description |
---|---|---|
tag | str | Tag name. |
Return value
Type | Description |
---|---|
bool | Whether to have the corresponding label. |
projectile:has_tag(tag)
all_projectiles_in_filter_range
Filters all projectiles in range.
Return value
Type | Description |
---|---|
table | Groups of projectiles in range. |
projectile:all_projectiles_in_filter_range(point, filter_scope, filter_rule_name)
get_mover_bound_projectiles
Get kinematically bound projectiles.
Return value
Type | Description |
---|---|
projectile | Projectile. |
projectile. get_mover_bound_projectiles(data)
Events
Projectile triggers need to be contained in a group to use group variables.
Destructible created
Destructible creation.
local projectile_group = cli.projectile.create_projectile_trigger_group ( 1000001 )
projectile_group . add_trigger ( "Destructible created" , function ( data )
print ( "Destructible created" )
end )
Destructible revived
Destroyable resurrection.
local projectile_group = cli.projectile.create_projectile_trigger_group ( 1000001 )
projectile_group . add_trigger ( "Destructible revived" , function ( data )
print ( "Destroyable resurrection" )
end )
Destructible died
Destructible death event.
local projectile_group = cli.projectile.create_projectile_trigger_group ( 1000001 )
projectile_group . add_trigger ( "Destructible died" , function ( data )
print ( "Destroyable death event" )
end )
Destructible collected
Destructibles are harvested.
local projectile_group = cli.projectile.create_projectile_trigger_group ( 1000001 )
projectile_group . add_trigger ( "Destructible collected" , function ( data )
print ( "The destructible object is collected" )
end )
Destructible resource change
Changes in the amount of destructible resources.
local projectile_group = cli.projectile.create_projectile_trigger_group ( 1000001 )
projectile_group . add_trigger ( "Destructible resource change" , function ( data )
print ( "Changes in the amount of destructible resources" )
end )
Destructible hunted
Destructibles take damage.
local projectile_group = cli.projectile.create_projectile_trigger_group ( 1000001 )
projectile_group . add_trigger ( "Destructible hunted" , function ( data )
print ( "Destroyables take damage" )
end )