Prototype/Character: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Updated styling of prototype doc migration note)
(Removed old prototype docs)
 
Line 2: Line 2:


</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
{{Prototype parent|Prototype/EntityWithOwner}}
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 14:32, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/CharacterPrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.