Prototype/Achievement: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Prototypes/Achievement page added. Planning on finishing up the extensions.)
 
(Updated styling of prototype doc migration note)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Basics==
<div class="stub"><p>'''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/AchievementPrototype.html https://lua-api.factorio.com/latest/prototypes/AchievementPrototype.html]
This Prototype Definition is used for the in-game achievements.  
 
==Extensions==
</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|PrototypeBase}}
This prototype definition is used for the in-game achievements.
 
{{Prototype TOC|achievement}}
 
== Extensions ==
*[[Prototype/BuildEntityAchievement]] '''build-entity-achievement'''
*[[Prototype/BuildEntityAchievement]] '''build-entity-achievement'''
*[[Prototype/CombatRobotCount]] '''combat-robot-count'''
*[[Prototype/CombatRobotCountAchievement]] '''combat-robot-count'''
*[[Prototype/ConstructWithRobotsAchievement]] '''construct-with-robots-achievement'''
*[[Prototype/ConstructWithRobotsAchievement]] '''construct-with-robots-achievement'''
*[[Prototype/DeconstructWithRobotsAchievement]] '''deconstruct-with-robots-achievement'''
*[[Prototype/DeconstructWithRobotsAchievement]] '''deconstruct-with-robots-achievement'''
Line 18: Line 27:
*[[Prototype/ResearchAchievement]] '''research-achievement'''
*[[Prototype/ResearchAchievement]] '''research-achievement'''
*[[Prototype/TrainPathAchievement]] '''train-path-achievement'''
*[[Prototype/TrainPathAchievement]] '''train-path-achievement'''
==Mandatory Properties==
== Mandatory properties ==
=== type ===
Inherits all properties from [[PrototypeBase]].
'''Type''': [[Types/string]]
 
Specification of the [[Prototypes/EntityPrototypeTypes|type]] of the prototype.
 
Built-in Achievement types:
  "build-entity-achievement",
  "research-achievement",
  "finish-the-game-achievement",
  "group-attack-achievement",
  "construct-with-robots-achievement",
  "deconstruct-with-robots-achievement",
  "deliver-by-robots-achievement",
  "train-path-achievement",
  "player-damaged-achievement",
  "produce-achievement",
  "produce-per-hour-achievement",
  "dont-use-entity-in-energy-production-achievement",
  "kill-achievement",
  "combat-robot-count",
  "dont-craft-manually-achievement",
  "dont-build-entity-achievement",
  "achievement",
 
=== name ===
'''Type''': [[Types/string]]
 
Unique identification of the prototype.
 
=== icon ===
'''Type''': [[Types/FileName]]
 
===steam_stats_name===
'''Type''': [[Types/string]]
 
Unusable by mods, as this refers to unlocking the achievement through Steam.
==General Optional Properties==
'''Note''': more achievement-specific types will be in their respective Prototype page.
 
===until_second===
'''Type''': [[Types/unsigned]]


This lets the game know how long into a game, before you can no longer complete the achievement.
{{Prototype property|icons, icon, icon_size (IconSpecification) |[[Types/IconSpecification|IconSpecification]]}}
== Optional properties ==


  until_second = 60 * 60 * 8, --8 hours. 60 being seconds, 60 being hours, and 8 being the amount of hours.
{{Prototype property|steam_stats_name|[[Types/string|string]]|""|optional=true}}
Unusable by mods, as this refers to unlocking the achievement through Steam.


===allowed_in_peaceful_mode===
{{Prototype property|allowed_without_fight |[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/bool]]
If this is set to false, it is not possible to complete the achievement on the peaceful difficulty setting or when the enemy base generation settings have been changed.


If this is set to false, you cannot complete the achievement on the peaceful difficulty setting.
{{Prototype property|hidden |[[Types/bool|bool]]|false|optional=true}}


== Example ==


==Example==
  <syntaxhighlight lang="lua">{
    type = "achievement",
    name = "so-long-and-thanks-for-all-the-fish",
    order = "g[secret]-a[so-long-and-thanks-for-all-the-fish]",
    icon = "__base__/graphics/achievement/so-long-and-thanks-for-all-the-fish.png",
    icon_size = 128
  }</syntaxhighlight>

Latest revision as of 10:42, 21 September 2023

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/AchievementPrototype.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.


Prototype definitions » PrototypeBase » Prototype/Achievement


This prototype definition is used for the in-game achievements.


Prototype/Achievement — achievement
icons, icon, icon_size (IconSpecification)::IconSpecification
allowed_without_fight::bool (optional)
hidden::bool (optional)
steam_stats_name::string (optional)
Inherited from PrototypeBase
name::string
type::string
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)

Extensions

Mandatory properties

Inherits all properties from PrototypeBase.

icons, icon, icon_size (IconSpecification)

Type: IconSpecification

Optional properties

steam_stats_name

Type: string
Default: ""
Unusable by mods, as this refers to unlocking the achievement through Steam.

allowed_without_fight

Type: bool
Default: true
If this is set to false, it is not possible to complete the achievement on the peaceful difficulty setting or when the enemy base generation settings have been changed.

hidden

Type: bool
Default: false

Example

{
    type = "achievement",
    name = "so-long-and-thanks-for-all-the-fish",
    order = "g[secret]-a[so-long-and-thanks-for-all-the-fish]",
    icon = "__base__/graphics/achievement/so-long-and-thanks-for-all-the-fish.png",
    icon_size = 128
  }