Prototype/Character: Difference between revisions
(Converted to SMW format) |
(0.18.22: footstep_particle_triggers changes) |
||
Line 75: | Line 75: | ||
{{Prototype property|footstep_particle_triggers|[[Types/table|table]] of [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]]|optional=true}} | {{Prototype property|footstep_particle_triggers|[[Types/table|table]] of [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]]|optional=true}} | ||
Array of [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]]. Each [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]] needs the extra mandatory property <code>tiles</code>, which is a [[Types/table|table]] (array) of [[Types/string|string]] which is the name of a tile. | Array of [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]]. Each [[Types/CreateParticleTriggerEffectItem|CreateParticleTriggerEffectItem]] needs the extra mandatory property <code>tiles</code>, which is a [[Types/table|table]] (array) of [[Types/string|string]] which is the name of a tile.<br> | ||
Alternatively, instead of specifying the CreateParticleTriggerEffectItem directly in the table with the <code>tiles</code> property, a <code>actions</code> property that is an array of CreateParticleTriggerEffectItem can be specified in the table with the <code>tiles</code> property. | |||
Examples: | |||
<syntaxhighlight lang="lua">footstep_particle_triggers = | |||
{ | |||
{ | |||
tiles = { "water", "water-shallow" }, | |||
type = "create-particle", | |||
particle_name = "water-particle", | |||
.... | |||
}, | |||
{ | |||
tiles = { "grass-1", "grass-2" }, | |||
type = "create-particle", | |||
particle_name = "grass-particle", | |||
.... | |||
}, | |||
.... | |||
}</syntaxhighlight> | |||
<syntaxhighlight lang="lua">footstep_particle_triggers = | |||
{ | |||
{ | |||
tiles = { "water", "water-shallow" }, | |||
actions = | |||
{ | |||
{ | |||
type = "create-particle", | |||
particle_name = "water-particle-1", | |||
.... | |||
}, | |||
{ | |||
type = "create-particle", | |||
particle_name = "water-particle-2", | |||
.... | |||
}, | |||
.... | |||
} | |||
}, | |||
{ | |||
tiles = { "grass-1", "grass-2" }, | |||
actions = | |||
{ | |||
{ | |||
type = "create-particle", | |||
particle_name = "grass-particle-1", | |||
.... | |||
}, | |||
{ | |||
type = "create-particle", | |||
particle_name = "grass-particle-2", | |||
.... | |||
}, | |||
.... | |||
} | |||
}, | |||
}</syntaxhighlight> | |||
{{Prototype property|tool_attack_result|[[Types/Trigger|Trigger]]|optional=true}} | {{Prototype property|tool_attack_result|[[Types/Trigger|Trigger]]|optional=true}} |
Revision as of 13:14, 30 April 2020
Prototype definitions » PrototypeBase » Prototype/Entity » Prototype/EntityWithHealth » Prototype/EntityWithOwner » Prototype/Character
Entity that you move around on the screen during the campaign and freeplay.
Mandatory properties
Inherits all properties from Prototype/EntityWithHealth.
mining_speed
Type: double
running_speed
Type: double
distance_per_frame
Type: double
maximum_corner_sliding_distance
Type: double
heartbeat
Type: Sound
The sound file played when the character's health is low.
eat
Type: Sound
The sound file played when the character eats (fish for example).
inventory_size
Type: ItemStackIndex
build_distance
Type: uint32
drop_item_distance
Type: uint32
reach_distance
Type: uint32
reach_resource_distance
Type: double
item_pickup_distance
Type: double
loot_pickup_distance
Type: double
ticks_to_keep_gun
Type: uint32
ticks_to_keep_aiming_direction
Type: uint32
ticks_to_stay_in_combat
Type: uint32
damage_hit_tint
Type: Color
running_sound_animation_positions
Type: table of float
List of positions in the running animation when the walking sound is played.
running_sound_animation_positions = {14, 29}
mining_with_tool_particles_animation_positions
Type: table of float
List of positions in the mining with tool animation when the mining sound and mining particles are created.
mining_with_tool_particles_animation_positions = {28}
animations
Type: table of CharacterArmorAnimation
Optional properties
crafting_categories
Type: table of string
Names of the crafting categories the character can craft recipes from. The built-in categories can be found here. See also Prototype/RecipeCategory.
mining_categories
Type: table of string
Names of the resource categories the character can mine resources from.
light
Type: LightDefinition
enter_vehicle_distance
Type: double
Default: 3.0
Must be >= 0.
tool_attack_distance
Type: double
Default: 1.5
respawn_time
Type: uint32
Default: 10
Time in seconds. Must be positive
character_corpse
Type: string
Name of the character corpse that is spawned whend this character dies.
footstep_particle_triggers
Type: table of CreateParticleTriggerEffectItem
Array of CreateParticleTriggerEffectItem. Each CreateParticleTriggerEffectItem needs the extra mandatory property tiles
, which is a table (array) of string which is the name of a tile.
Alternatively, instead of specifying the CreateParticleTriggerEffectItem directly in the table with the tiles
property, a actions
property that is an array of CreateParticleTriggerEffectItem can be specified in the table with the tiles
property.
Examples:
footstep_particle_triggers =
{
{
tiles = { "water", "water-shallow" },
type = "create-particle",
particle_name = "water-particle",
....
},
{
tiles = { "grass-1", "grass-2" },
type = "create-particle",
particle_name = "grass-particle",
....
},
....
}
footstep_particle_triggers =
{
{
tiles = { "water", "water-shallow" },
actions =
{
{
type = "create-particle",
particle_name = "water-particle-1",
....
},
{
type = "create-particle",
particle_name = "water-particle-2",
....
},
....
}
},
{
tiles = { "grass-1", "grass-2" },
actions =
{
{
type = "create-particle",
particle_name = "grass-particle-1",
....
},
{
type = "create-particle",
particle_name = "grass-particle-2",
....
},
....
}
},
}
tool_attack_result
Type: Trigger