This script works in T2 (TMA) only. In TG and T1 (TDP), which do not support optional objectives, it only writes an error to the monolog.

The standard VictoryCheck script does not support objectives that are both optional and reverse; it incorrectly marks these as failed instead of completed if they are incomplete at the end of a mission. KDOptionalReverse works around this behavior to allow optional reverse objectives to exist. For each desired optional reverse objective:

This script should be placed on a fnord other than the starting point. At Sim, it will look for each objective with a goal_negation_X set and begin monitoring its state. Whenever the state of the invisible objective changes, the state of the “real” objective will be updated per the table below. At the end of the mission, this translation will happen again to correct any changes by VictoryCheck.

Mission stageInvisible objective“Real” objectiveNotes
during mission0 (incomplete)0 (incomplete)
end of mission0 (incomplete)1 (complete)The conditions were never met, so the objective is complete.
any1 (complete)2 (cancelled)The conditions were met, so the objective was breached.
2 (cancelled)2 (cancelled)Something (not VictoryCheck) has cancelled the objective.
3 (failed)3 (failed)Like any optional objective, the invisible objective should never reach a state of 3 (failed), or else the mission will fail.
This script is part of the KDScript module. Copyright © 2012–2013 Kevin Daughtridge. See introduction for details.