Campaigns.wiki
changeset 2075 05d4b420182a
parent 2072 72473075540c
child 2076 0b6e80767d96
equal deleted inserted replaced
2074:de9ad743666e 2075:05d4b420182a
    76 
    76 
    77 A_Classic_Fairytale-first_blood.name="Mission 1: First Blood"
    77 A_Classic_Fairytale-first_blood.name="Mission 1: First Blood"
    78 A_Classic_Fairytale-first_blood.desc="Help Leaks a Lot to complete his training and become a proper hedgehog warrior. You will be trained in the art of rope, parachute, shoryuken and desert eagle."
    78 A_Classic_Fairytale-first_blood.desc="Help Leaks a Lot to complete his training and become a proper hedgehog warrior. You will be trained in the art of rope, parachute, shoryuken and desert eagle."
    79 }}}
    79 }}}
    80 
    80 
    81 == Campaign progress ==
    81 == Campaign variables / campaign progress ==
    82 Initially, only mission 1 is unlocked. To unlock more missions and to mark missions and the campaign as completed, you must set campaign variables. 
    82 Campaigns support campaign variables which allow to store arbitrary values about the campaign in the team file. Most importantly, the campaign progress is stored here. This uses the functions `SaveCampaignVar` and `GetCampaignVar`. Note that `SaveMissionVar` and `GetMissionVar` do *not* work in campaign missions.
    83 
    83 
    84 Read [ConfigurationFiles] to learn how campaign variables work.
    84 Initially, only mission 1 is unlocked. To unlock more missions and to mark missions and the campaign as completed, you must set campaign variables. For linear campaigns, you can use this idiom:
       
    85 
       
    86 {{{
       
    87 -- To be called when mission 5 was won:
       
    88 local missionNumber = 5
       
    89 local progress = tonumber(GetCampaignVar("Progress"))
       
    90 if progress == nil or progress < 5 then
       
    91     SaveCampaignVar("Progress", "5")
       
    92 end
       
    93 }}}
       
    94 
       
    95 For non-linear campaigns, a more sophisticated unlocking is available.
       
    96 
       
    97 Read [ConfigurationFiles] to learn how campaign variables work in detail.