RetroAchievements / docs-archive

RADocs
https://docs-archive.retroachievements.org
52 stars 10 forks source link

add a ResetIf example or template #28

Open meleu opened 5 years ago

meleu commented 5 years ago

It would be useful to have the explanation below (currently present in the ResetIf with hitcount section) as a template or even better: get an example from a real achievement in the Core.

It is very common to use a condition with a hit count of 1 as a start marker for an achievement, and use a ResetIf to cancel the achievement before the end condition is met. A common example is a damageless achievement: "From start of (level/battle), reset if damage taken, trigger at end of (level/battle)". When the start condition is true, a hit count is captured. If it's still set when the end condition is true, the achievement triggers. If the ResetIf condition triggers, the hit count on the start condition is set back to zero, which makes the condition false when evaluating the state when the end condition is true, and the achievement will not trigger.