Campaigns.wiki
changeset 2076 0b6e80767d96
parent 2075 05d4b420182a
child 2101 a0a6ebfa2aab
equal deleted inserted replaced
2075:05d4b420182a 2076:0b6e80767d96
    83 
    83 
    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:
    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 
    85 
    86 {{{
    86 {{{
    87 -- To be called when mission 5 was won:
    87 -- To be called when mission 5 was won:
    88 local missionNumber = 5
       
    89 local progress = tonumber(GetCampaignVar("Progress"))
    88 local progress = tonumber(GetCampaignVar("Progress"))
    90 if progress == nil or progress < 5 then
    89 if progress == nil or progress < 5 then
    91     SaveCampaignVar("Progress", "5")
    90     SaveCampaignVar("Progress", "5")
    92 end
    91 end
    93 }}}
    92 }}}