Prototype/Character: Difference between revisions
No edit summary |
(Some people in Discord have found this unclear) |
||
(20 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{Prototype parent|Prototype/EntityWithOwner}} | |||
Entity that you move around on the screen during the campaign and freeplay. | Entity that you move around on the screen during the campaign and freeplay. | ||
{{Prototype TOC|character}} | |||
== | == Mandatory properties == | ||
Inherits all properties from [[Prototype/EntityWithOwner]]. | |||
{{Prototype property|mining_speed|[[Types/double|double]]}} | |||
{{Prototype property|running_speed|[[Types/double|double]]}} | |||
{{Prototype property|distance_per_frame|[[Types/double|double]]}} | |||
{{Prototype property|maximum_corner_sliding_distance|[[Types/double|double]]}} | |||
{{Prototype property|heartbeat|[[Types/Sound|Sound]]}} | |||
The sound file played when the character's health is low. | |||
{{Prototype property|eat|[[Types/Sound|Sound]]}} | |||
The sound file played when the character eats (fish for example). | |||
{{Prototype property|inventory_size|[[Types/ItemStackIndex|ItemStackIndex]]}} | |||
Number of slots in the main inventory. May be 0. | |||
{{Prototype property|build_distance|[[Types/uint32|uint32]]}} | |||
{{Prototype property|drop_item_distance|[[Types/uint32|uint32]]}} | |||
{{Prototype property|reach_distance|[[Types/uint32|uint32]]}} | |||
{{Prototype property|reach_resource_distance|[[Types/double|double]]}} | |||
{{Prototype property|item_pickup_distance|[[Types/double|double]]}} | |||
{{Prototype property|loot_pickup_distance|[[Types/double|double]]}} | |||
{{Prototype property|ticks_to_keep_gun|[[Types/uint32|uint32]]}} | |||
{{Prototype property|ticks_to_keep_aiming_direction|[[Types/uint32|uint32]]}} | |||
{{Prototype property|ticks_to_stay_in_combat|[[Types/uint32|uint32]]}} | |||
{{Prototype property|damage_hit_tint|[[Types/Color|Color]]}} | |||
{{Prototype property|running_sound_animation_positions|[[Types/table|table]] of [[Types/float|float]]}} | |||
List of positions in the running animation when the walking sound is played. | |||
running_sound_animation_positions = {14, 29} | |||
{{Prototype property|mining_with_tool_particles_animation_positions|[[Types/table|table]] of [[Types/float|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} | |||
{{Prototype property|animations|[[Types/table|table]] of [[Types/CharacterArmorAnimation|CharacterArmorAnimation]]}} | |||
=== | == Optional properties == | ||
= | {{Prototype property|crafting_categories|[[Types/table|table]] of [[Types/string|string]]|empty table|optional=true}} | ||
Names of the crafting categories the character can craft recipes from. The built-in categories can be found [[Data.raw#recipe-category|here]]. See also [[Prototype/RecipeCategory]]. | |||
{{Prototype property|mining_categories |[[Types/table|table]] of [[Types/string|string]]|empty table|optional=true}} | |||
Names of the resource categories the character can mine resources from. | |||
{{Prototype property|light|[[Types/LightDefinition|LightDefinition]]|optional=true}} | |||
{{Prototype property|enter_vehicle_distance|[[Types/double|double]]|3.0|optional=true}} | |||
Must be >= 0. | |||
{{Prototype property|tool_attack_distance|[[Types/double|double]]|1.5|optional=true}} | |||
{{Prototype property|respawn_time|[[Types/uint32|uint32]]|10|optional=true}} | |||
Time in seconds. Must be positive | |||
{{Prototype property|has_belt_immunity|[[Types/bool|bool]]|false|optional=true}} | |||
Whether this character is moved by belts when standing on them. | |||
{{Prototype property|character_corpse|[[Types/string|string]]|optional=true}} | |||
Name of the character corpse that is spawned when this character dies. | |||
{{Prototype property|footstep_particle_triggers|[[Types/FootstepTriggerEffectList|FootstepTriggerEffectList]]|optional=true}} | |||
Triggered every tick of the running animation. | |||
{{Prototype property|synced_footstep_particle_triggers|[[Types/FootstepTriggerEffectList|FootstepTriggerEffectList]]|optional=true}} | |||
Triggered when the running animation ([[#animations]]) rolls over the frames defined in <code>right_footprint_frames</code> and <code>left_footprint_frames</code>. | |||
{{Prototype property|footprint_particles|[[Types/table|table]] of [[Types/FootprintParticle|FootprintParticle]]|optional=true}} | |||
Array of footprint particles. Triggered when the running animation ([[#animations]]) rolls over the frames defined in <code>right_footprint_frames</code> and <code>left_footprint_frames</code>. | |||
{{Prototype property|left_footprint_offset|[[Types/vector|vector]]|optional=true}} | |||
Offset from the center of the entity for the left footprint. Used by <code>footprint_particles</code>. | |||
{{Prototype property|right_footprint_offset|[[Types/vector|vector]]|optional=true}} | |||
Offset from the center of the entity for the right footprint. Used by <code>footprint_particles</code>. | |||
{{Prototype property|right_footprint_frames|[[Types/table|table]] of [[Types/float|float]]|optional=true}} | |||
An array of [[Types/float|float]]. The frames in the running animation ([[#animations]]) where the right foot touches the ground. | |||
{{Prototype property|left_footprint_frames|[[Types/table|table]] of [[Types/float|float]]|optional=true}} | |||
An array of [[Types/float|float]]. The frames in the running animation ([[#animations]]) where the left foot touches the ground. | |||
{{Prototype property|tool_attack_result|[[Types/Trigger|Trigger]]|optional=true}} | |||
Latest revision as of 11:06, 22 December 2022
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/EntityWithOwner.
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
Number of slots in the main inventory. May be 0.
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
Default: empty table
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
Default: empty table
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
has_belt_immunity
Type: bool
Default: false
Whether this character is moved by belts when standing on them.
character_corpse
Type: string
Name of the character corpse that is spawned when this character dies.
footstep_particle_triggers
Type: FootstepTriggerEffectList
Triggered every tick of the running animation.
synced_footstep_particle_triggers
Type: FootstepTriggerEffectList
Triggered when the running animation (#animations) rolls over the frames defined in right_footprint_frames
and left_footprint_frames
.
footprint_particles
Type: table of FootprintParticle
Array of footprint particles. Triggered when the running animation (#animations) rolls over the frames defined in right_footprint_frames
and left_footprint_frames
.
left_footprint_offset
Type: vector
Offset from the center of the entity for the left footprint. Used by footprint_particles
.
right_footprint_offset
Type: vector
Offset from the center of the entity for the right footprint. Used by footprint_particles
.
right_footprint_frames
Type: table of float
An array of float. The frames in the running animation (#animations) where the right foot touches the ground.
left_footprint_frames
Type: table of float
An array of float. The frames in the running animation (#animations) where the left foot touches the ground.
tool_attack_result
Type: Trigger