Prototype/Achievement: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(0.16)
Line 1: Line 1:
==Basics==
== Basics ==
This Prototype Definition is used for the in-game achievements.
This Prototype definition is used for the in-game achievements.
==Extensions==
== Extensions ==
*[[Prototype/BuildEntityAchievement]] '''build-entity-achievement'''
*[[Prototype/BuildEntityAchievement]] '''build-entity-achievement'''
*[[Prototype/CombatRobotCount]] '''combat-robot-count'''
*[[Prototype/CombatRobotCount]] '''combat-robot-count'''
Line 18: Line 18:
*[[Prototype/ResearchAchievement]] '''research-achievement'''
*[[Prototype/ResearchAchievement]] '''research-achievement'''
*[[Prototype/TrainPathAchievement]] '''train-path-achievement'''
*[[Prototype/TrainPathAchievement]] '''train-path-achievement'''
==Mandatory Properties==
== Mandatory properties ==
Inherits all properties from [[Prototype]].
Inherits all properties from [[Prototype]].


=== icons, icon,  icon_size (IconSpecification) ===
=== icons, icon,  icon_size (IconSpecification) ===
'''Type''': [[Types/IconSpecification]]
'''Type''': [[Types/IconSpecification]]
== Optional properties ==


===steam_stats_name===
===steam_stats_name===
'''Type''': [[Types/string]]
'''Type''': [[Types/string]]
'''Default''': ""


Unusable by mods, as this refers to unlocking the achievement through Steam.
Unusable by mods, as this refers to unlocking the achievement through Steam.


==General Optional Properties==
=== allowed_without_fight ===
'''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.
 
  until_second = 60 * 60 * 8, --8 hours. 60 being seconds, 60 being hours, and 8 being the amount of hours.
 
===allowed_in_peaceful_mode===
'''Type''': [[Types/bool]]
'''Type''': [[Types/bool]]


If this is set to false, you cannot complete the achievement on the peaceful difficulty setting.
'''Default''': true


  allowed_in_peaceful_mode = true,
If this is set to false, ite is not possible to complete the achievement on the peaceful difficulty setting or when the enemy base generation settings have been changed.


===limited_to_one_game===
=== hidden ===
'''Type''': [[Types/bool]]
'''Type''': [[Types/bool]]


If this is false, the player carries over their statistics from this achievement, through all their saves.
'''Default''': false
 
  limited_to_one_game = false,


==Example==
==Example==


   {
   <syntaxhighlight lang="lua">{
     type = "kill-achievement", --This is for the achievement "[[achievements|steamrolled]]".
     type = "achievement",
     name = "steamrolled",
     name = "so-long-and-thanks-for-all-the-fish",
     order = "e[kill]-a[steamrolled]",
     order = "g[secret]-a[so-long-and-thanks-for-all-the-fish]",
    type_to_kill = "unit-spawner",
     icon = "__base__/graphics/achievement/so-long-and-thanks-for-all-the-fish.png",
    damage_type = "impact",
    icon_size = 128
    in_vehicle = true,
   }</syntaxhighlight>
    personally = true,
    amount = 10,
    steam_stats_name = "spawners-killed-by-impact",
     icon = "__base__/graphics/achievement/steamrolled.png"
   },

Revision as of 17:33, 19 May 2018

Basics

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

Extensions

Mandatory properties

Inherits all properties from Prototype.

icons, icon, icon_size (IconSpecification)

Type: Types/IconSpecification

Optional properties

steam_stats_name

Type: Types/string

Default: ""

Unusable by mods, as this refers to unlocking the achievement through Steam.

allowed_without_fight

Type: Types/bool

Default: true

If this is set to false, ite is not possible to complete the achievement on the peaceful difficulty setting or when the enemy base generation settings have been changed.

hidden

Type: Types/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
  }