• Reference
  • LUA API
  • Classes
  • Projectile

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

VariableTypeDescription
tagstrTag name.
projectile:add_tag(tag)

remove_tag

Remove tag from a projectile.

Parameter

VariableTypeDescription
tagstrTag name.
projectile:remove_tag(tag)

create_projectile_at_unit_socket

A projectile will be created at the unit mount point.

Parameters

VariableTypeDescription
unitunitUnit.
socket_namestrMount point name.
directionnumberAngle.
belong_unitunitSubordinate unit.
belong_abilityabilitySubordinate ability.
visible_namenumberVisibility 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

VariableTypeDescription
unitunitUnit.
projectile:set_affiliated_unit(unit)

set_affiliated_ability

Set associated skills.

Parameter

VariableTypeDescription
abilityabilitySkill.
projectile:set_affiliated_ability(ability)

destroy

Destroy the projectile.

projectile:destroy()

set_height

Set height.

Parameter

VariableTypeDescription
heightnumberHeight.
projectile:set_height(height)

set_coordinate

Set coordinates.

Parameter

VariableTypeDescription
pointpointLocation point.
projectile:set_coordinate(point)

set_orientation

Set orientation.

Parameter

VariableTypeDescription
directionnumberFacing angle.
projectile:set_orientation(direction)

set_rotation

Set rotation.

Parameters

VariableTypeDescription
xnumberRotation.
ynumberRotation.
znumberRotation.
projectile:set_rotation(x, y, z)

set_scale

Set zoom.

Parameters

VariableTypeDescription
xnumberZoom factor.
ynumberZoom factor.
znumberZoom factor.
projectile:set_scale(x, y, z)

set_animation_speed

Set animation speed.

Parameter

VariableTypeDescription
speednumberPlayback speed magnification.
projectile:set_animation_speed(speed)

set_duration

Set duration.

Parameter

VariableTypeDescription
durationnumberDuration.
projectile:set_duration(duration)

increase_duration

Increase duration.

Parameter

VariableTypeDescription
durationnumberDuration.
projectile:increase_duration(duration)

get_type

Type of projectile.

Return value

TypeDescription
numberProjectile type ID.
projectile:get_type()

get_projectile_height

Get the height of the projectile.

Return value

TypeDescription
numberHeight.
projectile:get_projectile_height()

get_remaining_projectile_duration

Get the remaining duration of the projectile.

Return value

TypeDescription
numberRemaining duration.
projectile:get_remaining_projectile_duration()

affiliated_unit

Get the owner of the projectile.

Return value

TypeDescription
unitOwner of the projectile.
projectile:affiliated_unit()

get_projectile_orientation

Get projectile orientation.

Return value

TypeDescription
numberProjectile orientation.
projectile:get_projectile_orientation()

projectile_location_point

Get the point where the projectile is located.

Return value

TypeDescription
pointPoint where the projectile is located.
projectile:projectile_location_point()

has_tag

Whether the projectile own the tag or not.

Parameter

VariableTypeDescription
tagstrTag name.

Return value

TypeDescription
boolWhether to have the corresponding label.
projectile:has_tag(tag)

all_projectiles_in_filter_range

Filters all projectiles in range.

Return value

TypeDescription
tableGroups 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

TypeDescription
projectileProjectile.
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 )